aboutsummaryrefslogtreecommitdiff
path: root/game/src/OptionMenu/OptionsMenu.gd
diff options
context:
space:
mode:
author George L. Albany <Megacake1234@gmail.com>2023-03-12 06:26:55 +0100
committer GitHub <noreply@github.com>2023-03-12 06:26:55 +0100
commit56aec8a72b96a7d9ae8fa7974cf1eb7560ab4c02 (patch)
treefba91cccf66ddd07e518cb4fb9cb0ab89fed9fb4 /game/src/OptionMenu/OptionsMenu.gd
parentdfd6d33a9bd1fda56589efa66a9ca0f63f5e46f8 (diff)
parent3573d59ef42c935dc27bb6a4ae9bb3c4ba041c08 (diff)
Merge pull request #54 from BrickPi/settings-menu-upgrade
Diffstat (limited to 'game/src/OptionMenu/OptionsMenu.gd')
-rw-r--r--game/src/OptionMenu/OptionsMenu.gd9
1 files changed, 4 insertions, 5 deletions
diff --git a/game/src/OptionMenu/OptionsMenu.gd b/game/src/OptionMenu/OptionsMenu.gd
index e7ad7f6..d5f128c 100644
--- a/game/src/OptionMenu/OptionsMenu.gd
+++ b/game/src/OptionMenu/OptionsMenu.gd
@@ -31,7 +31,6 @@ func _ready():
back_button.text = "X"
back_button.pressed.connect(_on_back_button_pressed)
button_list.add_child(back_button)
-
get_viewport().get_window().close_requested.connect(_on_window_close_requested)
_save_overrides.call_deferred()
Events.Options.save_settings.connect(func(_f): self._save_overrides.call_deferred())
@@ -41,10 +40,10 @@ func _notification(what):
NOTIFICATION_CRASH:
_on_window_close_requested()
-# Could pass the LocaleButton between the MainMenu and OptionsMenu
-# but that seems a bit excessive
-func toggle_locale_button_visibility(locale_visible : bool):
- $LocaleVBox/LocaleHBox/LocaleButton.visible = locale_visible
+func _input(event):
+ if self.is_visible_in_tree():
+ if event.is_action_pressed("ui_cancel"):
+ _on_back_button_pressed()
func _on_back_button_pressed():
Events.Options.save_settings_to_file()