Added keyboard control to main menu. Reworked logic

This commit is contained in:
2025-10-19 19:15:03 +03:00
parent 83b14d31cd
commit e09303f1b8
12 changed files with 349 additions and 84 deletions
+22
View File
@@ -5,6 +5,28 @@ signal new_game
signal quit_game
signal show_options
func _ready() -> void:
_init_focus()
_setup_neighbors()
func _init_focus() -> void:
if $%ContinueButton.disabled:
$%StartButton.grab_focus()
else:
$%ContinueButton.grab_focus()
func _setup_neighbors() -> void:
if $%ContinueButton.disabled:
$%ContinueButton.focus_neighbor_top = ""
$%StartButton.focus_neighbor_top = $%QuitButton.get_path()
$%QuitButton.focus_neighbor_bottom = $%StartButton.get_path()
else:
$%ContinueButton.focus_neighbor_top = $%QuitButton.get_path()
$%StartButton.focus_neighbor_top = ""
$%QuitButton.focus_neighbor_bottom = $%ContinueButton.get_path()
func _on_continue_button_pressed() -> void:
continue_game.emit()