Added navigation to main menu options

This commit is contained in:
Marco 2025-03-12 15:47:57 +01:00
commit 316880cf9d
6 changed files with 54 additions and 8 deletions

View file

@ -25,11 +25,12 @@ font_size = 12
outline_size = 4
outline_color = Color(0, 0, 0, 1)
[node name="MainMenu" type="CanvasLayer" node_paths=PackedStringArray("SubMenuHolder", "MusicPlayer")]
[node name="MainMenu" type="CanvasLayer" node_paths=PackedStringArray("SubMenuHolder", "DefaultSelectedButton", "MusicPlayer")]
script = ExtResource("1_702nk")
GameScene = "res://Scenes/Maps/Tutorial.tscn"
MainMenuScene = "res://Scenes/MainMenu.tscn"
SubMenuHolder = NodePath("SubMenuContainer")
DefaultSelectedButton = NodePath("MarginContainer/GridContainer/GameButtons/StartButton")
MusicPlayer = NodePath("AudioStreamPlayer2D")
MusicRoomTemplate = ExtResource("2_if7li")
DebugMenuTemplate = ExtResource("9_nwlsr")
@ -70,23 +71,43 @@ size_flags_vertical = 6
[node name="StartButton" type="Button" parent="MarginContainer/GridContainer/GameButtons"]
layout_mode = 2
focus_neighbor_left = NodePath("../../Options/OptionsButton")
focus_neighbor_top = NodePath("../ExitButton")
focus_neighbor_right = NodePath("../../Options/OptionsButton")
focus_neighbor_bottom = NodePath("../ContinueButton")
focus_next = NodePath("../ContinueButton")
focus_previous = NodePath("../ExitButton")
theme = ExtResource("4_nk7wn")
text = "New
Game"
[node name="DebugButton2" type="Button" parent="MarginContainer/GridContainer/GameButtons"]
[node name="ContinueButton" type="Button" parent="MarginContainer/GridContainer/GameButtons"]
layout_mode = 2
focus_neighbor_left = NodePath("../../Options/MusicRoomButton")
focus_neighbor_top = NodePath("../StartButton")
focus_neighbor_right = NodePath("../../Options/MusicRoomButton")
focus_neighbor_bottom = NodePath("../DebugButton")
focus_next = NodePath("../DebugButton")
focus_previous = NodePath("../StartButton")
theme = ExtResource("4_nk7wn")
theme_override_styles/normal = ExtResource("7_rrcx7")
text = "Continue"
[node name="DebugButton" type="Button" parent="MarginContainer/GridContainer/GameButtons"]
layout_mode = 2
focus_neighbor_left = NodePath("../../Options/CreditsButton")
focus_neighbor_top = NodePath("../ContinueButton")
focus_neighbor_right = NodePath("../../Options/CreditsButton")
focus_neighbor_bottom = NodePath("../ExitButton")
theme = ExtResource("4_nk7wn")
text = "Debug"
[node name="ExitButton" type="Button" parent="MarginContainer/GridContainer/GameButtons"]
layout_mode = 2
focus_neighbor_left = NodePath("../../Options/CreditsButton")
focus_neighbor_top = NodePath("../DebugButton")
focus_neighbor_right = NodePath("../../Options/CreditsButton")
focus_neighbor_bottom = NodePath("../StartButton")
theme = ExtResource("4_nk7wn")
text = "Exit
"
@ -130,17 +151,26 @@ size_flags_vertical = 6
[node name="OptionsButton" type="Button" parent="MarginContainer/GridContainer/Options"]
layout_mode = 2
focus_neighbor_left = NodePath("../../GameButtons/StartButton")
focus_neighbor_top = NodePath("../CreditsButton")
focus_neighbor_right = NodePath("../../GameButtons/StartButton")
focus_neighbor_bottom = NodePath("../MusicRoomButton")
theme = ExtResource("4_nk7wn")
text = "Options"
[node name="MusicRoomButton" type="Button" parent="MarginContainer/GridContainer/Options"]
layout_mode = 2
focus_neighbor_left = NodePath("../../GameButtons/ContinueButton")
focus_neighbor_top = NodePath("../OptionsButton")
focus_neighbor_right = NodePath("../../GameButtons/ContinueButton")
focus_neighbor_bottom = NodePath("../CreditsButton")
theme = ExtResource("4_nk7wn")
text = "Music
Room"
[node name="CreditsButton" type="Button" parent="MarginContainer/GridContainer/Options"]
layout_mode = 2
focus_neighbor_right = NodePath("../../GameButtons/DebugButton")
theme = ExtResource("4_nk7wn")
text = "Credits"
@ -158,7 +188,7 @@ offset_bottom = 156.0
theme_override_styles/panel = ExtResource("7_rrcx7")
[connection signal="pressed" from="MarginContainer/GridContainer/GameButtons/StartButton" to="." method="_on_start_button_pressed"]
[connection signal="pressed" from="MarginContainer/GridContainer/GameButtons/DebugButton2" to="." method="_on_debug_button_pressed"]
[connection signal="pressed" from="MarginContainer/GridContainer/GameButtons/ContinueButton" to="." method="_on_debug_button_pressed"]
[connection signal="pressed" from="MarginContainer/GridContainer/GameButtons/DebugButton" to="." method="_on_debug_button_pressed"]
[connection signal="pressed" from="MarginContainer/GridContainer/GameButtons/ExitButton" to="." method="_on_exit_button_pressed"]
[connection signal="pressed" from="MarginContainer/GridContainer/Options/OptionsButton" to="." method="OnOptionsButtonPressed"]