Refactors status displays (#18811)

* Refactors status displays

* biggest commit
This commit is contained in:
AffectedArc07
2022-08-29 16:45:29 +01:00
committed by GitHub
parent 5d3310cdef
commit 629c099db7
22 changed files with 294 additions and 352 deletions
+21
View File
@@ -105,3 +105,24 @@
#define LOGIN_TYPE_AI 2
#define LOGIN_TYPE_ROBOT 3
#define LOGIN_TYPE_ADMIN 4
// Status display maptext stuff
#define DISPLAY_CHARS_PER_LINE 5
#define DISPLAY_FONT_SIZE "5pt"
#define DISPLAY_FONT_COLOR "#09f"
#define DISPLAY_WARNING_FONT_COLOR "#f90"
#define DISPLAY_FONT_STYLE "Small Fonts"
#define DISPLAY_SCROLL_SPEED 2
// Status display mode types
#define STATUS_DISPLAY_BLANK 0
#define STATUS_DISPLAY_TRANSFER_SHUTTLE_TIME 1
#define STATUS_DISPLAY_MESSAGE 2
#define STATUS_DISPLAY_ALERT 3
#define STATUS_DISPLAY_TIME 4
#define STATUS_DISPLAY_CUSTOM 5
// AI display mode types
#define AI_DISPLAY_MODE_BLANK 0
#define AI_DISPLAY_MODE_EMOTE 1
#define AI_DISPLAY_MODE_BSOD 2
-1
View File
@@ -1,5 +1,4 @@
#define DISPLAY_FREQ 1435 //status displays
#define ATMOS_FIRE_FREQ 1437 //air alarms
#define ENGINE_FREQ 1438 //engine components
#define ATMOS_VENTSCRUB 1439 //vents, scrubbers, atmos control
@@ -67,7 +67,6 @@
/datum/weather/rad_storm/proc/status_alarm(active) //Makes the status displays show the radiation warning for those who missed the announcement.
if(active)
post_status("alert", "radiation")
post_status(STATUS_DISPLAY_ALERT, "radiation")
else
post_status("blank")
post_status("shuttle")
post_status(STATUS_DISPLAY_TRANSFER_SHUTTLE_TIME)
+112
View File
@@ -0,0 +1,112 @@
GLOBAL_LIST_EMPTY(ai_displays)
/obj/machinery/ai_status_display
icon = 'icons/obj/status_display.dmi'
icon_state = "frame"
name = "AI display"
anchored = TRUE
density = FALSE
var/spookymode = FALSE
/// Current mode
var/mode = AI_DISPLAY_MODE_BLANK
/// Target icon state
var/picture_state
/// Current emotion, used to calculate an icon state
var/emotion = "Neutral"
/obj/machinery/ai_status_display/Initialize(mapload)
. = ..()
GLOB.ai_displays |= src
/obj/machinery/ai_status_display/Destroy()
GLOB.ai_displays -= src
return ..()
/obj/machinery/ai_status_display/attack_ai(mob/living/silicon/ai/user)
if(isAI(user))
user.ai_statuschange()
/obj/machinery/ai_status_display/emp_act(severity)
if(stat & (BROKEN|NOPOWER))
..(severity)
return
mode = AI_DISPLAY_MODE_BSOD
update_icon()
..(severity)
/obj/machinery/ai_status_display/power_change()
..()
if(stat & NOPOWER)
set_light(0)
else
set_light(1, LIGHTING_MINIMUM_POWER)
/obj/machinery/ai_status_display/flicker()
if(stat & (NOPOWER | BROKEN))
return FALSE
spookymode = TRUE
update_icon()
return TRUE
/obj/machinery/ai_status_display/update_overlays()
. = ..()
var/new_display
underlays.Cut()
if(stat & NOPOWER)
return
switch(mode)
// Blank
if(AI_DISPLAY_MODE_BLANK)
new_display = "ai_off"
// AI emoticon
if(AI_DISPLAY_MODE_EMOTE)
switch(emotion)
if("Very Happy")
new_display = "ai_veryhappy"
if("Happy")
new_display = "ai_happy"
if("Neutral")
new_display = "ai_neutral"
if("Unsure")
new_display = "ai_unsure"
if("Confused")
new_display = "ai_confused"
if("Sad")
new_display = "ai_sad"
if("Surprised")
new_display = "ai_surprised"
if("Upset")
new_display = "ai_upset"
if("Angry")
new_display = "ai_angry"
if("BSOD")
new_display = "ai_bsod"
if("Blank")
new_display = "ai_off"
if("Problems?")
new_display = "ai_trollface"
if("Awesome")
new_display = "ai_awesome"
if("Dorfy")
new_display = "ai_urist"
if("Facepalm")
new_display = "ai_facepalm"
if("Friend Computer")
new_display = "ai_friend"
// BSOD
if(AI_DISPLAY_MODE_BSOD)
new_display = "ai_bsod"
. += new_display
underlays += emissive_appearance(icon, "lightmask")
+14 -35
View File
@@ -33,7 +33,7 @@
var/stat_msg1
var/stat_msg2
var/display_type = "blank"
var/display_type = STATUS_DISPLAY_TIME
var/display_icon
var/datum/announcement/priority/crew_announcement = new
@@ -155,7 +155,7 @@
return
call_shuttle_proc(usr, input)
if(SSshuttle.emergency.timer)
post_status("shuttle")
post_status(STATUS_DISPLAY_TRANSFER_SHUTTLE_TIME)
setMenuState(usr, COMM_SCREEN_MAIN)
if("cancelshuttle")
@@ -166,7 +166,7 @@
if(response == "Yes")
cancel_call_proc(usr)
if(SSshuttle.emergency.timer)
post_status("shuttle")
post_status(STATUS_DISPLAY_TRANSFER_SHUTTLE_TIME)
setMenuState(usr, COMM_SCREEN_MAIN)
if("messagelist")
@@ -198,17 +198,17 @@
// Status display stuff
if("setstat")
display_type = params["statdisp"]
display_type = text2num(params["statdisp"])
switch(display_type)
if("message")
if(STATUS_DISPLAY_MESSAGE)
display_icon = null
post_status("message", stat_msg1, stat_msg2, usr)
if("alert")
post_status(STATUS_DISPLAY_MESSAGE, stat_msg1, stat_msg2)
if(STATUS_DISPLAY_ALERT)
display_icon = params["alert"]
post_status("alert", params["alert"], user = usr)
post_status(STATUS_DISPLAY_ALERT, params["alert"])
else
display_icon = null
post_status(params["statdisp"], user = usr)
post_status(display_type)
setMenuState(usr, COMM_SCREEN_STAT)
if("setmsg1")
@@ -337,9 +337,9 @@
"line_2" = (stat_msg2 ? stat_msg2 : "-----"),
"presets" = list(
list("name" = "blank", "label" = "Clear", "desc" = "Blank slate"),
list("name" = "shuttle", "label" = "Shuttle ETA", "desc" = "Display how much time is left."),
list("name" = "message", "label" = "Message", "desc" = "A custom message.")
list("name" = STATUS_DISPLAY_BLANK, "label" = "Clear", "desc" = "Blank slate"),
list("name" = STATUS_DISPLAY_TRANSFER_SHUTTLE_TIME, "label" = "Shuttle ETA", "desc" = "Display how much time is left."),
list("name" = STATUS_DISPLAY_MESSAGE, "label" = "Message", "desc" = "A custom message.")
),
"alerts"=list(
@@ -450,6 +450,7 @@
to_chat(user, "<span class='warning'>Central Command does not allow the shuttle to be called at this time. Please stand by.</span>") //This may show up before Epsilon Alert/Before DS arrives
return
// AA 2022-08-18 - Why is this not a round time offset??
if(world.time < 54000) // 30 minute grace period to let the game get going
to_chat(user, "The shuttle is refueling. Please wait another [round((54000-world.time)/600)] minutes before trying again.")
return
@@ -469,7 +470,7 @@
message_admins("[key_name_admin(user)] has called the shuttle - [formatJumpTo(user)].", 1)
return
// Why the hell are all these procs global?
/proc/cancel_call_proc(mob/user)
if(SSshuttle.cancelEvac(user))
log_game("[key_name(user)] has recalled the shuttle.")
@@ -479,28 +480,6 @@
log_game("[key_name(user)] has tried and failed to recall the shuttle.")
message_admins("[key_name_admin(user)] has tried and failed to recall the shuttle - ([ADMIN_FLW(user,"FLW")]).", 1)
/proc/post_status(command, data1, data2, mob/user = null)
var/datum/radio_frequency/frequency = SSradio.return_frequency(DISPLAY_FREQ)
if(!frequency) return
var/datum/signal/status_signal = new
status_signal.transmission_method = 1
status_signal.data["command"] = command
switch(command)
if("message")
status_signal.data["msg1"] = data1
status_signal.data["msg2"] = data2
log_admin("STATUS: [user] set status screen message: [data1] [data2]")
//message_admins("STATUS: [user] set status screen with [PDA]. Message: [data1] [data2]")
if("alert")
status_signal.data["picture_state"] = data1
spawn(0)
frequency.post_signal(null, status_signal)
/obj/machinery/computer/communications/Destroy()
GLOB.shuttle_caller_list -= src
+2 -10
View File
@@ -1,7 +1,3 @@
#define CHARS_PER_LINE 5
#define FONT_SIZE "5pt"
#define FONT_COLOR "#09f"
#define FONT_STYLE "Small Fonts"
#define CELL_NONE "None"
///////////////////////////////////////////////////////////////////////////////////////////////
@@ -416,7 +412,7 @@
var/disp1 = id
var/timeleft = timeleft()
var/disp2 = "[add_zero(num2text((timeleft / 60) % 60),2)]:[add_zero(num2text(timeleft % 60), 2)]"
if(length(disp2) > CHARS_PER_LINE)
if(length(disp2) > DISPLAY_CHARS_PER_LINE)
disp2 = "Error"
update_display(disp1, disp2)
else
@@ -440,7 +436,7 @@
/obj/machinery/door_timer/proc/update_display(line1, line2)
line1 = uppertext(line1)
line2 = uppertext(line2)
var/new_text = {"<div style="font-size:[FONT_SIZE];color:[FONT_COLOR];font:'[FONT_STYLE]';text-align:center;" valign="top">[line1]<br>[line2]</div>"}
var/new_text = {"<div style="font-size:[DISPLAY_FONT_SIZE];color:[DISPLAY_FONT_COLOR];font:'[DISPLAY_FONT_STYLE]';text-align:center;" valign="top">[line1]<br>[line2]</div>"}
if(maptext != new_text)
maptext = new_text
@@ -485,8 +481,4 @@
name = "Cell 6"
id = "Cell 6"
#undef FONT_SIZE
#undef FONT_COLOR
#undef FONT_STYLE
#undef CHARS_PER_LINE
#undef CELL_NONE
+76 -187
View File
@@ -1,8 +1,4 @@
#define FONT_SIZE "5pt"
#define FONT_COLOR "#09f"
#define WARNING_FONT_COLOR "#f90"
#define FONT_STYLE "Small Fonts"
#define SCROLL_SPEED 2
GLOBAL_LIST_EMPTY(status_displays)
// Status display
// (formerly Countdown timer display)
@@ -18,49 +14,34 @@
density = FALSE
use_power = IDLE_POWER_USE
idle_power_usage = 10
var/mode = 1 // 0 = Blank
// 1 = Shuttle timer
// 2 = Arbitrary message(s)
// 3 = alert picture
// 4 = Station time
var/picture_state // icon_state of alert picture
var/message1 = "" // message line 1
var/message2 = "" // message line 2
var/index1 // display index for scrolling messages or 0 if non-scrolling
var/index2
frequency = DISPLAY_FREQ // radio frequency
var/friendc = FALSE // track if Friend Computer mode
var/ignore_friendc = FALSE
var/spookymode = FALSE
maptext_height = 26
maptext_width = 32
maptext_y = -1
var/const/CHARS_PER_LINE = 5
var/const/STATUS_DISPLAY_BLANK = 0
var/const/STATUS_DISPLAY_TRANSFER_SHUTTLE_TIME = 1
var/const/STATUS_DISPLAY_MESSAGE = 2
var/const/STATUS_DISPLAY_ALERT = 3
var/const/STATUS_DISPLAY_TIME = 4
var/const/STATUS_DISPLAY_CUSTOM = 99
/// Status display mode
VAR_PRIVATE/mode = STATUS_DISPLAY_TRANSFER_SHUTTLE_TIME
/// icon_state of alert picture
var/picture_state
/// Are we spooked?
var/spookymode = FALSE
/// Line 1 of a custom message, if any
var/message1
/// Line 2 of a custom message, if any
var/message2
/// Is this a supply display?
var/is_supply = FALSE
// Display indexes for scrolling messages, or 0 if non-scrolling
var/index1
var/index2
/obj/machinery/status_display/Initialize()
. = ..()
GLOB.status_displays |= src
/obj/machinery/status_display/Destroy()
if(SSradio)
SSradio.remove_object(src,frequency)
GLOB.status_displays -= src
return ..()
// register for radio system
/obj/machinery/status_display/Initialize()
..()
if(SSradio)
SSradio.add_object(src, frequency)
update_icon()
/obj/machinery/status_display/update_overlays()
. = ..()
underlays.Cut()
@@ -75,10 +56,12 @@
/obj/machinery/status_display/power_change()
..()
if(stat & NOPOWER)
set_light(0)
else
set_light(1, LIGHTING_MINIMUM_POWER)
update_icon(UPDATE_OVERLAYS)
// timed process
@@ -86,10 +69,12 @@
if(stat & NOPOWER)
remove_display()
return
if(spookymode)
spookymode = FALSE
remove_display()
return
update()
/obj/machinery/status_display/emp_act(severity)
@@ -108,220 +93,124 @@
// set what is displayed
/obj/machinery/status_display/proc/update()
if(friendc && !ignore_friendc)
set_picture("ai_friend")
return 1
switch(mode)
if(STATUS_DISPLAY_BLANK) //blank
// Blank
if(STATUS_DISPLAY_BLANK)
remove_display()
return 1
if(STATUS_DISPLAY_TRANSFER_SHUTTLE_TIME) //emergency shuttle timer
var/use_warn = 0
return
if(STATUS_DISPLAY_TRANSFER_SHUTTLE_TIME)
var/use_warn = FALSE
if(SSshuttle.emergency && SSshuttle.emergency.timer)
use_warn = 1
use_warn = TRUE
message1 = "-[SSshuttle.emergency.getModeStr()]-"
message2 = SSshuttle.emergency.getTimerStr()
if(length(message2) > CHARS_PER_LINE)
if(length(message2) > DISPLAY_CHARS_PER_LINE)
message2 = "Error!"
else
message1 = "TIME"
message2 = station_time_timestamp("hh:mm")
update_display(message1, message2, use_warn)
return 1
if(STATUS_DISPLAY_MESSAGE) //custom messages
var/line1
var/line2
if(!index1)
line1 = message1
else
line1 = copytext(message1+"|"+message1, index1, index1+CHARS_PER_LINE)
line1 = copytext("[message1]|[message1]", index1, index1 + DISPLAY_CHARS_PER_LINE)
var/message1_len = length(message1)
index1 += SCROLL_SPEED
index1 += DISPLAY_SCROLL_SPEED
if(index1 > message1_len)
index1 -= message1_len
if(!index2)
line2 = message2
else
line2 = copytext(message2+"|"+message2, index2, index2+CHARS_PER_LINE)
line2 = copytext("[message2]|[message2]", index2, index2 + DISPLAY_CHARS_PER_LINE)
var/message2_len = length(message2)
index2 += SCROLL_SPEED
index2 += DISPLAY_SCROLL_SPEED
if(index2 > message2_len)
index2 -= message2_len
update_display(line1, line2)
return 1
if(STATUS_DISPLAY_TIME)
message1 = "TIME"
message2 = station_time_timestamp("hh:mm")
update_display(message1, message2)
return 1
return 0
/obj/machinery/status_display/examine(mob/user)
. = ..()
if(mode != STATUS_DISPLAY_BLANK && mode != STATUS_DISPLAY_ALERT)
. += "The display says:<br>\t[sanitize(message1)]<br>\t[sanitize(message2)]"
// Always call update() after using this
/obj/machinery/status_display/proc/set_mode(newmode)
mode = newmode
if(mode == STATUS_DISPLAY_ALERT)
// Its an alert image, clear all text
set_message(null, null)
else
// Not an alert image, clear any leftover image
set_picture(null)
/obj/machinery/status_display/proc/set_message(m1, m2)
if(m1)
index1 = (length(m1) > CHARS_PER_LINE)
index1 = (length(m1) > DISPLAY_CHARS_PER_LINE)
message1 = m1
else
message1 = ""
index1 = 0
if(m2)
index2 = (length(m2) > CHARS_PER_LINE)
index2 = (length(m2) > DISPLAY_CHARS_PER_LINE)
message2 = m2
else
message2 = ""
index2 = 0
/obj/machinery/status_display/proc/set_picture(state)
remove_display()
maptext = null
picture_state = state
update_icon(UPDATE_OVERLAYS)
/obj/machinery/status_display/proc/update_display(line1, line2, warning = 0)
line1 = uppertext(line1)
line2 = uppertext(line2)
var/new_text = {"<div style="font-size:[FONT_SIZE];color:[warning ? WARNING_FONT_COLOR : FONT_COLOR];font:'[FONT_STYLE]';text-align:center;" valign="top">[line1]<br>[line2]</div>"}
var/new_text = {"<div style="font-size:[DISPLAY_FONT_SIZE];color:[warning ? DISPLAY_WARNING_FONT_COLOR : DISPLAY_FONT_COLOR];font:'[DISPLAY_FONT_STYLE]';text-align:center;" valign="top">[line1]<br>[line2]</div>"}
if(maptext != new_text)
maptext = new_text
/obj/machinery/status_display/proc/remove_display()
if(maptext)
maptext = ""
picture_state = null
update_icon(UPDATE_OVERLAYS)
/obj/machinery/status_display/receive_signal(datum/signal/signal)
switch(signal.data["command"])
if("blank")
mode = STATUS_DISPLAY_BLANK
if("shuttle")
mode = STATUS_DISPLAY_TRANSFER_SHUTTLE_TIME
/proc/post_status(mode, data1, data2)
if(usr && mode == STATUS_DISPLAY_MESSAGE)
log_and_message_admins("set status screen message: [data1] [data2]")
if("message")
mode = STATUS_DISPLAY_MESSAGE
set_message(signal.data["msg1"], signal.data["msg2"])
for(var/obj/machinery/status_display/SD as anything in GLOB.status_displays)
if(SD.is_supply)
continue
if("alert")
mode = STATUS_DISPLAY_ALERT
set_picture(signal.data["picture_state"])
SD.set_mode(mode)
switch(mode)
if(STATUS_DISPLAY_MESSAGE)
SD.set_message(data1, data2)
if(STATUS_DISPLAY_ALERT)
SD.set_picture(data1)
if("time")
mode = STATUS_DISPLAY_TIME
/obj/machinery/ai_status_display
icon = 'icons/obj/status_display.dmi'
icon_state = "frame"
name = "AI display"
anchored = TRUE
density = FALSE
var/spookymode = FALSE
var/mode = 0 // 0 = Blank
// 1 = AI emoticon
// 2 = Blue screen of death
var/picture_state // icon_state of ai picture
var/emotion = "Neutral"
/obj/machinery/ai_status_display/Initialize(mapload)
. = ..()
update_icon()
/obj/machinery/ai_status_display/attack_ai(mob/living/silicon/ai/user)
if(isAI(user))
user.ai_statuschange()
/obj/machinery/ai_status_display/emp_act(severity)
if(stat & (BROKEN|NOPOWER))
..(severity)
return
mode = 2
update_icon()
..(severity)
/obj/machinery/ai_status_display/power_change()
..()
if(stat & NOPOWER)
set_light(0)
else
set_light(1, LIGHTING_MINIMUM_POWER)
/obj/machinery/ai_status_display/flicker()
if(stat & (NOPOWER | BROKEN))
return FALSE
spookymode = TRUE
update_icon()
return TRUE
/obj/machinery/ai_status_display/update_overlays()
. = ..()
var/new_display
underlays.Cut()
if(stat & NOPOWER)
return
switch(mode)
if(0) //Blank
new_display = "ai_off"
if(1) // AI emoticon
switch(emotion)
if("Very Happy")
new_display = "ai_veryhappy"
if("Happy")
new_display = "ai_happy"
if("Neutral")
new_display = "ai_neutral"
if("Unsure")
new_display = "ai_unsure"
if("Confused")
new_display = "ai_confused"
if("Sad")
new_display = "ai_sad"
if("Surprised")
new_display = "ai_surprised"
if("Upset")
new_display = "ai_upset"
if("Angry")
new_display = "ai_angry"
if("BSOD")
new_display = "ai_bsod"
if("Blank")
new_display = "ai_off"
if("Problems?")
new_display = "ai_trollface"
if("Awesome")
new_display = "ai_awesome"
if("Dorfy")
new_display = "ai_urist"
if("Facepalm")
new_display = "ai_facepalm"
if("Friend Computer")
new_display = "ai_friend"
if(2) // BSOD
new_display ="ai_bsod"
. += new_display
underlays += emissive_appearance(icon, "lightmask")
#undef FONT_SIZE
#undef FONT_COLOR
#undef WARNING_FONT_COLOR
#undef FONT_STYLE
#undef SCROLL_SPEED
SD.update()
+13 -22
View File
@@ -1,28 +1,19 @@
/obj/machinery/status_display/supply_display
name = "supply status display"
ignore_friendc = TRUE
is_supply = TRUE
/obj/machinery/status_display/supply_display/update()
if(!..() && mode == STATUS_DISPLAY_CUSTOM)
if(SSshuttle.supply.mode == SHUTTLE_IDLE)
if(is_station_level(SSshuttle.supply.z))
message1 = "CARGO"
message2 = "Docked"
else
message1 = "TIME"
message2 = station_time_timestamp("hh:mm")
else
if(SSshuttle.supply.mode == SHUTTLE_IDLE)
if(is_station_level(SSshuttle.supply.z))
message1 = "CARGO"
message2 = SSshuttle.supply.getTimerStr()
if(length(message2) > CHARS_PER_LINE)
message2 = "Error"
update_display(message1, message2)
return 1
return 0
/obj/machinery/status_display/supply_display/receive_signal/(datum/signal/signal)
if(signal.data["command"] == "supply")
mode = STATUS_DISPLAY_CUSTOM
message2 = "Docked"
else
message1 = "TIME"
message2 = station_time_timestamp("hh:mm")
else
return
message1 = "CARGO"
message2 = SSshuttle.supply.getTimerStr()
if(length(message2) > DISPLAY_CHARS_PER_LINE)
message2 = "Error"
update_display(message1, message2)
+1 -1
View File
@@ -10,7 +10,7 @@
INVOKE_ASYNC(D, /obj/machinery/door.proc/hostile_lockdown)
addtimer(CALLBACK(D, /obj/machinery/door.proc/disable_lockdown), 90 SECONDS)
addtimer(CALLBACK(src, .proc/reboot), 90 SECONDS)
post_status("alert", "lockdown")
post_status(STATUS_DISPLAY_ALERT, "lockdown")
/datum/event/door_runtime/proc/reboot()
GLOB.minor_announcement.Announce("Automatic system reboot complete. Have a secure day.","Network reset:", 'sound/AI/door_runtimes_fix.ogg')
+3 -14
View File
@@ -966,20 +966,9 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
if(check_unable())
return
for(var/obj/machinery/M in GLOB.machines) //change status
if(istype(M, /obj/machinery/ai_status_display))
var/obj/machinery/ai_status_display/AISD = M
AISD.emotion = emote
AISD.update_icon()
//if Friend Computer, change ALL displays
else if(istype(M, /obj/machinery/status_display))
var/obj/machinery/status_display/SD = M
if(emote=="Friend Computer")
SD.friendc = TRUE
else
SD.friendc = FALSE
return
for(var/obj/machinery/ai_status_display/AISD as anything in GLOB.ai_displays) //change status
AISD.emotion = emote
AISD.update_icon()
//I am the icon meister. Bow fefore me. //>fefore
/mob/living/silicon/ai/proc/ai_hologram_change()
+3 -3
View File
@@ -31,11 +31,11 @@
qdel(doomsday_device)
if(explosive)
spawn(10)
spawn(10) // REEEEEEEE
explosion(src.loc, 3, 6, 12, 15)
for(var/obj/machinery/ai_status_display/O in GLOB.machines) //change status
O.mode = 2
for(var/obj/machinery/ai_status_display/O as anything in GLOB.ai_displays) //change status
O.mode = AI_DISPLAY_MODE_BSOD
if(istype(loc, /obj/item/aicard))
loc.icon_state = "aicard-404"
+3 -2
View File
@@ -7,7 +7,8 @@
regenerate_icons()
if(stat != DEAD)
for(var/obj/machinery/ai_status_display/O in GLOB.machines) //change status
O.mode = 1
for(var/obj/machinery/ai_status_display/O as anything in GLOB.ai_displays) //change status
O.mode = AI_DISPLAY_MODE_EMOTE
O.emotion = "Neutral"
view_core()
+4 -4
View File
@@ -1,6 +1,6 @@
/mob/living/silicon/ai/Logout()
..()
for(var/obj/machinery/ai_status_display/O in GLOB.machines) //change status
O.mode = 0
src.view_core()
return
for(var/obj/machinery/ai_status_display/O as anything in GLOB.ai_displays) //change status
O.mode = AI_DISPLAY_MODE_BLANK
view_core()
@@ -3,8 +3,10 @@
. = ..()
if(!.)
return FALSE
icon_state = "ai-crash"
for(var/obj/machinery/ai_status_display/O in GLOB.machines) //change status
for(var/obj/machinery/ai_status_display/O as anything in GLOB.ai_displays) //change status
if(atoms_share_level(O, src))
O.mode = 2
O.mode = AI_DISPLAY_MODE_BSOD
gib()
+16 -37
View File
@@ -21,45 +21,24 @@
. = TRUE
switch(action)
if("SetMessage")
if(params["msgnum"])
switch(text2num(params["msgnum"]))
if(1)
message1 = clean_input("Line 1", "Enter Message Text", message1)
if(2)
message2 = clean_input("Line 2", "Enter Message Text", message2)
if("Status")
switch(params["statdisp"])
if("message")
post_status("message", message1, message2)
if("alert")
post_status("alert", params["alert"])
if("setmsg1")
message1 = clean_input("Line 1", "Enter Message Text", message1)
if("setmsg2")
message2 = clean_input("Line 2", "Enter Message Text", message2)
switch(text2num(params["statdisp"]))
if(STATUS_DISPLAY_MESSAGE)
post_status(STATUS_DISPLAY_MESSAGE, message1, message2)
if(STATUS_DISPLAY_ALERT)
post_status(STATUS_DISPLAY_ALERT, params["alert"])
else
post_status(params["statdisp"])
/datum/data/pda/app/status_display/proc/post_status(command, data1, data2)
var/datum/radio_frequency/frequency = SSradio.return_frequency(DISPLAY_FREQ)
if(!frequency)
return
var/datum/signal/status_signal = new
status_signal.source = src
status_signal.transmission_method = 1
status_signal.data["command"] = command
switch(command)
if("message")
status_signal.data["msg1"] = data1
status_signal.data["msg2"] = data2
var/mob/user = pda.fingerprintslast
if(istype(pda.loc, /mob/living))
name = pda.loc
log_admin("STATUS: [user] set status screen with [pda]. Message: [data1] [data2]")
message_admins("STATUS: [user] set status screen with [pda]. Message: [data1] [data2]")
if("alert")
status_signal.data["picture_state"] = data1
spawn(0)
frequency.post_signal(src, status_signal)
post_status(text2num(params["statdisp"]))
/datum/data/pda/app/signaller
name = "Signaler System"
@@ -36,7 +36,7 @@ GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/secur
GLOB.security_announcement_down.Announce("All threats to the station have passed. All weapons need to be holstered and privacy laws are once again fully enforced.","Attention! Security level lowered to green.", 'sound/AI/green.ogg')
GLOB.security_level = SEC_LEVEL_GREEN
unset_stationwide_emergency_lighting()
post_status("alert", "outline")
post_status(STATUS_DISPLAY_TRANSFER_SHUTTLE_TIME)
update_firealarms()
if(SEC_LEVEL_BLUE)
@@ -46,7 +46,7 @@ GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/secur
GLOB.security_announcement_down.Announce("The immediate threat has passed. Security may no longer have weapons drawn at all times, but may continue to have them visible. Random searches are still allowed.","Attention! Security level lowered to blue.", 'sound/AI/blue.ogg')
GLOB.security_level = SEC_LEVEL_BLUE
post_status("alert", "outline")
post_status(STATUS_DISPLAY_TRANSFER_SHUTTLE_TIME)
unset_stationwide_emergency_lighting()
update_firealarms()
@@ -62,7 +62,7 @@ GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/secur
if(R && is_station_level(R.z))
R.unlock(TRUE)
post_status("alert", "redalert")
post_status(STATUS_DISPLAY_ALERT, "redalert")
update_firealarms()
if(SEC_LEVEL_GAMMA)
@@ -74,7 +74,7 @@ GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/secur
if(is_station_level(R.z))
R.unlock(TRUE)
post_status("alert", "gammaalert")
post_status(STATUS_DISPLAY_ALERT, "gammaalert")
update_firealarms()
if(SEC_LEVEL_EPSILON)
@@ -92,7 +92,7 @@ GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/secur
GLOB.security_announcement_up.Announce("The station's self-destruct mechanism has been engaged. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill.","Attention! Delta security level reached!", 'sound/effects/deltaalarm.ogg', new_sound2 = 'sound/AI/delta.ogg')
GLOB.security_level = SEC_LEVEL_DELTA
post_status("alert", "deltaalert")
post_status(STATUS_DISPLAY_ALERT, "deltaalert")
update_firealarms()
set_stationwide_emergency_lighting()
SSblackbox.record_feedback("tally", "security_level_changes", 1, level)
@@ -206,7 +206,7 @@ GLOBAL_DATUM_INIT(security_announcement_down, /datum/announcement/priority/secur
/proc/epsilon_process()
GLOB.security_announcement_up.Announce("Central Command has ordered the Epsilon security level on the station. Consider all contracts terminated.", "Attention! Epsilon security level activated!", 'sound/effects/purge_siren.ogg')
GLOB.security_level = SEC_LEVEL_EPSILON
post_status("alert", "epsilonalert")
post_status(STATUS_DISPLAY_ALERT, "epsilonalert")
for(var/area/A as anything in GLOB.all_areas)
if(!is_station_level(A.z))
continue
-14
View File
@@ -407,7 +407,6 @@
to_chat(user, "<span class='warning'>Access denied.</span>")
return 1
post_signal("supply")
ui_interact(user)
return
@@ -507,7 +506,6 @@
SSshuttle.toggleShuttle("supply", "supply_home", "supply_away", 1)
investigate_log("| [key_name(usr)] has sent the supply shuttle away. Remaining points: [SSshuttle.points]. Shuttle contents: [SSshuttle.sold_atoms]", "cargo")
else if(!SSshuttle.supply.request(SSshuttle.getDock("supply_home")))
post_signal("supply")
if(LAZYLEN(SSshuttle.shoppinglist) && prob(10))
var/datum/supply_order/O = new /datum/supply_order()
O.ordernum = SSshuttle.ordernum
@@ -608,15 +606,3 @@
var/datum/browser/ccmsg_browser = new(usr, "ccmsg", "Central Command Cargo Message Log", 800, 600)
ccmsg_browser.set_content(SSshuttle.centcom_message)
ccmsg_browser.open()
/obj/machinery/computer/supplycomp/proc/post_signal(command)
var/datum/radio_frequency/frequency = SSradio.return_frequency(DISPLAY_FREQ)
if(!frequency) return
var/datum/signal/status_signal = new
status_signal.source = src
status_signal.transmission_method = 1
status_signal.data["command"] = command
frequency.post_signal(src, status_signal)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 121 KiB

+1
View File
@@ -661,6 +661,7 @@
#include "code\game\jobs\job\syndicate.dm"
#include "code\game\jobs\job_objectives\science.dm"
#include "code\game\machinery\adv_med.dm"
#include "code\game\machinery\ai_display.dm"
#include "code\game\machinery\ai_slipper.dm"
#include "code\game\machinery\autolathe.dm"
#include "code\game\machinery\Beacon.dm"
@@ -122,7 +122,7 @@ export const CommunicationsComputer = (props, context) => {
content={ib.label}
selected={ib.alert === data.stat_display.icon}
disabled={!data.authhead}
onClick={() => act('setstat', { statdisp: 'alert', alert: ib.alert })}
onClick={() => act('setstat', { statdisp: 3, alert: ib.alert })}
/>
);
});
@@ -6,6 +6,8 @@ export const pda_status_display = (props, context) => {
const { records } = data;
// The magic number values for the statdisp entry can be found in code\__DEFINES\machines.dm
return (
<Box>
<LabeledList>
@@ -14,19 +16,19 @@ export const pda_status_display = (props, context) => {
color="transparent"
icon="trash"
content="Clear"
onClick={() => act('Status', { statdisp: 'blank' })}
onClick={() => act('Status', { statdisp: 0 })}
/>
<Button
color="transparent"
icon="clock"
content="Evac ETA"
onClick={() => act('Status', { statdisp: 'shuttle' })}
onClick={() => act('Status', { statdisp: 1 })}
/>
<Button
color="transparent"
icon="edit"
content="Message"
onClick={() => act('Status', { statdisp: 'message' })}
onClick={() => act('Status', { statdisp: 2 })}
/>
<Button
color="transparent"
@@ -34,7 +36,7 @@ export const pda_status_display = (props, context) => {
content="Red Alert"
onClick={() =>
act('Status', {
statdisp: 'alert',
statdisp: 3,
alert: 'redalert',
})
}
@@ -45,7 +47,7 @@ export const pda_status_display = (props, context) => {
content="NT Logo"
onClick={() =>
act('Status', {
statdisp: 'alert',
statdisp: 3,
alert: 'default',
})
}
@@ -56,7 +58,7 @@ export const pda_status_display = (props, context) => {
content="Lockdown"
onClick={() =>
act('Status', {
statdisp: 'alert',
statdisp: 3,
alert: 'lockdown',
})
}
@@ -67,7 +69,7 @@ export const pda_status_display = (props, context) => {
content="Biohazard"
onClick={() =>
act('Status', {
statdisp: 'alert',
statdisp: 3,
alert: 'biohazard',
})
}
@@ -77,14 +79,14 @@ export const pda_status_display = (props, context) => {
<Button
content={records.message1 + ' (set)'}
icon="pen"
onClick={() => act('Status', { statdisp: 'setmsg1' })}
onClick={() => act('SetMessage', { msgnum: 1 })}
/>
</LabeledList.Item>
<LabeledList.Item label="Message line 2">
<Button
content={records.message2 + ' (set)'}
icon="pen"
onClick={() => act('Status', { statdisp: 'setmsg2' })}
onClick={() => act('SetMessage', { msgnum: 2 })}
/>
</LabeledList.Item>
</LabeledList>
File diff suppressed because one or more lines are too long