diff options
Diffstat (limited to 'client/map/map.gd')
-rw-r--r-- | client/map/map.gd | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/client/map/map.gd b/client/map/map.gd index 208665bf..fc3bd1bb 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", 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 not Global.get_setting("graphics.gi") == 2: return print("Map: Rebaking VoxelGI") currently_baked = true gi_bake_blocking() |