windows remember their old colours

This commit is contained in:
S34NW
2021-08-30 15:56:04 +01:00
parent 267e3d2967
commit a6a79dca1e
+6 -1
View File
@@ -27,6 +27,8 @@
var/real_explosion_block //ignore this, just use explosion_block
var/breaksound = "shatter"
var/hitsound = 'sound/effects/Glasshit.ogg'
/// Used to restore colours from polarised glass
var/old_color
/obj/structure/window/examine(mob/user)
. = ..()
@@ -71,9 +73,12 @@
/obj/structure/window/proc/toggle_polarization()
if(opacity)
animate(src, color = "#FFFFFF", time = 0.5 SECONDS)
if(!old_color)
old_color = "#FFFFFF"
animate(src, color = old_color, time = 0.5 SECONDS)
set_opacity(FALSE)
else
old_color = color
animate(src, color = "#222222", time = 0.5 SECONDS)
set_opacity(TRUE)