NAT flixel playground multiple playground views

This commit is contained in:
2022-07-02 23:10:47 +00:00
parent bcd1eca9a0
commit d17ebf9a1d
16 changed files with 104 additions and 92 deletions

View File

@@ -146,6 +146,8 @@
(method getSelectedEntries []
(_selectedEntries.copy))
(prop &mut :PlaygroundSystem playgroundSystem null)
(defNew [&prop :Archive archive
&prop :ArchiveUI ui]
[&mut :Array<Entry> _selectedEntries []
@@ -163,14 +165,14 @@
(archive.addSystem (new KeyShortcutSystem this))
(archive.addSystem (new DLSystem))
(whenLet [ps (ui.playgroundSystem)]
(set playgroundSystem ps)
(archive.addSystem ps)
// TODO allow saving a different default playground
(ps.switchPlaygroundKey "Playground-MAIN"))
(ps.switchPlaygroundKey (dictGet archive.playgrounds "default")))
// Just for testing:
// (archive.addSystem (new AttachmentSystem ["jpg" "jpeg" "png"] ->[archive e files] ~files))
(archive.processSystems)
(archive.processSystems ui)
(defCommand Help []
(ui.displayMessage
@@ -261,4 +263,12 @@
(withWritableComponents archive e [scaleComponent Scale]
(set scaleComponent scale))
(addComponent archive e Scale scale)))
entries))
entries)
(defCommand CreatePlayground [name (Text null) catsMatchExp (Text null)]
(archive.changePlaygrounds ->:Void [:DynamicAccess<Dynamic> p]
(dictSet p name (object catsMatch catsMatchExp))))
(defCommand SwitchPlayground [name (Text null)]
(archive.changePlaygrounds ->:Void [:DynamicAccess<Dynamic> p] (dictSet p "default" name))
(when playgroundSystem (playgroundSystem.switchPlaygroundKey name))))