mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-26 09:03:37 +00:00
* Only blend areas when it's actually needed (#60237) * Only blend areas when it's actually needed * Respect varedits * Only blend areas when it's actually needed Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
33 lines
776 B
Plaintext
33 lines
776 B
Plaintext
/area
|
|
luminosity = TRUE
|
|
var/dynamic_lighting = DYNAMIC_LIGHTING_ENABLED
|
|
|
|
/area/proc/set_dynamic_lighting(new_dynamic_lighting = DYNAMIC_LIGHTING_ENABLED)
|
|
if (new_dynamic_lighting == dynamic_lighting)
|
|
return FALSE
|
|
|
|
dynamic_lighting = new_dynamic_lighting
|
|
|
|
if (IS_DYNAMIC_LIGHTING(src))
|
|
cut_overlay(/obj/effect/fullbright)
|
|
blend_mode = BLEND_DEFAULT
|
|
for (var/turf/T in src)
|
|
if (IS_DYNAMIC_LIGHTING(T))
|
|
T.lighting_build_overlay()
|
|
|
|
else
|
|
add_overlay(/obj/effect/fullbright)
|
|
blend_mode = BLEND_MULTIPLY
|
|
for (var/turf/T in src)
|
|
if (T.lighting_object)
|
|
T.lighting_clear_overlay()
|
|
|
|
return TRUE
|
|
|
|
/area/vv_edit_var(var_name, var_value)
|
|
switch(var_name)
|
|
if(NAMEOF(src, dynamic_lighting))
|
|
set_dynamic_lighting(var_value)
|
|
return TRUE
|
|
return ..()
|