forked from yogstation13/Yogstation
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
window dep. color + chromatic windows port (#40)
- Loading branch information
Showing
6 changed files
with
165 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#define COLOR_CARGO_GLASS "#bd6f26" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
modular_dripstation/code/game/machinery/doors/window_door.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/obj/machinery/door/window | ||
var/cancolor = TRUE | ||
|
||
/obj/machinery/door/window/Initialize(mapload, set_dir, unres_sides) | ||
. = ..() | ||
if(!color && cancolor) | ||
color = color_windows(src) | ||
|
||
/obj/machinery/door/window/clockwork | ||
cancolor = FALSE | ||
|
||
|
82 changes: 82 additions & 0 deletions
82
modular_dripstation/code/game/objects/structures/window.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
GLOBAL_LIST_INIT(wcBrig, COLOR_SECURITY_RED) | ||
// GLOBAL_LIST_INIT(wcSci, COLOR_SCIENCE_PINK) | ||
// GLOBAL_LIST_INIT(wcMed, COLOR_MEDICAL_BLUE) | ||
GLOBAL_LIST_INIT(wcEng, COLOR_ENGINEERING_ORANGE) | ||
GLOBAL_LIST_INIT(wcCar, COLOR_CARGO_GLASS) | ||
// GLOBAL_LIST_INIT(wcCom, COLOR_COMMAND_BLUE) | ||
|
||
/obj/proc/color_windows(obj/W) | ||
var/list/wcBrigAreas = list(/area/security, /area/crew_quarters/heads/hos, /area/ai_monitored/security/armory) | ||
// var/list/wcSciAreas = list(/area/science, /area/crew_quarters/heads/hor) | ||
// var/list/wcMedAreas = list(/area/medical, /area/crew_quarters/heads/cmo) | ||
var/list/wcEngAreas = list(/area/engine, /area/crew_quarters/heads/chief) | ||
var/list/wcCarAreas = list(/area/quartermaster) | ||
// var/list/wcComAreas = list(/area/bridge, /area/crew_quarters/heads/hop, /area/crew_quarters/heads/captain, /area/teleporter) | ||
|
||
|
||
var/newcolor | ||
var/turf/T = get_turf(W) | ||
if(!istype(T)) | ||
return | ||
var/area/A = T.loc | ||
|
||
if(is_type_in_list(A,wcBrigAreas)) | ||
newcolor = GLOB.wcBrig | ||
// else if(is_type_in_list(A,wcSciAreas)) | ||
// newcolor = GLOB.wcSci | ||
// else if(is_type_in_list(A,wcMedAreas)) | ||
// newcolor = GLOB.wcMed | ||
else if(is_type_in_list(A,wcEngAreas)) | ||
newcolor = GLOB.wcEng | ||
else if(is_type_in_list(A,wcCarAreas)) | ||
newcolor = GLOB.wcCar | ||
// else if(is_type_in_list(A,wcComAreas)) | ||
// newcolor = GLOB.wcCom | ||
else | ||
newcolor = null | ||
|
||
return newcolor | ||
|
||
/obj/structure/window/Initialize(mapload, direct) | ||
. = ..() | ||
if(!color && cancolor) | ||
color = color_windows(src) | ||
|
||
/obj/structure/window | ||
var/cancolor = FALSE | ||
|
||
/obj/structure/window/reinforced | ||
cancolor = TRUE | ||
|
||
/obj/structure/window/reinforced/bronze | ||
cancolor = FALSE | ||
|
||
/obj/structure/window/reinforced/tinted | ||
cancolor = FALSE | ||
|
||
/obj/structure/window/fulltile | ||
cancolor = TRUE | ||
|
||
/obj/structure/window/reinforced/clockwork | ||
cancolor = FALSE | ||
|
||
/obj/structure/window/paperframe | ||
cancolor = FALSE | ||
|
||
/obj/structure/window/reinforced/fulltile/polarized | ||
name = "electrochromic window" | ||
desc = "Adjusts its tint with voltage. Might take a few good hits to shatter it." | ||
var/tint_id | ||
var/original_color | ||
var/isused | ||
|
||
/obj/structure/window/reinforced/fulltile/polarized/proc/toggle() | ||
if(!isused) | ||
isused++ | ||
original_color = color | ||
if(opacity) | ||
animate(src, color="[original_color]", time=5) | ||
set_opacity(0) | ||
else | ||
animate(src, color="#222222", time=5) | ||
set_opacity(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters