1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

Allow for closing screenshot dialog with same key

This commit is contained in:
EmeraldBlock 2021-06-01 18:38:31 -05:00
parent 3f01c131c3
commit 3eddf88fd3

View File

@ -79,6 +79,12 @@ export class HUDScreenshotExporter extends BaseHUDPart {
buttons: ["cancel:good", "ok:bad"],
});
dialog.inputReciever.keydown.add(({ keyCode }) => {
if (keyCode === KEYMAPPINGS.ingame.exportScreenshot.keyCode) {
this.root.hud.parts.dialogs.closeDialog(dialog);
}
});
this.root.hud.parts.dialogs.internalShowDialog(dialog);
dialog.buttonSignals.ok.add(
() => this.doExport(qualityInput.getValue(), overlayInput.getValue(), layerInput.getValue()),