From a2ef1c34cb68cc71f0696cc53a3c1a549a3eb638 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Sun, 22 Mar 2026 18:41:24 +0100 Subject: [PATCH] fix(client): create TabContainer children programmatically Godot 4.6 TabContainer silently destroys children defined in .tscn during scene instantiation ("Parent path has vanished"). Moving tab shell creation to _ready() fixes the right-side settings panel. Co-Authored-By: Claude Opus 4.6 --- client/scenes/character_creation.tscn | 16 +--------------- client/ui/character_creation.gd | 7 +++++++ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/client/scenes/character_creation.tscn b/client/scenes/character_creation.tscn index e63362a50..fa0eac502 100644 --- a/client/scenes/character_creation.tscn +++ b/client/scenes/character_creation.tscn @@ -157,21 +157,7 @@ size_flags_vertical = 3 theme_override_font_sizes/font_size = 12 theme_override_colors/font_color = Color(0.784, 0.816, 0.878, 1.0) -; Five empty tab shells — content built programmatically in character_creation.gd -[node name="Body" type="Control" parent="Layout/TabPanel/TabContainer"] -layout_mode = 2 - -[node name="Head" type="Control" parent="Layout/TabPanel/TabContainer"] -layout_mode = 2 - -[node name="Hair" type="Control" parent="Layout/TabPanel/TabContainer"] -layout_mode = 2 - -[node name="Clothing" type="Control" parent="Layout/TabPanel/TabContainer"] -layout_mode = 2 - -[node name="Accessories" type="Control" parent="Layout/TabPanel/TabContainer"] -layout_mode = 2 +; Tab shells created programmatically in character_creation.gd _ready() ; =========================================================================== ; Footer — full width, 48px tall, anchored to bottom diff --git a/client/ui/character_creation.gd b/client/ui/character_creation.gd index 0c64ef65e..6e9da693a 100644 --- a/client/ui/character_creation.gd +++ b/client/ui/character_creation.gd @@ -221,6 +221,13 @@ func _ready() -> void: _rotate_left_btn.text = UIStrings.get_text("character_creation.btn_rotate_left") _rotate_right_btn.text = UIStrings.get_text("character_creation.btn_rotate_right") + # Create tab shells programmatically (Godot 4.6 TabContainer requires runtime children) + var tab_names: Array[String] = ["Body", "Head", "Hair", "Clothing", "Accessories"] + for tab_name in tab_names: + var tab := Control.new() + tab.name = tab_name + _tab_container.add_child(tab) + _build_body_tab(_tab_container.get_child(0)) _build_head_tab(_tab_container.get_child(1)) _build_hair_tab(_tab_container.get_child(2))