diff --git a/projects/nat-godot-playground/scripts/EntryPanelSystem.kiss b/projects/nat-godot-playground/scripts/EntryPanelSystem.kiss index c0600f4d..ca66e02a 100644 --- a/projects/nat-godot-playground/scripts/EntryPanelSystem.kiss +++ b/projects/nat-godot-playground/scripts/EntryPanelSystem.kiss @@ -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)) diff --git a/projects/nat-godot-playground/scripts/PlaygroundEntries.hx b/projects/nat-godot-playground/scripts/PlaygroundEntries.hx index 2c99d83a..5f4276e6 100644 --- a/projects/nat-godot-playground/scripts/PlaygroundEntries.hx +++ b/projects/nat-godot-playground/scripts/PlaygroundEntries.hx @@ -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); } }