diff options
author | metamuffin <metamuffin@disroot.org> | 2025-09-25 14:55:35 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-09-25 14:55:35 +0200 |
commit | f16af07019030912902f262a683b33954dbab9e4 (patch) | |
tree | 432cfd25d3f6d69f7a8e32f52fa2e109bda68edb /client/system | |
parent | f50f7dee84c93380bb9c6ca1b0dc209181293092 (diff) | |
download | hurrycurry-f16af07019030912902f262a683b33954dbab9e4.tar hurrycurry-f16af07019030912902f262a683b33954dbab9e4.tar.bz2 hurrycurry-f16af07019030912902f262a683b33954dbab9e4.tar.zst |
Refactor InputManager (close #408)
Diffstat (limited to 'client/system')
-rw-r--r-- | client/system/settings.gd | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/client/system/settings.gd b/client/system/settings.gd index 97546c68..e1ef5c0d 100644 --- a/client/system/settings.gd +++ b/client/system/settings.gd @@ -127,7 +127,7 @@ static func save(): static func trigger_hook(key: String, value): for slot in change_hooks.get(key, {}): change_hooks[key][slot].callv([value] if value != null else []) - if key.find(".") != -1: trigger_hook(key.rsplit(".", false, 1)[0], null) + if key.find(".") != -1: trigger_hook(key.rsplit(".", false, 1)[0], key.rsplit(".", false, 1)[1]) static func hook_changed(key: String, slot: String, callable: Callable): if not change_hooks.has(key): change_hooks[key] = {} @@ -188,6 +188,9 @@ static func h_language(language: String): if language == "system": language = OS.get_locale_language() TranslationServer.set_locale(language) +static func h_input(key: String): + InputManager.update_input_map(key) + static func h_fullscreen(mode: String): match mode: "keep": pass @@ -195,9 +198,6 @@ 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(): - InputManager.apply_input_map(Settings.get_category_dict("input")) - static func h_hints_started(started: bool): if not started: for k in Profile.values["hints"].keys(): |