diff options
author | metamuffin <metamuffin@disroot.org> | 2024-09-07 11:43:49 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-09-07 11:43:49 +0200 |
commit | 7144115b819c843e568be449c07c43a5172a5d86 (patch) | |
tree | a1a2d90c95eb652386dba7daa951670b19e2fbca /client | |
parent | fff9e4419cfc23c43de187455f193f156b3ab0ab (diff) | |
download | hurrycurry-7144115b819c843e568be449c07c43a5172a5d86.tar hurrycurry-7144115b819c843e568be449c07c43a5172a5d86.tar.bz2 hurrycurry-7144115b819c843e568be449c07c43a5172a5d86.tar.zst |
apply settings after startup
Diffstat (limited to 'client')
-rw-r--r-- | client/global.gd | 3 | ||||
-rw-r--r-- | client/settings.gd | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/client/global.gd b/client/global.gd index 47d9da06..7629b05d 100644 --- a/client/global.gd +++ b/client/global.gd @@ -55,7 +55,6 @@ var focused_node: Control func _ready(): profile = load_dict("user://profile", default_profile) - settings_tree = Settings.get_root() load_settings("user://settings") get_viewport().gui_focus_changed.connect(Sound.play_hover_maybe) @@ -120,7 +119,9 @@ func load_settings(path: String): else: print("No settings file found.") settings = {} + settings_tree = Settings.get_root() settings_tree.check() + Settings.apply_initial() save_settings() func on_mobile() -> bool: diff --git a/client/settings.gd b/client/settings.gd index bfa25a00..828ecb62 100644 --- a/client/settings.gd +++ b/client/settings.gd @@ -86,6 +86,10 @@ static var change_hooks_apply = { "audio.sfx_volume": h_volume_sfx, } +static func apply_initial(): + for key in change_hooks_apply.keys(): + change_hooks_apply[key].call(Global.get_setting(key)) + static func h_aa(mode): match mode: "disabled": |