mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-13 08:56:49 +01:00
Removes old command and communications console (#3479)
Removes old command and communications console (It is now replaced with modular console with command preset)
This commit is contained in:
@@ -16,8 +16,13 @@
|
||||
usage_flags = PROGRAM_CONSOLE
|
||||
network_destination = "station long-range communication array"
|
||||
var/datum/comm_message_listener/message_core = new
|
||||
var/intercept = 0
|
||||
color = LIGHT_COLOR_BLUE
|
||||
|
||||
/datum/computer_file/program/comm/New(intercept_printing = 0)
|
||||
. = ..()
|
||||
intercept = intercept_printing
|
||||
|
||||
/datum/computer_file/program/comm/clone()
|
||||
var/datum/computer_file/program/comm/temp = ..()
|
||||
temp.message_core.messages = null
|
||||
@@ -47,6 +52,8 @@
|
||||
data["emagged"] = program.computer_emagged
|
||||
data["net_comms"] = !!program.get_signal(NTNET_COMMUNICATION) //Double !! is needed to get 1 or 0 answer
|
||||
data["net_syscont"] = !!program.get_signal(NTNET_SYSTEMCONTROL)
|
||||
var/datum/computer_file/program/comm/P = program
|
||||
data["message_printing_intercepts"] = P.intercept
|
||||
if(program.computer)
|
||||
data["have_printer"] = !!program.computer.nano_printer
|
||||
else
|
||||
@@ -56,6 +63,7 @@
|
||||
data["net_comms"] = 1
|
||||
data["net_syscont"] = 1
|
||||
data["have_printer"] = 0
|
||||
data["message_printing_intercepts"] = 0
|
||||
|
||||
data["message_line1"] = msg_line1
|
||||
data["message_line2"] = msg_line2
|
||||
@@ -193,11 +201,11 @@
|
||||
if(can_still_topic())
|
||||
msg_line2 = linput
|
||||
if("message")
|
||||
post_status("message", msg_line1, msg_line2)
|
||||
post_display_status("message", msg_line1, msg_line2)
|
||||
if("alert")
|
||||
post_status("alert", href_list["alert"])
|
||||
post_display_status("alert", href_list["alert"])
|
||||
else
|
||||
post_status(href_list["target"])
|
||||
post_display_status(href_list["target"])
|
||||
|
||||
if("setalert")
|
||||
if(is_autenthicated(user) && !issilicon(usr) && ntn_cont && ntn_comm)
|
||||
@@ -238,31 +246,14 @@
|
||||
usr << "<span class='notice'>Hardware error: Printer was unable to print the file. It may be out of paper.</span>"
|
||||
else
|
||||
program.computer.visible_message("<span class='notice'>\The [program.computer] prints out paper.</span>")
|
||||
if("toggleintercept")
|
||||
if(is_autenthicated(user) && ntn_comm)
|
||||
if(program && program.computer && program.computer.nano_printer)
|
||||
var/datum/computer_file/program/comm/P = program
|
||||
P.intercept = !P.intercept
|
||||
|
||||
SSnanoui.update_uis(src)
|
||||
|
||||
/datum/nano_module/program/comm/proc/post_status(var/command, var/data1, var/data2)
|
||||
|
||||
var/datum/radio_frequency/frequency = SSradio.return_frequency(1435)
|
||||
|
||||
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
|
||||
log_admin("STATUS: [key_name(usr)] set status screen message with [src]: [data1] [data2]",ckey=key_name(usr))
|
||||
if("alert")
|
||||
status_signal.data["picture_state"] = data1
|
||||
|
||||
frequency.post_signal(src, status_signal)
|
||||
|
||||
#undef STATE_DEFAULT
|
||||
#undef STATE_MESSAGELIST
|
||||
#undef STATE_VIEWMESSAGE
|
||||
@@ -289,15 +280,12 @@ var/last_message_id = 0
|
||||
for (var/datum/comm_message_listener/l in comm_message_listeners)
|
||||
l.Add(message)
|
||||
|
||||
//Old console support
|
||||
for (var/obj/machinery/computer/communications/comm in SSmachinery.processing_machines)
|
||||
if (!(comm.stat & (BROKEN | NOPOWER)) && comm.prints_intercept)
|
||||
var/obj/item/weapon/paper/intercept = new /obj/item/weapon/paper( comm.loc )
|
||||
intercept.name = message_title
|
||||
intercept.info = message_text
|
||||
for (var/obj/item/modular_computer/computer in get_listeners_by_type("modular_computers", /obj/item/modular_computer))
|
||||
if(computer && computer.working && !!computer.nano_printer)
|
||||
var/datum/computer_file/program/comm/C = locate(/datum/computer_file/program/comm) in computer.hard_drive.stored_files
|
||||
if(C && C.intercept)
|
||||
computer.nano_printer.print_text(message_text, message_title)
|
||||
|
||||
comm.messagetitle.Add(message_title)
|
||||
comm.messagetext.Add(message_text)
|
||||
|
||||
/datum/comm_message_listener
|
||||
var/list/messages
|
||||
@@ -312,3 +300,131 @@ var/last_message_id = 0
|
||||
|
||||
/datum/comm_message_listener/proc/Remove(var/list/message)
|
||||
messages -= list(message)
|
||||
/*
|
||||
Command action procs
|
||||
*/
|
||||
/proc/post_display_status(var/command, var/data1, var/data2)
|
||||
|
||||
var/datum/radio_frequency/frequency = SSradio.return_frequency(1435)
|
||||
|
||||
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
|
||||
log_admin("STATUS: [key_name(usr)] set status screen message with [src]: [data1] [data2]")
|
||||
if("alert")
|
||||
status_signal.data["picture_state"] = data1
|
||||
|
||||
frequency.post_signal(src, status_signal)
|
||||
|
||||
/proc/cancel_call_proc(var/mob/user)
|
||||
if (!(ROUND_IS_STARTED) || !emergency_shuttle.can_recall())
|
||||
return
|
||||
if((SSticker.mode.name == "blob")||(SSticker.mode.name == "Meteor"))
|
||||
return
|
||||
|
||||
if(!emergency_shuttle.going_to_centcom()) //check that shuttle isn't already heading to centcomm
|
||||
emergency_shuttle.recall()
|
||||
log_game("[key_name(user)] has recalled the shuttle.",key_name(user))
|
||||
message_admins("[key_name_admin(user)] has recalled the shuttle.", 1)
|
||||
return
|
||||
|
||||
|
||||
/proc/is_relay_online()
|
||||
for(var/obj/machinery/bluespacerelay/M in SSmachinery.all_machines)
|
||||
if(M.stat == 0)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/proc/call_shuttle_proc(var/mob/user)
|
||||
if ((!(ROUND_IS_STARTED) || !emergency_shuttle.location()))
|
||||
return
|
||||
|
||||
if(!universe.OnShuttleCall(usr))
|
||||
user << "<span class='notice'>Cannot establish a bluespace connection.</span>"
|
||||
return
|
||||
|
||||
if(deathsquad.deployed)
|
||||
user << "[boss_short] will not allow the shuttle to be called. Consider all contracts terminated."
|
||||
return
|
||||
|
||||
if(emergency_shuttle.deny_shuttle)
|
||||
user << "The emergency shuttle may not be sent at this time. Please try again later."
|
||||
return
|
||||
|
||||
if(world.time < 6000) // Ten minute grace period to let the game get going without lolmetagaming. -- TLE
|
||||
user << "The emergency shuttle is refueling. Please wait another [round((6000-world.time)/600)] minute\s before trying again."
|
||||
return
|
||||
|
||||
if(emergency_shuttle.going_to_centcom())
|
||||
user << "The emergency shuttle may not be called while returning to [boss_short]."
|
||||
return
|
||||
|
||||
if(emergency_shuttle.online())
|
||||
user << "The emergency shuttle is already on its way."
|
||||
return
|
||||
|
||||
if(SSticker.mode.name == "blob")
|
||||
user << "Under directive 7-10, [station_name()] is quarantined until further notice."
|
||||
return
|
||||
|
||||
emergency_shuttle.call_evac()
|
||||
log_game("[key_name(user)] has called the shuttle.",ckey=key_name(user))
|
||||
message_admins("[key_name_admin(user)] has called the shuttle.", 1)
|
||||
|
||||
|
||||
return
|
||||
|
||||
/proc/init_shift_change(var/mob/user, var/force = 0)
|
||||
if ((!(ROUND_IS_STARTED) || !emergency_shuttle.location()))
|
||||
return
|
||||
|
||||
if(emergency_shuttle.going_to_centcom())
|
||||
user << "The shuttle may not be called while returning to [boss_short]."
|
||||
return
|
||||
|
||||
if(emergency_shuttle.online())
|
||||
user << "The shuttle is already on its way."
|
||||
return
|
||||
|
||||
// if force is 0, some things may stop the shuttle call
|
||||
if(!force)
|
||||
if(emergency_shuttle.deny_shuttle)
|
||||
user << "[boss_short] does not currently have a shuttle available in your sector. Please try again later."
|
||||
return
|
||||
|
||||
if(deathsquad.deployed == 1)
|
||||
user << "[boss_short] will not allow the shuttle to be called. Consider all contracts terminated."
|
||||
return
|
||||
|
||||
if(world.time < 54000) // 30 minute grace period to let the game get going
|
||||
user << "The shuttle is refueling. Please wait another [round((54000-world.time)/60)] minutes before trying again."
|
||||
return
|
||||
|
||||
if(SSticker.mode.auto_recall_shuttle)
|
||||
//New version pretends to call the shuttle but cause the shuttle to return after a random duration.
|
||||
emergency_shuttle.auto_recall = 1
|
||||
|
||||
if(SSticker.mode.name == "blob" || SSticker.mode.name == "epidemic")
|
||||
user << "Under directive 7-10, [station_name()] is quarantined until further notice."
|
||||
return
|
||||
|
||||
emergency_shuttle.call_transfer()
|
||||
|
||||
//delay events in case of an autotransfer
|
||||
if (!user)
|
||||
SSevents.delay_events(EVENT_LEVEL_MODERATE, 10200) //17 minutes
|
||||
SSevents.delay_events(EVENT_LEVEL_MAJOR, 10200)
|
||||
|
||||
log_game("[user? key_name(user) : "Autotransfer"] has called the shuttle.")
|
||||
message_admins("[user? key_name_admin(user) : "Autotransfer"] has called the shuttle.", 1)
|
||||
|
||||
return
|
||||
Reference in New Issue
Block a user