diff --git a/projects/nat-archive-tool/src/nat/ArchiveController.hx b/projects/nat-archive-tool/src/nat/ArchiveController.hx index ef7ac843..2035ebf6 100644 --- a/projects/nat-archive-tool/src/nat/ArchiveController.hx +++ b/projects/nat-archive-tool/src/nat/ArchiveController.hx @@ -23,10 +23,13 @@ enum CommandArgType { // Make the user select Entry(s) when called interactively OneEntry; // This constructor must be disambiguated from the typedef "Entry" Entries(min:Null, max:Null); + // TODO Tag -- make sure a tag input is a valid haxe variable name for tagsMatch compatibility // TODO VarTag + // What I really want is tags autocomplete, which is UNREALISTIC - // TODO playground name -- choose from archive.playgrounds + // TODO File + // TODO Files Position; diff --git a/projects/nat-archive-tool/src/nat/ArchiveController.kiss b/projects/nat-archive-tool/src/nat/ArchiveController.kiss index f20a34ed..f5b6d9ca 100644 --- a/projects/nat-archive-tool/src/nat/ArchiveController.kiss +++ b/projects/nat-archive-tool/src/nat/ArchiveController.kiss @@ -407,6 +407,13 @@ (SelectEntries []) (when playgroundSystem (playgroundSystem.switchPlaygroundKey name)) []) + + (defCommand ChoosePlayground [] + (ui.chooseBetweenStrings + "Choose a playground:" + (for =>key _ archive.playgrounds (if (= key "default") (continue) key)) + ->pg (SwitchPlayground pg)) + []) (defCommand AddConnections [entries (SelectedEntries 1 null) entriesToConnect (Entries 1 null)] (for e entries diff --git a/projects/nat-archive-tool/src/nat/ArchiveUI.hx b/projects/nat-archive-tool/src/nat/ArchiveUI.hx index 592a5d6d..db388fb9 100644 --- a/projects/nat-archive-tool/src/nat/ArchiveUI.hx +++ b/projects/nat-archive-tool/src/nat/ArchiveUI.hx @@ -75,4 +75,9 @@ interface ArchiveUI { * A way to tell NAT where the cursor is */ function cursorPosition():Option; + + /** + * Prompt the user between some string options + */ + function chooseBetweenStrings(prompt:String, choices:Array, resolve:String->Void):Void; } diff --git a/projects/nat-flixel-desktop-playground/source/PlayState.kiss b/projects/nat-flixel-desktop-playground/source/PlayState.kiss index d562f8fd..8c3cfcbc 100644 --- a/projects/nat-flixel-desktop-playground/source/PlayState.kiss +++ b/projects/nat-flixel-desktop-playground/source/PlayState.kiss @@ -230,6 +230,13 @@ (displayMessage prompt) (set resolvePosition resolve)) +(method :Void chooseBetweenStrings [prompt :Array choices resolve] + (clearUI) + (displayMessage prompt) + (doFor choice choices + (uiWindow.makeText choice null ->_ {(clearUI)(resolve choice)})) + (uiWindow.show)) + (method :Option cursorPosition [] (let [pos (FlxG.mouse.getWorldPosition FlxG.camera)] (Some (object x pos.x y pos.y z 0.0)))) \ No newline at end of file