var/static_lighting proper varedit support (#61164)

per title it creates/destroys the lighting objects now
This commit is contained in:
TiviPlus
2021-09-08 21:03:43 +01:00
committed by GitHub
parent 63130ed50c
commit 7dff58205c
2 changed files with 22 additions and 0 deletions
+6
View File
@@ -27,6 +27,12 @@
if("base_lighting_alpha")
set_base_lighting(new_alpha = var_value)
return TRUE
if("static_lighting")
if(!static_lighting)
create_area_lighting_objects()
else
remove_area_lighting_objects()
return ..()
/area/proc/update_base_lighting()
@@ -15,3 +15,19 @@ GLOBAL_DATUM_INIT(fullbright_overlay, /mutable_appearance, create_fullbright_ove
//Non static lighting areas.
//Any lighting area that wont support static lights.
//These areas will NOT have corners generated.
///regenerates lighting objects for turfs in this area, primary use is VV changes
/area/proc/create_area_lighting_objects()
for(var/turf/T in src)
if(T.always_lit)
continue
T.lighting_build_overlay()
CHECK_TICK
///Removes lighting objects from turfs in this area if we have them, primary use is VV changes
/area/proc/remove_area_lighting_objects()
for(var/turf/T in src)
if(T.always_lit)
continue
T.lighting_clear_overlay()
CHECK_TICK