Reworked for tabs. Added Player
This commit is contained in:
+3
-3
@@ -4,8 +4,8 @@ signal show_main_menu
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
$%MainMenuButton.grab_focus()
|
||||
|
||||
$%MainMenuButton.grab_focus()
|
||||
|
||||
|
||||
func _on_main_menu_button_pressed() -> void:
|
||||
show_main_menu.emit()
|
||||
show_main_menu.emit()
|
||||
|
||||
+18
-18
@@ -6,39 +6,39 @@ signal quit_game
|
||||
signal show_options
|
||||
|
||||
func _ready() -> void:
|
||||
_init_focus()
|
||||
_setup_neighbors()
|
||||
_init_focus()
|
||||
_setup_neighbors()
|
||||
|
||||
|
||||
func _init_focus() -> void:
|
||||
if $%ContinueButton.disabled:
|
||||
$%StartButton.grab_focus()
|
||||
else:
|
||||
$%ContinueButton.grab_focus()
|
||||
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()
|
||||
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()
|
||||
continue_game.emit()
|
||||
|
||||
|
||||
func _on_start_button_pressed() -> void:
|
||||
new_game.emit()
|
||||
new_game.emit()
|
||||
|
||||
|
||||
func _on_options_button_pressed() -> void:
|
||||
show_options.emit()
|
||||
show_options.emit()
|
||||
|
||||
|
||||
func _on_quit_button_pressed() -> void:
|
||||
quit_game.emit()
|
||||
quit_game.emit()
|
||||
|
||||
+17
-17
@@ -5,43 +5,43 @@ signal show_main_menu
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_load_current_settings()
|
||||
_init_focus()
|
||||
_setup_neighbors()
|
||||
|
||||
_load_current_settings()
|
||||
_init_focus()
|
||||
_setup_neighbors()
|
||||
|
||||
|
||||
func _init_focus() -> void:
|
||||
$%FullscreenCheckButton.grab_focus()
|
||||
$%FullscreenCheckButton.grab_focus()
|
||||
|
||||
|
||||
func _setup_neighbors() -> void:
|
||||
$%CreditsButton.focus_neighbor_left = $%BackButton.get_path()
|
||||
$%BackButton.focus_neighbor_right = $%CreditsButton.get_path()
|
||||
$%CreditsButton.focus_neighbor_left = $%BackButton.get_path()
|
||||
$%BackButton.focus_neighbor_right = $%CreditsButton.get_path()
|
||||
|
||||
|
||||
func _load_current_settings() -> void:
|
||||
$%FullscreenCheckButton.button_pressed = SettingsManager.fullscreen
|
||||
$%WindowFactorOptionButton.selected = SettingsManager.window_factor
|
||||
_update_window_factor_disabled()
|
||||
$%FullscreenCheckButton.button_pressed = SettingsManager.fullscreen
|
||||
$%WindowFactorOptionButton.selected = SettingsManager.window_factor
|
||||
_update_window_factor_disabled()
|
||||
|
||||
|
||||
func _update_window_factor_disabled() -> void:
|
||||
$%WindowFactorOptionButton.disabled = SettingsManager.fullscreen
|
||||
$%WindowFactorOptionButton.disabled = SettingsManager.fullscreen
|
||||
|
||||
|
||||
func _on_fullscreen_check_button_toggled(toggled: bool) -> void:
|
||||
SettingsManager.fullscreen = toggled
|
||||
_update_window_factor_disabled()
|
||||
SettingsManager.fullscreen = toggled
|
||||
_update_window_factor_disabled()
|
||||
|
||||
|
||||
func _on_window_factor_option_button_item_selected(index: int) -> void:
|
||||
if not SettingsManager.fullscreen:
|
||||
SettingsManager.window_factor = index
|
||||
if not SettingsManager.fullscreen:
|
||||
SettingsManager.window_factor = index
|
||||
|
||||
|
||||
func _on_credits_button_pressed() -> void:
|
||||
show_credits.emit()
|
||||
show_credits.emit()
|
||||
|
||||
|
||||
func _on_back_button_pressed() -> void:
|
||||
show_main_menu.emit()
|
||||
show_main_menu.emit()
|
||||
|
||||
+7
-7
@@ -5,22 +5,22 @@ signal show_main_menu
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
_init_focus()
|
||||
_setup_neighbors()
|
||||
_init_focus()
|
||||
_setup_neighbors()
|
||||
|
||||
|
||||
func _init_focus() -> void:
|
||||
$%ContinueButton.grab_focus()
|
||||
$%ContinueButton.grab_focus()
|
||||
|
||||
|
||||
func _setup_neighbors() -> void:
|
||||
$%ContinueButton.focus_neighbor_top = $%MainMenuButton.get_path()
|
||||
$%MainMenuButton.focus_neighbor_bottom = $%ContinueButton.get_path()
|
||||
$%ContinueButton.focus_neighbor_top = $%MainMenuButton.get_path()
|
||||
$%MainMenuButton.focus_neighbor_bottom = $%ContinueButton.get_path()
|
||||
|
||||
|
||||
func _on_continue_button_pressed() -> void:
|
||||
continue_game.emit()
|
||||
continue_game.emit()
|
||||
|
||||
|
||||
func _on_main_menu_button_pressed() -> void:
|
||||
show_main_menu.emit()
|
||||
show_main_menu.emit()
|
||||
|
||||
Reference in New Issue
Block a user