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
+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)