Various UI fixes in NAT flixel

This commit is contained in:
2022-12-18 05:43:51 +00:00
parent f23e1ca622
commit 25f61c16c9

View File

@@ -53,6 +53,7 @@
(prop &mut :Bool confirmQuit false) (prop &mut :Bool confirmQuit false)
(defAlias &ident sh (cast shortcutHandler FlxKeyShortcutHandler<Dynamic>)) (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)
@@ -68,6 +69,7 @@
(set textInput.caretIndex textInput.text.length)))) (set textInput.caretIndex textInput.text.length))))
(when FlxG.keys.justPressed.ESCAPE (when FlxG.keys.justPressed.ESCAPE
(clearUI)
(when sh.currentMap (when sh.currentMap
(sh.cancel))) (sh.cancel)))
(when FlxG.keys.justPressed.DELETE (when FlxG.keys.justPressed.DELETE
@@ -117,6 +119,7 @@
(+= .z (dictGet positions (spriteSystem.getPlaygroundKey)) 1)))))) (+= .z (dictGet positions (spriteSystem.getPlaygroundKey)) 1))))))
(method :Void typeCommand [] (method :Void typeCommand []
(sh.cancel)
(enterText (enterText
"command to run:" "command to run:"
->commandName (controller.tryRunCommand commandName) ->commandName (controller.tryRunCommand commandName)
@@ -140,7 +143,7 @@
([text FlxInputText.ENTER_ACTION] ([text FlxInputText.ENTER_ACTION]
(clearUI) (clearUI)
(set textInput.callback null) (set textInput.callback null)
(set textInput null) (textInput.kill)
(resolve text)) (resolve text))
//([_ FlxInputText.]) //([_ FlxInputText.])
(otherwise {})))) (otherwise {}))))
@@ -206,6 +209,9 @@
(uiWindow.show)) (uiWindow.show))
(method :Void clearUI [] (method :Void clearUI []
(when textInput
(textInput.kill)
(set textInput.callback null))
(uiWindow.clearControls) (uiWindow.clearControls)
(uiWindow.hide)) (uiWindow.hide))