revert the use of KeyShortcutWindow in NAT flixel

This commit is contained in:
2022-09-07 00:48:17 +00:00
parent 9991807c2b
commit 3558f8dbbc

View File

@@ -109,10 +109,13 @@
(clearUI)) (clearUI))
(prop &mut :Bool confirmQuit false) (prop &mut :Bool confirmQuit false)
(prop &mut :KeyShortcutWindow<Entry> shw) (defAlias &ident sh (cast shortcutHandler FlxKeyShortcutHandler<Dynamic>))
(method &override :Void update [:Float elapsed] (method &override :Void update [:Float elapsed]
(super.update elapsed) (super.update elapsed)
(when sh.currentMap
(sh.update))
(when (and FlxG.keys.justPressed.V FlxG.keys.pressed.CONTROL) (when (and FlxG.keys.justPressed.V FlxG.keys.pressed.CONTROL)
(when (and textInput textInput.hasFocus) (when (and textInput textInput.hasFocus)
(whenLet [text (Clipboard.generalClipboard.getData ClipboardFormats.TEXT_FORMAT)] (whenLet [text (Clipboard.generalClipboard.getData ClipboardFormats.TEXT_FORMAT)]
@@ -129,8 +132,8 @@
// This part is hacky... // This part is hacky...
(set lastUI textInputLabel) (set lastUI textInputLabel)
(hideUI textInputLabel)) (hideUI textInputLabel))
((and shw (shw.isShown)) (~sh.currentMap
(shw.hide)) (sh.cancel))
(confirmQuit (confirmQuit
(Sys.exit 0)) (Sys.exit 0))
(true (true
@@ -166,12 +169,10 @@
(FlxG.camera.updateScrollWheelZoom elapsed 1) (FlxG.camera.updateScrollWheelZoom elapsed 1)
// Don't check keys that can be used in shortcuts outside this block: // Don't check keys that can be used in shortcuts outside this block:
(unless (or (and shw (shw.isShown)) (and textInput textInput.hasFocus)) (unless (or sh.currentMap (and textInput textInput.hasFocus))
(when FlxG.keys.justPressed.SEMICOLON (when FlxG.keys.justPressed.SEMICOLON
(set confirmQuit false) (set confirmQuit false)
(set shw (new KeyShortcutWindow shortcutHandler ->[:Entry e] (readComponentOr e Name "unnamed entry"))) (sh.start)
(set shw.cameras [uiCamera])
(shw.show)
(return)) (return))
// +/- keys to change an entry's z // +/- keys to change an entry's z
(doFor e (controller.getSelectedEntries) (doFor e (controller.getSelectedEntries)