diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 458c5626bc..028773b33b 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -470,3 +470,38 @@ update_icon() //icon_state has to be set manually return + +/obj/structure/window/reinforced/polarized + name = "electrochromic window" + desc = "Adjusts its tint with voltage. Might take a few good hits to shatter it." + var/id + +/obj/structure/window/reinforced/polarized/proc/toggle() + if(opacity) + animate(src, color="#FFFFFF", time=5) + SetOpacity(0) + else + animate(src, color="#222222", time=5) + SetOpacity(1) + +/obj/machinery/button/windowtint + name = "window tint control" + icon = 'icons/obj/power.dmi' + icon_state = "light1" + desc = "A remote control switch for polarized windows." + var/range = 7 + +/obj/machinery/button/windowtint/attack_hand(mob/user as mob) + if(..()) + return 1 + + use_power(5) + + active = !active + icon_state = "light[active]" + + for(var/obj/structure/window/reinforced/polarized/W in range(src,range)) + if (W.id == src.id || !W.id) + spawn( 0 ) + W.toggle() + return \ No newline at end of file