Skip to content

Commit

Permalink
bugfix: polarized full tile windows are working now (ss220-space#5368)
Browse files Browse the repository at this point in the history
  • Loading branch information
bobby24gen authored Jul 8, 2024
1 parent 66ad83c commit 0e3f611
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/game/objects/effects/spawners/windowspawner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
name = "polarized reinforced window spawner"
icon_state = "ewindow_spawner"
window_to_spawn_regular = /obj/structure/window/reinforced/polarized
window_to_spawn_full = /obj/structure/window/full/reinforced/tinted // Not polarized one
//window_to_spawn_full = /obj/structure/window/full/reinforced/tinted // Not polarized one // Why?
window_to_spawn_full = /obj/structure/window/full/reinforced/polarized
/// Used to link electrochromic windows to buttons
var/id

Expand Down
22 changes: 22 additions & 0 deletions code/game/objects/structures/window.dm
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,10 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
if(window.id == id || !window.id)
INVOKE_ASYNC(window, TYPE_PROC_REF(/obj/structure/window/reinforced/polarized, toggle))

for(var/obj/structure/window/full/reinforced/polarized/window in range(src,range))
if(window.id == id || !window.id)
INVOKE_ASYNC(window, TYPE_PROC_REF(/obj/structure/window/full/reinforced/polarized, toggle))

for(var/obj/machinery/door/airlock/airlock in range(src,range))
if(airlock.id == id)
INVOKE_ASYNC(src, PROC_REF(async_update), airlock)
Expand Down Expand Up @@ -761,6 +765,24 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
base_icon_state = "tinted_window"
opacity = TRUE

/obj/structure/window/full/reinforced/polarized
name = "electrochromic window"
desc = "Adjusts its tint with voltage. Might take a few good hits to shatter it."
var/id
var/original_color
var/ispolzovano

/obj/structure/window/full/reinforced/polarized/proc/toggle()
if(!ispolzovano)
ispolzovano++
original_color = color
if(opacity)
animate(src, color="[original_color]", time=5)
set_opacity(FALSE)
else
animate(src, color="#222222", time=5)
set_opacity(TRUE)

/obj/structure/window/full/reinforced/ice
icon = 'icons/obj/smooth_structures/rice_window.dmi'
icon_state = "ice_window"
Expand Down

0 comments on commit 0e3f611

Please sign in to comment.