Select tab for current playground on start

This commit is contained in:
2023-02-15 06:16:58 -07:00
parent 008eea39cf
commit 045a080e69
2 changed files with 9 additions and 3 deletions

View File

@@ -24,11 +24,19 @@
->[archive e &opt ui]
null))
(prop &mut :TabContainer pgTabs null)
(prop &mut :ScrollContainer pgScrollContainer null)
(prop &mut :Node pgEntries null)
(method &override :Void switchPlaygroundKey [:String key]
(set pgScrollContainer (getNode rootNode.pgTabs key))
(set pgTabs rootNode.pgTabs)
(unless (= .name (pgTabs.getChild pgTabs.currentTab) key)
(doFor [idx :Control tab] (enumerate (collect (pgTabs.getChildren)) -1)
(when (and tab (= tab.name key))
(set pgTabs.currentTab idx))))
(set pgScrollContainer (getNode pgTabs key))
(set pgEntries (getNode pgScrollContainer "Entries"))
(super.switchPlaygroundKey key))

View File

@@ -22,8 +22,6 @@ class PlaygroundEntries extends Control {
public override function dropData(position:Vector2, data:Dynamic):Void {
var data:EntryPanel = cast(data);
data.rectPosition = position;
kiss.Prelude.print(ui);
kiss.Prelude.print(data.e);
ui.playgroundSystem().savePosition(data.e, position.x, position.y, data.z);
}
}