aboutsummaryrefslogtreecommitdiff
path: root/client/map/map.gd
diff options
context:
space:
mode:
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()