diff options
Diffstat (limited to 'client/settings.gd')
-rw-r--r-- | client/settings.gd | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/client/settings.gd b/client/settings.gd index 5501f1ab..341db7cc 100644 --- a/client/settings.gd +++ b/client/settings.gd @@ -66,6 +66,11 @@ static func get_root(): ]) ]) +static func trigger_hook(key: String, value): + if Settings.change_hooks_display.get(key) != null: Settings.change_hooks_display.get(key).call(value) + if Settings.change_hooks_apply.get(key) != null: Settings.change_hooks_apply.get(key).call(value) + if key.find(".") != -1: trigger_hook(key.rsplit(".", false, 1)[0], null) + static func hook_changed(key: String, display: bool, callable: Callable): if display: change_hooks_display[key] = callable else: change_hooks_apply[key] = callable @@ -76,6 +81,7 @@ static func hook_changed_init(key: String, display: bool, callable: Callable): static var change_hooks_display = {} static var change_hooks_apply = { + "input": h_input, "graphics.aa": h_aa, "graphics.taa": h_taa, "graphics.fullscreen": h_fullscreen, @@ -142,10 +148,11 @@ static func h_fullscreen(mode: String): "never": if DisplayServer.window_get_mode() == DisplayServer.WINDOW_MODE_FULLSCREEN: DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED) +static func h_input(_x): + pass + # InputManager.apply_input_map(InputManager.settings_dictionary_to_input_map()) + # TODO whatever this does # if not get_setting("tutorial_started"): # for k in profile["hints"].keys(): # set_hint(k, false) - -# TODO update input map for *all* input with a single hook -# InputManager.apply_input_map(InputManager.settings_dictionary_to_input_map(get_category_settings("input"))) |