From 7f0777a706306d289a883c7ab2e5b6a4105b7bbd Mon Sep 17 00:00:00 2001 From: Rob Kelly Date: Sat, 21 Dec 2024 18:33:00 -0700 Subject: [PATCH] Better organization for game setup screens --- .../deathmatch_setup/deathmatch_setup.tscn | 25 +++++++------------ .../practice_setup/practice_setup.tscn | 25 +++++++------------ 2 files changed, 18 insertions(+), 32 deletions(-) diff --git a/src/ui/menus/title_screen/deathmatch_setup/deathmatch_setup.tscn b/src/ui/menus/title_screen/deathmatch_setup/deathmatch_setup.tscn index 31373de..a9ff4b0 100644 --- a/src/ui/menus/title_screen/deathmatch_setup/deathmatch_setup.tscn +++ b/src/ui/menus/title_screen/deathmatch_setup/deathmatch_setup.tscn @@ -97,10 +97,11 @@ layout_mode = 2 theme_override_constants/margin_left = 32 theme_override_constants/margin_top = 32 theme_override_constants/margin_right = 32 -theme_override_constants/margin_bottom = 92 +theme_override_constants/margin_bottom = 32 [node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] layout_mode = 2 +theme_override_constants/separation = 16 [node name="Label" type="Label" parent="MarginContainer/VBoxContainer"] layout_mode = 2 @@ -226,36 +227,28 @@ layout_mode = 2 text = "DM_ADD_PLAYER" horizontal_alignment = 1 -[node name="SouthEast" type="MarginContainer" parent="."] -layout_mode = 2 -size_flags_horizontal = 8 -size_flags_vertical = 8 -theme_override_constants/margin_left = 16 -theme_override_constants/margin_top = 16 -theme_override_constants/margin_right = 32 -theme_override_constants/margin_bottom = 16 - -[node name="HBoxContainer" type="HBoxContainer" parent="SouthEast"] +[node name="Buttons" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] layout_mode = 2 theme_override_constants/separation = 16 +alignment = 2 -[node name="Cancel" type="Button" parent="SouthEast/HBoxContainer"] +[node name="Cancel" type="Button" parent="MarginContainer/VBoxContainer/Buttons"] layout_mode = 2 theme_type_variation = &"CancelButton" text = "UI_CANCEL" -[node name="Start" type="Button" parent="SouthEast/HBoxContainer"] +[node name="Start" type="Button" parent="MarginContainer/VBoxContainer/Buttons"] unique_name_in_owner = true layout_mode = 2 theme_type_variation = &"AlertButton" text = "UI_START" -[node name="AnimationPlayer" type="AnimationPlayer" parent="SouthEast/HBoxContainer/Start"] +[node name="AnimationPlayer" type="AnimationPlayer" parent="MarginContainer/VBoxContainer/Buttons/Start"] libraries = { "": SubResource("AnimationLibrary_s1eyj") } [connection signal="item_selected" from="MarginContainer/VBoxContainer/MapSelectContainer/MarginContainer/VBoxContainer/MapSelect" to="." method="check_start_conditions" unbinds=1] [connection signal="pressed" from="MarginContainer/VBoxContainer/PlayersContainer/MarginContainer/VBoxContainer/ScrollContainer/MarginContainer/HBoxContainer/AddPlayerButton" to="." method="_on_add_player_button_pressed"] -[connection signal="pressed" from="SouthEast/HBoxContainer/Cancel" to="." method="cancel"] -[connection signal="pressed" from="SouthEast/HBoxContainer/Start" to="SouthEast/HBoxContainer/Start/AnimationPlayer" method="play" binds= ["fade_out"]] +[connection signal="pressed" from="MarginContainer/VBoxContainer/Buttons/Cancel" to="." method="cancel"] +[connection signal="pressed" from="MarginContainer/VBoxContainer/Buttons/Start" to="MarginContainer/VBoxContainer/Buttons/Start/AnimationPlayer" method="play" binds= ["fade_out"]] diff --git a/src/ui/menus/title_screen/practice_setup/practice_setup.tscn b/src/ui/menus/title_screen/practice_setup/practice_setup.tscn index 3455688..86de938 100644 --- a/src/ui/menus/title_screen/practice_setup/practice_setup.tscn +++ b/src/ui/menus/title_screen/practice_setup/practice_setup.tscn @@ -116,10 +116,11 @@ layout_mode = 2 theme_override_constants/margin_left = 32 theme_override_constants/margin_top = 32 theme_override_constants/margin_right = 32 -theme_override_constants/margin_bottom = 92 +theme_override_constants/margin_bottom = 32 [node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] layout_mode = 2 +theme_override_constants/separation = 16 [node name="Label" type="Label" parent="MarginContainer/VBoxContainer"] layout_mode = 2 @@ -163,35 +164,27 @@ max_columns = 8 icon_mode = 0 fixed_icon_size = Vector2i(64, 64) -[node name="SouthEast" type="MarginContainer" parent="."] -layout_mode = 2 -size_flags_horizontal = 8 -size_flags_vertical = 8 -theme_override_constants/margin_left = 16 -theme_override_constants/margin_top = 16 -theme_override_constants/margin_right = 32 -theme_override_constants/margin_bottom = 16 - -[node name="HBoxContainer" type="HBoxContainer" parent="SouthEast"] +[node name="Buttons" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] layout_mode = 2 theme_override_constants/separation = 16 +alignment = 2 -[node name="Cancel" type="Button" parent="SouthEast/HBoxContainer"] +[node name="Cancel" type="Button" parent="MarginContainer/VBoxContainer/Buttons"] layout_mode = 2 theme_type_variation = &"CancelButton" text = "UI_CANCEL" -[node name="Start" type="Button" parent="SouthEast/HBoxContainer"] +[node name="Start" type="Button" parent="MarginContainer/VBoxContainer/Buttons"] unique_name_in_owner = true layout_mode = 2 theme_type_variation = &"AlertButton" text = "UI_START" -[node name="AnimationPlayer" type="AnimationPlayer" parent="SouthEast/HBoxContainer/Start"] +[node name="AnimationPlayer" type="AnimationPlayer" parent="MarginContainer/VBoxContainer/Buttons/Start"] libraries = { "": SubResource("AnimationLibrary_s1eyj") } [connection signal="item_selected" from="MarginContainer/VBoxContainer/MapSelectContainer/MarginContainer/VBoxContainer/MapSelect" to="." method="check_start_conditions" unbinds=1] -[connection signal="pressed" from="SouthEast/HBoxContainer/Cancel" to="." method="cancel"] -[connection signal="pressed" from="SouthEast/HBoxContainer/Start" to="SouthEast/HBoxContainer/Start/AnimationPlayer" method="play" binds= ["fade_out"]] +[connection signal="pressed" from="MarginContainer/VBoxContainer/Buttons/Cancel" to="." method="cancel"] +[connection signal="pressed" from="MarginContainer/VBoxContainer/Buttons/Start" to="MarginContainer/VBoxContainer/Buttons/Start/AnimationPlayer" method="play" binds= ["fade_out"]]