From f1c23555878ee4b0e40c6af5f89f05b666012309 Mon Sep 17 00:00:00 2001 From: "George L. Albany" Date: Tue, 21 Feb 2023 16:30:12 -0500 Subject: Add Keychain plugin for Controls tab (#15) * Add modified Keychain plugin for future Controls tab See https://github.com/Orama-Interactive/Keychain/tree/4.x Added Events autoload singleton for global eventing namespace Added Events.Options for global options functionality * Add Controls tab via Keychain plugin Use Events.Options for save, load, and reset of settings Separate OptionMenu tabs into scene files Add locale saving and loading Refactor SettingNodes scripts for more generalized use Remove random prints Remove useless spinbox signal connection Make Resolution consistently use Vector2i * Implement Godot project overrides for resolution and window mode Overrides are necessary as Godot does not load resolution or window mode on startup, so an override is necessary to ensure this happens. Add null checks to SettingHSlider and SettingOptionButton * Fix incorrect resolution value in ResolutionSelector * Correct project settings override behavior in editor Godot normally tries to overwrite the project settings in the editor, a template feature tag must be used to prevent the editor from overwriting the project.godot settings. * Fix Orama-Interactive/Keychain#8 --- game/src/OptionMenu/ScreenModeSelector.gd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'game/src/OptionMenu/ScreenModeSelector.gd') diff --git a/game/src/OptionMenu/ScreenModeSelector.gd b/game/src/OptionMenu/ScreenModeSelector.gd index fae0771..92c5d60 100644 --- a/game/src/OptionMenu/ScreenModeSelector.gd +++ b/game/src/OptionMenu/ScreenModeSelector.gd @@ -24,9 +24,11 @@ func get_window_mode_from_screen_mode(screen_mode : int) -> Window.Mode: _: return Window.MODE_EXCLUSIVE_FULLSCREEN -func _on_item_selected(index : int): - print("Selected index: %d" % index) +func _setup_button(): + default_selected = get_screen_mode_from_window_mode(get_viewport().get_window().mode) + selected = default_selected +func _on_item_selected(index : int): var window := get_viewport().get_window() var current_resolution := Resolution.get_current_resolution() window.mode = get_window_mode_from_screen_mode(index) -- cgit v1.2.3-56-ga3b1