Added menu sound

This commit is contained in:
2026-01-09 00:36:16 +03:00
parent bc0c494244
commit bd0dd5a9ec
36 changed files with 882 additions and 351 deletions
+7 -8
View File
@@ -8,26 +8,25 @@ extends Control
func _ready() -> void:
_init_focus()
_setup_neighbors()
func _init_focus() -> void:
start_button.grab_focus()
get_viewport().gui_focus_changed.connect(_on_gui_focus_changed)
func _setup_neighbors() -> void:
start_button.focus_neighbor_top = quit_button.get_path()
quit_button.focus_neighbor_bottom = start_button.get_path()
func _on_gui_focus_changed(_node: Control) -> void:
SoundManager.play_ui_stream(SoundManager.ui_stream_select)
func _on_start_button_pressed() -> void:
SoundManager.play_ui_stream(SoundManager.ui_stream_accept)
get_tree().change_scene_to_file("res://game/menu/level_selection.tscn")
func _on_options_button_pressed() -> void:
SoundManager.play_ui_stream(SoundManager.ui_stream_accept)
get_tree().change_scene_to_file("res://game/menu/options_menu.tscn")
func _on_quit_button_pressed() -> void:
var stream_player := SoundManager.play_ui_stream(SoundManager.ui_stream_decline)
await stream_player.finished
get_tree().quit()