From 634585ba22cc2095ab5f47acc4a785999cecbc11 Mon Sep 17 00:00:00 2001 From: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com> Date: Sun, 14 Apr 2024 12:01:11 -0400 Subject: [PATCH 01/11] emissives done :> --- .../game/machinery/computer/communications.dm | 6 +- .../newscaster/newscaster_machine.dm | 20 ++- code/game/machinery/requests_console.dm | 46 ++--- code/game/machinery/status_display.dm | 159 +++++++++++++----- icons/obj/terminals.dmi | Bin 12124 -> 16732 bytes 5 files changed, 160 insertions(+), 71 deletions(-) diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index ede58d6987c77..788a1aae57328 100755 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -76,6 +76,7 @@ /obj/machinery/computer/communications/ui_act(action, list/params) var/static/list/approved_states = list(STATE_BUYING_SHUTTLE, STATE_CHANGING_STATUS, STATE_MESSAGES) + var/static/list/state_status_pictures = list("blank", "shuttle") . = ..() if (.) @@ -286,7 +287,10 @@ var/picture = params["picture"] if (!(picture in GLOB.approved_status_pictures)) return - post_status("alert", picture) + if(picture in state_status_pictures) + post_status(picture) + else + post_status("alert", picture) playsound(src, "terminal_type", 50, FALSE) . = TRUE if ("toggleAuthentication") diff --git a/code/game/machinery/newscaster/newscaster_machine.dm b/code/game/machinery/newscaster/newscaster_machine.dm index b779bd9ba2d65..876317a1e2926 100644 --- a/code/game/machinery/newscaster/newscaster_machine.dm +++ b/code/game/machinery/newscaster/newscaster_machine.dm @@ -5,6 +5,7 @@ desc = "A standard Nanotrasen-licensed newsfeed handler for use in commercial space stations. All the news you absolutely have no use for, in one place!" icon = 'icons/obj/terminals.dmi' icon_state = "newscaster_off" + base_icon_state = "newscaster" verb_say = "beeps" verb_ask = "beeps" verb_exclaim = "beeps" @@ -70,7 +71,7 @@ active_request = null return ..() -/obj/machinery/newscaster/update_icon() +/obj/machinery/newscaster/update_appearance(updates=ALL) . = ..() if(machine_stat & (NOPOWER|BROKEN)) set_light(0) @@ -80,22 +81,27 @@ /obj/machinery/newscaster/update_overlays() . = ..() if(!(machine_stat & (NOPOWER|BROKEN))) - var/state = "newscaster_[GLOB.news_network.wanted_issue.active ? "wanted" : "normal"]" + var/state = "[base_icon_state]_[GLOB.news_network.wanted_issue.active ? "wanted" : "normal"]" . += mutable_appearance(icon, state) + . += emissive_appearance(icon, state, alpha = src.alpha) - if(GLOB.news_network.wanted_issue.active && alert) - . += mutable_appearance(icon, "newscaster_alert") + if(!GLOB.news_network.wanted_issue.active && alert) + . += mutable_appearance(icon, "[base_icon_state]_alert") + . += emissive_appearance(icon, "[base_icon_state]_alert", alpha = src.alpha) var/hp_percent = (obj_integrity * 100) / max_integrity switch(hp_percent) if(75 to 100) return if(50 to 75) - . += mutable_appearance(icon, "crack1") + . += "crack1" + . += emissive_blocker(icon, "crack1", alpha = src.alpha) if(25 to 50) - . += mutable_appearance(icon, "crack2") + . += "crack2" + . += emissive_blocker(icon, "crack2", alpha = src.alpha) else - . += mutable_appearance(icon, "crack3") + . += "crack3" + . += emissive_blocker(icon, "crack3", alpha = src.alpha) /obj/machinery/newscaster/ui_interact(mob/user, datum/tgui/ui) . = ..() diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index 630854a3998d2..d0d4c23f579c3 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -28,7 +28,7 @@ GLOBAL_LIST_EMPTY(req_console_ckey_departments) name = "requests console" desc = "A console intended to send requests to different departments on the station." icon = 'icons/obj/terminals.dmi' - icon_state = "req_comp0" + icon_state = "req_comp_off" layer = ABOVE_WINDOW_LAYER var/department = "Unknown" //The list of all departments on the station (Determined from this variable on each unit) Set this to the same thing if you want several consoles in one department var/list/messages = list() //List of all messages @@ -74,28 +74,32 @@ GLOBAL_LIST_EMPTY(req_console_ckey_departments) light_color = LIGHT_COLOR_GREEN light_power = 1.5 -/obj/machinery/requests_console/update_icon() - if(machine_stat & NOPOWER) - set_light(0) - else - set_light(1)//green light +/obj/machinery/requests_console/update_icon_state() if(open) - if(!hackState) - icon_state="req_comp_open" - else - icon_state="req_comp_rewired" - else if(machine_stat & NOPOWER) - if(icon_state != "req_comp_off") - icon_state = "req_comp_off" + icon_state = "[base_icon_state]_[hackState ? "rewired" : "open"]" + return ..() + icon_state = "[base_icon_state]_off" + return ..() + +/obj/machinery/requests_console/update_overlays() + . = ..() + + if(open || (machine_stat & NOPOWER)) + return + + var/screen_state + + if(emergency || (newmessagepriority == REQ_EXTREME_MESSAGE_PRIORITY)) + screen_state = "[base_icon_state]3" + else if(newmessagepriority == REQ_HIGH_MESSAGE_PRIORITY) + screen_state = "[base_icon_state]2" + else if(newmessagepriority == REQ_NORMAL_MESSAGE_PRIORITY) + screen_state = "[base_icon_state]1" else - if(emergency || (newmessagepriority == REQ_EXTREME_MESSAGE_PRIORITY)) - icon_state = "req_comp3" - else if(newmessagepriority == REQ_HIGH_MESSAGE_PRIORITY) - icon_state = "req_comp2" - else if(newmessagepriority == REQ_NORMAL_MESSAGE_PRIORITY) - icon_state = "req_comp1" - else - icon_state = "req_comp0" + screen_state = "[base_icon_state]0" + + . += mutable_appearance(icon, screen_state) + . += emissive_appearance(icon, screen_state, alpha = src.alpha) /obj/machinery/requests_console/Initialize(mapload) . = ..() diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index 65282321d467d..b9c070f36e03b 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -27,45 +27,105 @@ var/obj/effect/overlay/status_display_text/message1_overlay var/obj/effect/overlay/status_display_text/message2_overlay - -/// Immediately blank the display. -/obj/machinery/status_display/proc/remove_display() - cut_overlays() - vis_contents.Cut() - if(message1_overlay) - QDEL_NULL(message1_overlay) - if(message2_overlay) - QDEL_NULL(message2_overlay) + var/current_picture = "" + var/current_mode = SD_BLANK + var/message1 = "" + var/message2 = "" /// Immediately change the display to the given picture. /obj/machinery/status_display/proc/set_picture(state) - remove_display() - add_overlay(state) + if(state != current_picture) + current_picture = state + + update_appearance() /// Immediately change the display to the given two lines. -/obj/machinery/status_display/proc/update_display(line1, line2) +/obj/machinery/status_display/proc/set_messages(line1, line2) line1 = uppertext(line1) line2 = uppertext(line2) + if(line1 != message1) + message1 = line1 + + if(line2 != message2) + message2 = line2 + + update_appearance() + +/** + * Remove both message objs and null the fields. + * Don't call this in subclasses. + */ +/obj/machinery/status_display/proc/remove_messages() + if(message1_overlay) + QDEL_NULL(message1_overlay) + if(message2_overlay) + QDEL_NULL(message2_overlay) + +/** + * Create/update message overlay. + * They must be handled as real objects for the animation to run. + * Don't call this in subclasses. + * Arguments: + * * overlay - the current /obj/effect/overlay/status_display_text instance + * * line_y - The Y offset to render the text. + * * message - the new message text. + * Returns new /obj/effect/overlay/status_display_text or null if unchanged. + */ +/obj/machinery/status_display/proc/update_message(obj/effect/overlay/status_display_text/overlay, line_y, message) + if(overlay && message == overlay.message) + return null + + if(overlay) + qdel(overlay) + + return new/obj/effect/overlay/status_display_text(src, line_y, message) + +/obj/machinery/status_display/update_appearance(updates=ALL) + . = ..() if( \ - (message1_overlay && message1_overlay.message == line1) && \ - (message2_overlay && message2_overlay.message == line2) \ + (machine_stat & (NOPOWER|BROKEN)) || \ + (current_mode == SD_BLANK) || \ + (current_mode != SD_PICTURE && message1 == "" && message2 == "") \ ) + set_light(0) return + set_light(1.4, 0.7, LIGHT_COLOR_BLUE) // blue light - remove_display() +/obj/machinery/status_display/update_overlays() + . = ..() - message1_overlay = new(LINE1_Y, line1) - vis_contents += message1_overlay + if(machine_stat & (NOPOWER|BROKEN)) + remove_messages() + return - message2_overlay = new(LINE2_Y, line2) - vis_contents += message2_overlay + switch(current_mode) + if(SD_BLANK) + remove_messages() + // Turn off backlight. + return + if(SD_PICTURE) + remove_messages() + . += mutable_appearance(icon, current_picture) + else + var/overlay = update_message(message1_overlay, LINE1_Y, message1) + if(overlay) + message1_overlay = overlay + overlay = update_message(message2_overlay, LINE2_Y, message2) + if(overlay) + message2_overlay = overlay + + // Turn off backlight if message is blank + if(message1 == "" && message2 == "") + return + + . += emissive_appearance(icon, "outline", alpha = src.alpha) // Timed process - performs nothing in the base class /obj/machinery/status_display/process() if(machine_stat & NOPOWER) // No power, no processing. - remove_display() + update_appearance() return PROCESS_KILL @@ -82,6 +142,7 @@ . = ..() if(machine_stat & (NOPOWER|BROKEN) || . & EMP_PROTECT_SELF) return + current_mode = SD_PICTURE set_picture("ai_bsod") /obj/machinery/status_display/examine(mob/user) @@ -97,7 +158,7 @@ /obj/machinery/status_display/proc/display_shuttle_status(obj/docking_port/mobile/shuttle) if(!shuttle) // the shuttle is missing - no processing - update_display("shutl?","") + set_messages("shutl?","") return PROCESS_KILL else if(shuttle.timer) var/line1 = "-[shuttle.getModeStr()]-" @@ -105,10 +166,10 @@ if(length_char(line2) > CHARS_PER_LINE) line2 = "error" - update_display(line1, line2) + set_messages(line1, line2) else // don't kill processing, the timer might turn back on - remove_display() + set_messages("", "") /obj/machinery/status_display/proc/examine_shuttle(mob/user, obj/docking_port/mobile/shuttle) if (shuttle) @@ -129,11 +190,13 @@ icon = 'icons/obj/status_display.dmi' vis_flags = VIS_INHERIT_LAYER | VIS_INHERIT_PLANE | VIS_INHERIT_ID - var/message = "" + var/message + var/obj/sd_parent -/obj/effect/overlay/status_display_text/New(yoffset, line) +/obj/effect/overlay/status_display_text/New(obj/parent, yoffset, line) maptext_y = yoffset message = line + sd_parent = parent var/line_length = length_char(line) @@ -158,13 +221,19 @@ maptext = generate_text(line, center = TRUE) maptext_x = 0 + parent.vis_contents += src + +/obj/effect/overlay/status_display_text/Destroy() + sd_parent.vis_contents -= src + return ..() + /obj/effect/overlay/status_display_text/proc/generate_text(text, center) return {"
?_|6o(dyP1i3My=icAdlozVV_SaO!h!MwiaQ
zEbJD|qekg@(uj^tRD{OdTg@yjV_2YzWUbT=TRV|rGb25swI{$+F(SH20RcOzH{7Ci
z@*%~=Y0>c)+;}((A}Y2;lPgN_&~GDkw~8a>_5R3MX`4m=6mYzX;nvo6g=PA4C0y_s
zC&5ByhX#y2!I6r;#)pCJNm|kLF16% ^1pumbEtJ@E=N`{qbq8+xweXj>)>t05
z6&DpErp~4@CHm3faO=D!TKPOUwb+cye*>9@HQI_1cLNw=O}5`&tR1J!ridqg!V6f3
zFz>l4`|1;JUq+>My)Lfdol(pu$r;h@nQ^lOgcD%7r2mBKl`nqe$0MUpIBJT?N5KPs
zmFglL?f)J2crUD?{rc$Wc~fjkfvp5Eb@0ve*Nj`}nJaEzBK|>7OhwHO-OVo)YNqHw
zH&4&vIG>Uy2ChXzLxz5ci3~Ut-fY3W>~-f~VAKFAf&0DkI;b$Q4AI^ 1(sF1I
z=_rPCuBN$X^^uzbb~;I HDd{^CpY9Gmec&*@^y$KUn{-DG;pQI~Rjv;5=64P%OLzUP{7Rte
z-K|zR^Xz09Va(={)H3Jtf+Y9yjq2$6PZ?wL$U5nE(q!&j{^F|y+@#;jh9JuIkxveW
zJA5Xg?BNeA`JHP}37M>~{kh8eDEa5v!1xgmDtI?@g)n=ztTGs=5@R`d8)>TNa0nH>
zirm_?DZl>+U2sw0`oT;|m#?3)FI7fc`bQL0wLPzM`B*^o6c~aV4L(h<-)f!B4J9Y`
zZ=#4M^DP1A;`49tv^PtWIz<*wlXso ~Af8pcj|ZKMV2Dv!}RZ
zeAu}O4>h2MiBk?hPcW^52it`Ad>ZK6Q3rtMRdVO%_p-^66=>DHkwVp9cGz*ZwD4ODMq997UqK3o=OO5R~aYxzmiBdJJ
zw)?jo7G=;N }nfy+2B+O*6qayqhO(*n*EKciK=^-ZW`vi1H)afC^Vp@^L;
~C4s`W_zj
-
- act('stat_update', {
- position: 'lower',
- text: value,
- })
- }
- />
-
-
\tShuttle missing!"
+/obj/machinery/status_display/Destroy()
+ remove_messages()
+ return ..()
+
/**
* Nice overlay to make text smoothly scroll with no client updates after setup.
*/
@@ -191,28 +197,28 @@
vis_flags = VIS_INHERIT_LAYER | VIS_INHERIT_PLANE | VIS_INHERIT_ID
var/message
- var/obj/sd_parent
-/obj/effect/overlay/status_display_text/New(obj/parent, yoffset, line)
+/obj/effect/overlay/status_display_text/Initialize(mapload, yoffset, line)
+ . = ..()
+
maptext_y = yoffset
message = line
- sd_parent = parent
var/line_length = length_char(line)
if(line_length > CHARS_PER_LINE)
// Marquee text
var/marquee_message = "[line] • [line] • [line]"
- var/marqee_length = line_length * 3 + 6
+ var/marquee_length = line_length * 3 + 6
maptext = generate_text(marquee_message, center = FALSE)
- maptext_width = 6 * marqee_length
+ maptext_width = 6 * marquee_length
maptext_x = 32
// Mask off to fit in screen.
add_filter("mask", 1, alpha_mask_filter(icon = icon(icon, "outline")))
// Scroll.
- var/width = 4 * marqee_length
+ var/width = 4 * marquee_length
var/time = (width + 32) * SCROLL_RATE
animate(src, maptext_x = -width, time = time, loop = -1)
animate(maptext_x = 32, time = 0)
@@ -221,12 +227,6 @@
maptext = generate_text(line, center = TRUE)
maptext_x = 0
- parent.vis_contents += src
-
-/obj/effect/overlay/status_display_text/Destroy()
- sd_parent.vis_contents -= src
- return ..()
-
/obj/effect/overlay/status_display_text/proc/generate_text(text, center)
return {"
[line2]
\t[html_encode(message1_overlay.message)]"
+ . += "\t[html_encode(message1_overlay.message)]"
if (message2_overlay.message)
- . += "
\t[html_encode(message2_overlay.message)]"
+ . += "\t[html_encode(message2_overlay.message)]"
// Helper procs for child display types.
/obj/machinery/status_display/proc/display_shuttle_status(obj/docking_port/mobile/shuttle)
@@ -163,28 +174,14 @@
set_messages("shutl?","")
return PROCESS_KILL
else if(shuttle.timer)
- var/line1 = "-[shuttle.getModeStr()]-"
+ var/line1 = "- [shuttle.getModeStr()] -"
var/line2 = shuttle.getTimerStr()
- if(length_char(line2) > CHARS_PER_LINE)
- line2 = "error"
set_messages(line1, line2)
else
// don't kill processing, the timer might turn back on
set_messages("", "")
-/obj/machinery/status_display/proc/examine_shuttle(mob/user, obj/docking_port/mobile/shuttle)
- if (shuttle)
- var/modestr = shuttle.getModeStr()
- if (modestr)
- if (shuttle.timer)
- modestr = "
\t[modestr]: [shuttle.getTimerStr()]"
- else
- modestr = "
\t[modestr]"
- return "The display says:
\t[shuttle.name][modestr]"
- else
- return "The display says:
\tShuttle missing!"
-
/obj/machinery/status_display/Destroy()
remove_messages()
return ..()
@@ -196,39 +193,93 @@
icon = 'icons/obj/status_display.dmi'
vis_flags = VIS_INHERIT_LAYER | VIS_INHERIT_PLANE | VIS_INHERIT_ID
+ /// The message this overlay is displaying.
var/message
-/obj/effect/overlay/status_display_text/Initialize(mapload, yoffset, line)
+ // If the line is short enough to not marquee, and it matches this, it's a header.
+ var/static/regex/header_regex = regex("^-.*-$")
+
+ /// Width of each character, including kerning gap afterwards.
+ /// We don't use rich text or anything fancy, so we can bake these values.
+ var/static/list/char_widths = list(
+ // ! " # $ % & ' ( ) * + , - . /
+ 1, 2, 3, 5, 4, 5, 5, 2, 3, 3, 3, 4, 2, 3, 2, 3,
+ // 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 3, 3, 3, 3,
+ // @ A B C D E F G H I J K L M N O
+ 7, 5, 5, 5, 5, 4, 4, 5, 5, 2, 4, 5, 4, 6, 5, 5,
+ // P Q R S T U V W X Y Z [ \ ] ^ _
+ 5, 5, 5, 5, 4, 5, 4, 6, 4, 4, 4, 3, 3, 3, 4, 4,
+ // ` a b c d e f g h i j k l m n o
+ 3, 5, 5, 5, 5, 4, 4, 5, 5, 2, 4, 5, 4, 6, 5, 5,
+ // p q r s t u v w x y z { | } ~
+ 5, 5, 5, 5, 4, 5, 4, 6, 4, 4, 4, 3, 2, 3, 4,
+ )
+
+/obj/effect/overlay/status_display_text/Initialize(mapload, yoffset, line, text_color, header_text_color)
. = ..()
maptext_y = yoffset
message = line
- var/line_length = length_char(line)
+ var/line_width = measure_width(line)
- if(line_length > CHARS_PER_LINE)
+ if(line_width > MAX_STATIC_WIDTH)
// Marquee text
- var/marquee_message = "[line] • [line] • [line]"
- var/marquee_length = line_length * 3 + 6
- maptext = generate_text(marquee_message, center = FALSE)
- maptext_width = 6 * marquee_length
- maptext_x = 32
+ var/marquee_message = "[line] - [line] - [line]"
+
+ // Width of full content. Must of these is never revealed unless the user inputted a single character.
+ var/full_marquee_width = measure_width(marquee_message)
+ // We loop after only this much has passed.
+ var/looping_marquee_width = measure_width("[line] - ")
+
+ maptext = generate_text(marquee_message, center = FALSE, text_color = text_color)
+ maptext_width = full_marquee_width
+ maptext_x = 0
// Mask off to fit in screen.
add_filter("mask", 1, alpha_mask_filter(icon = icon(icon, "outline")))
// Scroll.
- var/width = 4 * marquee_length
- var/time = (width + 32) * SCROLL_RATE
- animate(src, maptext_x = -width, time = time, loop = -1)
- animate(maptext_x = 32, time = 0)
+ var/time = looping_marquee_width * SCROLL_RATE
+ animate(src, maptext_x = -looping_marquee_width, time = time, loop = -1)
+ animate(maptext_x = 0, time = 0)
else
// Centered text
- maptext = generate_text(line, center = TRUE)
+ var/color = header_regex.Find(line) ? header_text_color : text_color
+ maptext = generate_text(line, center = TRUE, text_color = color)
maptext_x = 0
-/obj/effect/overlay/status_display_text/proc/generate_text(text, center)
- return {"
\t[shuttleMsg]"
- else
- . += "The display is blank."
-
-
/// General-purpose shuttle status display.
/obj/machinery/status_display/shuttle
name = "shuttle display"
current_mode = SD_MESSAGE
var/shuttle_id
+ text_color = "#0F5"
+ header_text_color = "#2FC"
+
/obj/machinery/status_display/shuttle/process()
if(!shuttle_id || (machine_stat & NOPOWER))
// No power, no processing.
@@ -363,13 +395,6 @@
return display_shuttle_status(SSshuttle.getShuttle(shuttle_id))
-/obj/machinery/status_display/shuttle/examine(mob/user)
- . = ..()
- if(shuttle_id)
- . += examine_shuttle(user, SSshuttle.getShuttle(shuttle_id))
- else
- . += "The display is blank."
-
/obj/machinery/status_display/shuttle/vv_edit_var(var_name, var_value)
. = ..()
if(!.)
@@ -518,9 +543,7 @@
connected_display.receive_signal(status_signal)
-#undef CHARS_PER_LINE
-#undef FONT_SIZE
-#undef FONT_COLOR
+#undef MAX_STATIC_WIDTH
#undef FONT_STYLE
#undef SCROLL_RATE
#undef LINE1_Y
diff --git a/code/modules/events/prison_break.dm b/code/modules/events/prison_break.dm
index 3a0fbbdb1630f..404dfbc56741f 100644
--- a/code/modules/events/prison_break.dm
+++ b/code/modules/events/prison_break.dm
@@ -53,7 +53,6 @@
if(temp.critical_machine) //Skip doors in critical positions, such as the SM chamber.
continue
temp.prison_open()
- else if(istype(O, /obj/machinery/door_timer))
- var/obj/machinery/door_timer/temp = O
+ else if(istype(O, /obj/machinery/status_display/door_timer))
+ var/obj/machinery/status_display/door_timer/temp = O
temp.timer_end(forced = TRUE)
-
diff --git a/tools/UpdatePaths/Scripts/x_brigtimers.txt b/tools/UpdatePaths/Scripts/x_brigtimers.txt
new file mode 100644
index 0000000000000..f8edc45416346
--- /dev/null
+++ b/tools/UpdatePaths/Scripts/x_brigtimers.txt
@@ -0,0 +1 @@
+/obj/machinery/door_timer : /obj/machinery/status_display/door_timer{@OLD}
From 253ad2ae107bb8600856c89f61ca4c6f16422d42 Mon Sep 17 00:00:00 2001
From: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com>
Date: Sun, 14 Apr 2024 12:52:48 -0400
Subject: [PATCH 06/11] script
---
_maps/Prefab/Departments.dmm | 2 +-
_maps/map_files/BoxStation/BoxStation.dmm | 4 ++--
_maps/map_files/CorgStation/CorgStation.dmm | 6 +++---
_maps/map_files/Deltastation/DeltaStation2.dmm | 10 +++++-----
_maps/map_files/EchoStation/EchoStation.dmm | 2 +-
_maps/map_files/FlandStation/FlandStation.dmm | 6 +++---
_maps/map_files/KiloStation/KiloStation.dmm | 2 +-
_maps/map_files/MetaStation/MetaStation.dmm | 2 +-
_maps/map_files/RadStation/RadStation.dmm | 18 +++++++++---------
code/game/machinery/doors/brigdoors.dm | 2 +-
10 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/_maps/Prefab/Departments.dmm b/_maps/Prefab/Departments.dmm
index 5753cc34f25c1..1744efc1167e4 100644
--- a/_maps/Prefab/Departments.dmm
+++ b/_maps/Prefab/Departments.dmm
@@ -340,7 +340,7 @@
/turf/open/floor/plating,
/area/space)
"iP" = (
-/obj/machinery/door_timer,
+/obj/machinery/status_display/door_timer,
/turf/open/floor/iron,
/area/space)
"jm" = (
diff --git a/_maps/map_files/BoxStation/BoxStation.dmm b/_maps/map_files/BoxStation/BoxStation.dmm
index 61e05c1584277..6756883d429d5 100644
--- a/_maps/map_files/BoxStation/BoxStation.dmm
+++ b/_maps/map_files/BoxStation/BoxStation.dmm
@@ -45065,7 +45065,7 @@
/area/engine/engineering)
"oMf" = (
/obj/structure/toilet,
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "cell";
name = "Solitary confinement timer";
pixel_y = 32
@@ -57072,7 +57072,7 @@
/turf/open/floor/iron,
/area/quartermaster/qm)
"tUj" = (
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "cell";
name = "Solitary confinement timer";
pixel_y = 32
diff --git a/_maps/map_files/CorgStation/CorgStation.dmm b/_maps/map_files/CorgStation/CorgStation.dmm
index ea6161c73c61c..ef223a0ef1dfc 100644
--- a/_maps/map_files/CorgStation/CorgStation.dmm
+++ b/_maps/map_files/CorgStation/CorgStation.dmm
@@ -9744,7 +9744,7 @@
/obj/machinery/light/small{
dir = 1
},
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
pixel_y = 32
},
/obj/machinery/atmospherics/pipe/manifold/supply/hidden/layer2{
@@ -32106,7 +32106,7 @@
/obj/effect/turf_decal/tile/red/half/contrasted{
dir = 4
},
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "cell";
name = "Solitary confinement timer";
pixel_y = 32
@@ -72907,7 +72907,7 @@
/obj/effect/turf_decal/tile/red/half/contrasted{
dir = 4
},
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
pixel_y = 32
},
/obj/machinery/computer/arcade/orion_trail,
diff --git a/_maps/map_files/Deltastation/DeltaStation2.dmm b/_maps/map_files/Deltastation/DeltaStation2.dmm
index 7de1e97e0fac8..20828e1cee4f2 100644
--- a/_maps/map_files/Deltastation/DeltaStation2.dmm
+++ b/_maps/map_files/Deltastation/DeltaStation2.dmm
@@ -39980,7 +39980,7 @@
/obj/structure/cable/yellow{
icon_state = "0-4"
},
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "scicell";
name = "Science Cell";
pixel_x = -32;
@@ -41622,7 +41622,7 @@
/area/science/xenobiology)
"gzR" = (
/obj/structure/closet/secure_closet/security/engine,
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "engcell";
name = "Engineering Cell";
pixel_x = 32;
@@ -51247,7 +51247,7 @@
/obj/structure/cable/yellow{
icon_state = "0-4"
},
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "cargocell";
name = "Cargo Cell";
pixel_x = -32;
@@ -70382,7 +70382,7 @@
/turf/open/floor/iron,
/area/science/research)
"qnj" = (
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "cell";
name = "Solitary confinement timer";
pixel_y = 32
@@ -79510,7 +79510,7 @@
/obj/structure/table/reinforced,
/obj/item/restraints/handcuffs,
/obj/item/implant/radio,
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "medcell";
name = "Medical Cell";
pixel_y = -32
diff --git a/_maps/map_files/EchoStation/EchoStation.dmm b/_maps/map_files/EchoStation/EchoStation.dmm
index de3787324a6c0..79bc539b4158e 100644
--- a/_maps/map_files/EchoStation/EchoStation.dmm
+++ b/_maps/map_files/EchoStation/EchoStation.dmm
@@ -20760,7 +20760,7 @@
/obj/effect/turf_decal/stripes/line{
dir = 4
},
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "Cell 1";
name = "Cell 1";
pixel_y = 32
diff --git a/_maps/map_files/FlandStation/FlandStation.dmm b/_maps/map_files/FlandStation/FlandStation.dmm
index 8dbf4af27ce4d..27bbb6de8d958 100644
--- a/_maps/map_files/FlandStation/FlandStation.dmm
+++ b/_maps/map_files/FlandStation/FlandStation.dmm
@@ -1626,7 +1626,7 @@
/obj/effect/turf_decal/trimline/red/filled/line{
dir = 10
},
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "arrdoor";
name = "Arrival Cell";
pixel_y = -32
@@ -12873,7 +12873,7 @@
/obj/machinery/recharger{
pixel_x = -4
},
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "medcell";
name = "Medical Cell";
pixel_y = 32
@@ -87147,7 +87147,7 @@
/obj/effect/turf_decal/stripes/line{
dir = 10
},
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "cell";
name = "Medical Cell";
pixel_x = 32;
diff --git a/_maps/map_files/KiloStation/KiloStation.dmm b/_maps/map_files/KiloStation/KiloStation.dmm
index 6d9777691fd90..95d0a6b4a2675 100644
--- a/_maps/map_files/KiloStation/KiloStation.dmm
+++ b/_maps/map_files/KiloStation/KiloStation.dmm
@@ -82540,7 +82540,7 @@
/obj/effect/turf_decal/stripes/corner{
dir = 1
},
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "cell";
name = "Solitary confinement timer";
pixel_y = 32
diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm
index d1017c4555e51..3ab1ea118f162 100644
--- a/_maps/map_files/MetaStation/MetaStation.dmm
+++ b/_maps/map_files/MetaStation/MetaStation.dmm
@@ -31175,7 +31175,7 @@
/obj/machinery/light{
dir = 1
},
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "cell";
name = "Solitary confinement timer";
pixel_y = 32
diff --git a/_maps/map_files/RadStation/RadStation.dmm b/_maps/map_files/RadStation/RadStation.dmm
index 2c6cbec8a9542..5ed66c2f5e82c 100644
--- a/_maps/map_files/RadStation/RadStation.dmm
+++ b/_maps/map_files/RadStation/RadStation.dmm
@@ -6155,7 +6155,7 @@
/turf/open/floor/plating,
/area/maintenance/port/aft)
"caA" = (
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "cell";
name = "Solitary confinement timer";
pixel_x = 32
@@ -18864,7 +18864,7 @@
/obj/effect/turf_decal/guideline/guideline_half_edge/red{
dir = 5
},
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "cell";
name = "Solitary confinement timer";
pixel_x = 32
@@ -23204,7 +23204,7 @@
dir = 9;
network = list("ss13","prison")
},
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "cell";
name = "Solitary confinement timer";
pixel_x = 32
@@ -25616,7 +25616,7 @@
/turf/open/floor/iron/dark,
/area/hallway/primary/central)
"hRZ" = (
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "cell";
name = "Solitary confinement timer";
pixel_x = -32
@@ -40844,7 +40844,7 @@
dir = 8
},
/obj/machinery/light/small,
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "cell";
name = "Solitary confinement timer";
pixel_y = 32
@@ -48339,7 +48339,7 @@
/area/security/brig/dock)
"pbr" = (
/obj/effect/turf_decal/tile/red/fourcorners/contrasted,
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "cell";
name = "Solitary confinement timer";
pixel_y = -32
@@ -52405,7 +52405,7 @@
/turf/open/floor/iron/dark,
/area/security/checkpoint/engineering)
"qpo" = (
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "cell";
name = "Solitary confinement timer";
pixel_y = 32
@@ -56254,7 +56254,7 @@
icon_state = "4-8"
},
/obj/effect/turf_decal/tile/red/fourcorners/contrasted,
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "cell";
name = "Solitary confinement timer";
pixel_y = -32
@@ -67753,7 +67753,7 @@
/turf/open/floor/engine/air,
/area/engine/atmos)
"vgF" = (
-/obj/machinery/door_timer{
+/obj/machinery/status_display/door_timer{
id = "cell";
name = "Solitary confinement timer";
pixel_y = 32
diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm
index dcb1c86a34478..4027dfbb4cf4e 100644
--- a/code/game/machinery/doors/brigdoors.dm
+++ b/code/game/machinery/doors/brigdoors.dm
@@ -181,7 +181,7 @@
timer_duration = new_time
update_content()
-/obj/machinery/door_timer/ui_requires_update(mob/user, datum/tgui/ui)
+/obj/machinery/status_display/door_timer/ui_requires_update(mob/user, datum/tgui/ui)
. = ..()
if(timing)
. = TRUE // Autoupdate while timer is counting down
From 45ee75ff3d7432ee2189387d47b4eeafb10cfcaa Mon Sep 17 00:00:00 2001
From: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com>
Date: Sun, 14 Apr 2024 14:06:22 -0400
Subject: [PATCH 07/11] fix bad timer update
---
code/game/machinery/doors/brigdoors.dm | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm
index 4027dfbb4cf4e..54e53ac14a274 100644
--- a/code/game/machinery/doors/brigdoors.dm
+++ b/code/game/machinery/doors/brigdoors.dm
@@ -49,7 +49,6 @@
if(!length(doors) && !length(flashers) && length(closets))
obj_break()
-
//Main door timer loop, if it's timing and time is >0 reduce time by 1.
// if it's less than 0, open door, reset timer
// update the door_timer window and the icon
@@ -64,7 +63,7 @@
if(REALTIMEOFDAY - activation_time >= timer_duration)
timer_end() // open doors, reset timer, clear status screen
- update_icon()
+ update_content()
/**
* Update the display content.
@@ -111,10 +110,9 @@
if(closet.opened && !closet.close())
continue
closet.locked = TRUE
- closet.update_icon()
+ closet.update_appearance()
return 1
-
/**
* Stops the timer and resets the timer to 0, and opens the linked door.
* Arguments:
@@ -137,7 +135,7 @@
for(var/datum/weakref/door_ref as anything in doors)
var/obj/machinery/door/window/brigdoor/door = door_ref.resolve()
if(!door)
- doors -= door_ref
+ doors -= door_ref
continue
if(!door.density)
continue
@@ -153,7 +151,7 @@
if(closet.opened)
continue
closet.locked = FALSE
- closet.update_icon()
+ closet.update_appearance()
return 1
@@ -189,7 +187,7 @@
/obj/machinery/status_display/door_timer/ui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
- ui = new(user, src, "BrigTimer")
+ ui = new(user, src, "BrigTimer", name)
ui.open()
/obj/machinery/status_display/door_timer/ui_data()
@@ -210,7 +208,8 @@
return data
/obj/machinery/status_display/door_timer/ui_act(action, params)
- if(..())
+ . = ..()
+ if(.)
return
. = TRUE
From 21968df2845ff894db34a4f798eb498446f79104 Mon Sep 17 00:00:00 2001
From: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com>
Date: Sun, 14 Apr 2024 14:55:17 -0400
Subject: [PATCH 08/11] oops, I fackin broke req consoles
---
code/game/machinery/requests_console.dm | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm
index d0d4c23f579c3..26558957db448 100644
--- a/code/game/machinery/requests_console.dm
+++ b/code/game/machinery/requests_console.dm
@@ -29,6 +29,7 @@ GLOBAL_LIST_EMPTY(req_console_ckey_departments)
desc = "A console intended to send requests to different departments on the station."
icon = 'icons/obj/terminals.dmi'
icon_state = "req_comp_off"
+ base_icon_state = "req_comp"
layer = ABOVE_WINDOW_LAYER
var/department = "Unknown" //The list of all departments on the station (Determined from this variable on each unit) Set this to the same thing if you want several consoles in one department
var/list/messages = list() //List of all messages
@@ -71,8 +72,12 @@ GLOBAL_LIST_EMPTY(req_console_ckey_departments)
max_integrity = 300
armor = list(MELEE = 70, BULLET = 30, LASER = 30, ENERGY = 30, BOMB = 0, BIO = 0, RAD = 0, FIRE = 90, ACID = 90, STAMINA = 0)
- light_color = LIGHT_COLOR_GREEN
- light_power = 1.5
+/obj/machinery/requests_console/update_appearance(updates=ALL)
+ . = ..()
+ if(machine_stat & NOPOWER)
+ set_light(0)
+ return
+ set_light(1.4,0.7,"#34D352")//green light
/obj/machinery/requests_console/update_icon_state()
if(open)
From 20d1f297e81b247276059bc4dec1825f4f276323 Mon Sep 17 00:00:00 2001
From: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com>
Date: Sun, 14 Apr 2024 15:17:15 -0400
Subject: [PATCH 09/11] prettier
---
.../common/StatusDisplayControls.tsx | 63 +++----------------
1 file changed, 10 insertions(+), 53 deletions(-)
diff --git a/tgui/packages/tgui/interfaces/common/StatusDisplayControls.tsx b/tgui/packages/tgui/interfaces/common/StatusDisplayControls.tsx
index f5d5cad689b1c..e3ff6ffcb6c3b 100644
--- a/tgui/packages/tgui/interfaces/common/StatusDisplayControls.tsx
+++ b/tgui/packages/tgui/interfaces/common/StatusDisplayControls.tsx
@@ -9,32 +9,15 @@ type Data = {
export const StatusDisplayControls = (props, context) => {
const { act, data } = useBackend(context);
- const {
- upperText: initialUpper,
- lowerText: initialLower,
- maxStatusLineLength,
- } = data;
+ const { upperText: initialUpper, lowerText: initialLower, maxStatusLineLength } = data;
- const [upperText, setUpperText] = useSharedState(
- context,
- 'statusUpperText',
- initialUpper
- );
- const [lowerText, setLowerText] = useSharedState(
- context,
- 'statusLowerText',
- initialLower
- );
+ const [upperText, setUpperText] = useSharedState(context, 'statusUpperText', initialUpper);
+ const [lowerText, setLowerText] = useSharedState(context, 'statusLowerText', initialLower);
return (
<>