From ee32bfcf23a6f1d13b29d09a1437fba4d89b74dc Mon Sep 17 00:00:00 2001 From: Atermonera Date: Tue, 10 Mar 2020 23:09:38 -0700 Subject: [PATCH] Merge pull request #6807 from Neerti/multiline_command_stuff QoL: Comms Consoles --- code/game/machinery/computer/communications.dm | 12 ++++++------ code/game/machinery/status_display.dm | 16 ++++++++++++++++ .../file_system/programs/command/comm.dm | 7 +++++-- code/modules/security levels/security levels.dm | 3 +-- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 2259f03082..21c795f08d 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -65,10 +65,7 @@ src.state = STATE_DEFAULT if("login") var/mob/M = usr - var/obj/item/weapon/card/id/I = M.get_active_hand() - if (istype(I, /obj/item/device/pda)) - var/obj/item/device/pda/pda = I - I = pda.id + var/obj/item/weapon/card/id/I = M.GetIdCard() if (I && istype(I)) if(src.check_access(I)) authenticated = 1 @@ -109,7 +106,7 @@ if(message_cooldown) to_chat(usr, "Please allow at least one minute to pass between announcements") return - var/input = input(usr, "Please write a message to announce to the station crew.", "Priority Announcement") + var/input = input(usr, "Please write a message to announce to the station crew.", "Priority Announcement") as null|message if(!input || !(usr in view(1,src))) return crew_announcement.Announce(input) @@ -188,7 +185,10 @@ if(centcomm_message_cooldown) to_chat(usr, "Arrays recycling. Please stand by.") return - var/input = sanitize(input("Please choose a message to transmit to [using_map.boss_short] via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "")) + var/input = sanitize(input("Please choose a message to transmit to [using_map.boss_short] via quantum entanglement. \ + Please be aware that this process is very expensive, and abuse will lead to... termination. \ + Transmission does not guarantee a response. \ + There is a 30 second delay before you may send another message, be clear, full and concise.", "Central Command Quantum Messaging") as null|message) if(!input || !(usr in view(1,src))) return CentCom_announce(input, usr) diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index 43d9168a65..2c2d385ac8 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -181,6 +181,18 @@ if("delta") set_light(l_range = 4, l_power = 0.9, l_color = "#FF6633") set_picture("status_display_[seclevel]") +// Called when the alert level is changed. +/obj/machinery/status_display/proc/on_alert_changed(new_level) + // On most alerts, this will change to a flashing alert picture in a specific color. + // Doing that for green alert automatically doesn't really make sense, but it is still available on the comm consoles/PDAs. + if(seclevel2num(new_level) == SEC_LEVEL_GREEN) + mode = STATUS_DISPLAY_TIME + set_light(0) // Remove any glow we had from the alert previously. + update() + return + mode = STATUS_DISPLAY_ALERT + display_alert(new_level) + /obj/machinery/status_display/proc/set_picture(state) remove_display() if(!picture || picture_state != state) @@ -231,13 +243,16 @@ switch(signal.data["command"]) if("blank") mode = STATUS_DISPLAY_BLANK + set_light(0) if("shuttle") mode = STATUS_DISPLAY_TRANSFER_SHUTTLE_TIME + set_light(0) if("message") mode = STATUS_DISPLAY_MESSAGE set_message(signal.data["msg1"], signal.data["msg2"]) + set_light(0) if("alert") mode = STATUS_DISPLAY_ALERT @@ -245,6 +260,7 @@ if("time") mode = STATUS_DISPLAY_TIME + set_light(0) update() #undef CHARS_PER_LINE diff --git a/code/modules/modular_computers/file_system/programs/command/comm.dm b/code/modules/modular_computers/file_system/programs/command/comm.dm index c174ced23b..71e7179566 100644 --- a/code/modules/modular_computers/file_system/programs/command/comm.dm +++ b/code/modules/modular_computers/file_system/programs/command/comm.dm @@ -131,7 +131,7 @@ if(announcment_cooldown) to_chat(usr, "Please allow at least one minute to pass between announcements") return TRUE - var/input = input(usr, "Please write a message to announce to the station crew.", "Priority Announcement") as null|text + var/input = input(usr, "Please write a message to announce to the station crew.", "Priority Announcement") as null|message if(!input || !can_still_topic()) return 1 crew_announcement.Announce(input) @@ -165,7 +165,10 @@ if(!is_relay_online())//Contact Centcom has a check, Syndie doesn't to allow for Traitor funs. to_chat(usr, "No Emergency Bluespace Relay detected. Unable to transmit message.") return 1 - var/input = sanitize(input("Please choose a message to transmit to Centcomm via quantum entanglement. Please be aware that this process is very expensive, and abuse will lead to... termination. Transmission does not guarantee a response. There is a 30 second delay before you may send another message, be clear, full and concise.", "To abort, send an empty message.", "") as null|text) + var/input = sanitize(input("Please choose a message to transmit to Centcomm via quantum entanglement. \ + Please be aware that this process is very expensive, and abuse will lead to... termination. \ + Transmission does not guarantee a response. There is a 30 second delay before you may send another message, \ + be clear, full and concise.", "Central Command Quantum Messaging") as null|message) if(!input || !can_still_topic()) return 1 CentCom_announce(input, usr) diff --git a/code/modules/security levels/security levels.dm b/code/modules/security levels/security levels.dm index ff5f96bdde..8224b72e22 100644 --- a/code/modules/security levels/security levels.dm +++ b/code/modules/security levels/security levels.dm @@ -78,8 +78,7 @@ FA.set_security_level(newlevel) for(var/obj/machinery/status_display/FA in machines) if(FA.z in using_map.contact_levels) - FA.display_alert(newlevel) - FA.mode = 3 + FA.on_alert_changed(newlevel) if(level >= SEC_LEVEL_RED) atc.reroute_traffic(yes = 1) // Tell them fuck off we're busy.