Move typeCommand() into ArchiveController

This commit is contained in:
2023-02-15 11:44:13 -07:00
parent 045a080e69
commit 8b9aeec944
2 changed files with 11 additions and 8 deletions

View File

@@ -282,6 +282,16 @@
(prop &mut :PlaygroundSystem<Dynamic> playgroundSystem null) (prop &mut :PlaygroundSystem<Dynamic> playgroundSystem null)
(method :Void typeCommand []
(when ui.shortcutHandler (ui.shortcutHandler.cancel))
(ui.enterText
"Command:"
->command
(tryRunCommand command)
Math.POSITIVE_INFINITY))
// TODO typeShortcut
(defNew [&prop :Archive archive (defNew [&prop :Archive archive
&prop :ArchiveUI ui] &prop :ArchiveUI ui]
[&mut :Array<Entry> _selectedEntries [] [&mut :Array<Entry> _selectedEntries []

View File

@@ -78,7 +78,7 @@
// Press ENTER to type a command to run // Press ENTER to type a command to run
(when (and !textInput FlxG.keys.justPressed.ENTER) (when (and !textInput FlxG.keys.justPressed.ENTER)
(set confirmQuit false) (set confirmQuit false)
(typeCommand)) (controller.typeCommand))
(when (and textInput !textInput.alive) (when (and textInput !textInput.alive)
(set textInput null)) (set textInput null))
@@ -118,13 +118,6 @@
(withWritableComponents archive e [positions Positions] (withWritableComponents archive e [positions Positions]
(+= .z (dictGet positions (spriteSystem.getPlaygroundKey)) 1)))))) (+= .z (dictGet positions (spriteSystem.getPlaygroundKey)) 1))))))
(method :Void typeCommand []
(sh.cancel)
(enterText
"command to run:"
->commandName (controller.tryRunCommand commandName)
Math.POSITIVE_INFINITY))
(prop &mut :ArchiveController controller) (prop &mut :ArchiveController controller)
(prop &mut :Archive archive) (prop &mut :Archive archive)