mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2026-08-24 05:06:47 +01:00
button
This commit is contained in:
@@ -62,7 +62,7 @@ SUBSYSTEM_DEF(communications)
|
||||
COOLDOWN_START(src, emergency_meeting_cooldown, COMMUNICATION_COOLDOWN_MEETING)
|
||||
message_admins("[ADMIN_LOOKUPFLW(user)] has called an emergency meeting.")
|
||||
|
||||
/datum/controller/subsystem/communications/proc/send_message(datum/comm_message/sending,print = TRUE,unique = FALSE)
|
||||
/datum/controller/subsystem/communications/proc/send_message(datum/comm_message/sending, print = FALSE, unique = FALSE)
|
||||
for(var/obj/machinery/computer/communications/C in GLOB.machines)
|
||||
if(!(C.stat & (BROKEN|NOPOWER)) && is_station_level(C.z))
|
||||
if(unique)
|
||||
|
||||
@@ -41,6 +41,9 @@
|
||||
/// The last lines used for changing the status display
|
||||
var/static/last_status_display
|
||||
|
||||
/// Cooldown between printing announcement papers
|
||||
COOLDOWN_DECLARE(report_print_cooldown)
|
||||
|
||||
/obj/machinery/computer/communications/Initialize(mapload)
|
||||
. = ..()
|
||||
GLOB.shuttle_caller_list += src
|
||||
@@ -162,6 +165,14 @@
|
||||
deadchat_broadcast(" has changed the security level to [params["newSecurityLevel"]] with [src] at [span_name("[get_area_name(usr, TRUE)]")].", span_name("[usr.real_name]"), usr, message_type=DEADCHAT_ANNOUNCEMENT)
|
||||
|
||||
alert_level_tick += 1
|
||||
if ("printMessage")
|
||||
if (!authenticated(usr))
|
||||
return
|
||||
var/message_index = text2num(params["message"])
|
||||
if (!message_index)
|
||||
return
|
||||
var/datum/comm_message/message = LAZYACCESS(messages, message_index)
|
||||
print_report(message.content, message.title)
|
||||
if ("deleteMessage")
|
||||
if (!authenticated(usr))
|
||||
return
|
||||
@@ -438,6 +449,7 @@
|
||||
data["shuttleLastCalled"] = format_text(SSshuttle.emergencyLastCallLoc.name)
|
||||
if (STATE_MESSAGES)
|
||||
data["messages"] = list()
|
||||
data["printerCooldown"] = report_print_cooldown
|
||||
|
||||
if (messages)
|
||||
for (var/_message in messages)
|
||||
@@ -587,6 +599,17 @@
|
||||
/obj/machinery/computer/communications/proc/add_message(datum/comm_message/new_message)
|
||||
LAZYADD(messages, new_message)
|
||||
|
||||
/obj/machinery/computer/communications/proc/print_report(message, title)
|
||||
if(!COOLDOWN_FINISHED(src, report_print_cooldown))
|
||||
say("Printer on cooldown!")
|
||||
return
|
||||
COOLDOWN_START(src, report_print_cooldown, 30 SECONDS)
|
||||
var/obj/item/paper/P = new /obj/item/paper(loc)
|
||||
P.name = "paper - '[title]'"
|
||||
P.info = message
|
||||
P.update_appearance()
|
||||
playsound(src, 'sound/effects/printer.ogg', 50, FALSE)
|
||||
|
||||
/datum/comm_message
|
||||
var/title
|
||||
var/content
|
||||
|
||||
Reference in New Issue
Block a user