diff --git a/Scenes/Game.tscn b/Scenes/Game.tscn index a56a71e..e977c01 100644 --- a/Scenes/Game.tscn +++ b/Scenes/Game.tscn @@ -185,8 +185,8 @@ size_flags_horizontal = 3 size_flags_vertical = 3 theme_override_constants/separation = 10 -[node name="Popup" type="PanelContainer" parent="CanvasLayer/Control" unique_id=311359170] -layout_mode = 1 +[node name="Popup" type="Control" parent="CanvasLayer" unique_id=1989677138] +layout_mode = 3 anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 @@ -199,22 +199,30 @@ offset_bottom = 20.0 grow_horizontal = 2 grow_vertical = 2 -[node name="RobotNaming" type="VBoxContainer" parent="CanvasLayer/Control/Popup" unique_id=39200128] +[node name="RobotNaming" type="PanelContainer" parent="CanvasLayer/Popup" unique_id=311359170] visible = false +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/Popup/RobotNaming" unique_id=39200128] layout_mode = 2 -[node name="RichTextLabel" type="RichTextLabel" parent="CanvasLayer/Control/Popup/RobotNaming" unique_id=1964282829] +[node name="RichTextLabel" type="RichTextLabel" parent="CanvasLayer/Popup/RobotNaming/VBoxContainer" unique_id=1964282829] layout_mode = 2 text = "Name your robot:" fit_content = true autowrap_mode = 0 -[node name="LineEdit" type="LineEdit" parent="CanvasLayer/Control/Popup/RobotNaming" unique_id=1713423672] +[node name="LineEdit" type="LineEdit" parent="CanvasLayer/Popup/RobotNaming/VBoxContainer" unique_id=1713423672] layout_mode = 2 placeholder_text = "Name..." max_length = 24 -[node name="Button" type="Button" parent="CanvasLayer/Control/Popup/RobotNaming" unique_id=279251707] +[node name="Button" type="Button" parent="CanvasLayer/Popup/RobotNaming/VBoxContainer" unique_id=279251707] layout_mode = 2 text = "Submit" diff --git a/Scripts/Helpers/UIHandler.cs b/Scripts/Helpers/UIHandler.cs index e379030..812675c 100644 --- a/Scripts/Helpers/UIHandler.cs +++ b/Scripts/Helpers/UIHandler.cs @@ -23,11 +23,11 @@ public partial class UIHandler : Control public void ShowNamingPopup(Robot robot) { - VBoxContainer namingContainer = GetNode("./Popup/RobotNaming"); + PanelContainer namingContainer = GetNode("../Popup/RobotNaming"); namingContainer.Visible = true; GameData.canMove = false; - LineEdit name = namingContainer.GetNode("./LineEdit"); - Button button = namingContainer.GetNode