aboutsummaryrefslogtreecommitdiff
path: root/client/map/map.gd
diff options
context:
space:
mode:
authormetamuffin <metamuffin@noreply.codeberg.org>2024-09-07 13:37:23 +0000
committermetamuffin <metamuffin@noreply.codeberg.org>2024-09-07 13:37:23 +0000
commit091f8ff9acf04cedf14765e9db5540c876fd7375 (patch)
tree4c115d6cb14df5d68bc72785f1020ed4ad2fb8e2 /client/map/map.gd
parentaf108805c8fd87a9d20a8df02072f224d2cd3417 (diff)
parent3ef379fb07df126ea09cb112801a0bef371f8811 (diff)
downloadhurrycurry-091f8ff9acf04cedf14765e9db5540c876fd7375.tar
hurrycurry-091f8ff9acf04cedf14765e9db5540c876fd7375.tar.bz2
hurrycurry-091f8ff9acf04cedf14765e9db5540c876fd7375.tar.zst
Merge pull request 'Refactor settings system and localization' (#123) from new-settings into master
Reviewed-on: https://codeberg.org/hurrycurry/hurrycurry/pulls/123
Diffstat (limited to 'client/map/map.gd')
-rw-r--r--client/map/map.gd19
1 files changed, 10 insertions, 9 deletions
diff --git a/client/map/map.gd b/client/map/map.gd
index 208665bf..ce3c6dfa 100644
--- a/client/map/map.gd
+++ b/client/map/map.gd
@@ -52,17 +52,18 @@ func clear_tile(pos: Vector2i):
func _ready():
voxelgi_timer.connect("timeout", gi_bake)
- Global.settings_changed.connect(func():
- # is not baked yet but setting is true
- if Global.get_setting("gi") == 2 and not currently_baked:
- gi_bake()
- else:
- currently_baked = false
- voxelgi.data = null
- )
+ Settings.hook_changed("graphics.gi", false, apply_gi_setting)
+
+func apply_gi_setting(state):
+ if state == "voxelgi" and not currently_baked:
+ gi_bake()
+ else:
+ currently_baked = false
+ voxelgi.data = null
+
func gi_bake():
- if not Global.get_setting("gi") == 2: return
+ if Global.get_setting("graphics.gi") != "voxelgi": return
print("Map: Rebaking VoxelGI")
currently_baked = true
gi_bake_blocking()