feat: added loadout options to the main menu
This commit is contained in:
@@ -49,6 +49,7 @@ func _ready() -> void:
|
||||
# Buttons
|
||||
_add_button(_ui_vbox, "Singleplayer", _on_singleplayer_pressed)
|
||||
_add_button(_ui_vbox, "Multiplayer", _on_multiplayer_pressed)
|
||||
_add_button(_ui_vbox, "Loadouts", _on_loadouts_pressed)
|
||||
_add_button(_ui_vbox, "Settings", _on_settings_pressed)
|
||||
_add_button(_ui_vbox, "Exit Game", _on_exit_pressed)
|
||||
|
||||
@@ -160,8 +161,17 @@ func _on_singleplayer_pressed() -> void:
|
||||
func _on_multiplayer_pressed() -> void:
|
||||
print("Multiplayer not implemented yet.")
|
||||
|
||||
func _on_loadouts_pressed() -> void:
|
||||
if has_node("/root/PauseMenu"):
|
||||
var pm = get_node("/root/PauseMenu")
|
||||
pm.visible = true
|
||||
pm._show_loadouts()
|
||||
|
||||
func _on_settings_pressed() -> void:
|
||||
print("Settings not implemented yet.")
|
||||
if has_node("/root/PauseMenu"):
|
||||
var pm = get_node("/root/PauseMenu")
|
||||
pm.visible = true
|
||||
pm._show_settings()
|
||||
|
||||
func _on_exit_pressed() -> void:
|
||||
get_tree().quit()
|
||||
|
||||
@@ -652,6 +652,10 @@ func _return_to_main_menu() -> void:
|
||||
get_tree().change_scene_to_file("res://ui/main_menu/main_menu.tscn")
|
||||
|
||||
func _show_main_menu() -> void:
|
||||
if get_tree().current_scene and get_tree().current_scene.name == "MainMenu":
|
||||
visible = false
|
||||
return
|
||||
|
||||
main_vbox.visible = true
|
||||
loadout_editor.visible = false
|
||||
settings_editor.visible = false
|
||||
|
||||
Reference in New Issue
Block a user