diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index f3ccef9ccd9c..c9d711aea662 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -104,6 +104,8 @@ #define SIGNFONT "Times New Roman" #define CHARCOAL_FONT "Candara" +#define PAPER_FIELD "" + #define RESIZE_DEFAULT_SIZE 1 @@ -496,4 +498,4 @@ GLOBAL_LIST_INIT(pda_styles, list(MONO, VT, ORBITRON, SHARE)) /// 2 tiles down #define ui_vamprank_display "WEST:6,CENTER-2:-5" /// 6 pixels to the right, zero tiles & 5 pixels DOWN. -#define ui_sunlight_display "WEST:6,CENTER-0:0" \ No newline at end of file +#define ui_sunlight_display "WEST:6,CENTER-0:0" diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index f969bbc261f9..983612f5065f 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -69,6 +69,7 @@ GLOBAL_PROTECT(admin_verbs_admin) /client/proc/cmd_admin_world_narrate, /*sends text to all players with no padding*/ /client/proc/cmd_admin_local_narrate, /*sends text to all mobs within view of atom*/ /client/proc/cmd_admin_create_centcom_report, + /client/proc/send_global_fax, /client/proc/cmd_change_command_name, /client/proc/cmd_admin_check_player_exp, /* shows players by playtime */ /client/proc/toggle_combo_hud, // toggle display of the combination pizza antag and taco sci/med/eng hud diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 6cda8349b44a..09cb56932745 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -2264,64 +2264,67 @@ else if(href_list["beakerpanel"]) beaker_panel_act(href_list) + else if(href_list["checkAIDash"]) + var/mob/living/silicon/ai/AI = locate(href_list["checkAIDash"]) + if(!AI) + return + if(!AI.dashboard) + return + AI.dashboard.ui_interact(src.owner.mob) + else if(href_list["AdminFaxView"]) var/obj/info = locate(href_list["AdminFaxView"]) in GLOB.adminfaxes if(info) info.examine(usr, TRUE) else if(href_list["CentcomFaxReply"]) - var/mob/living/carbon/human/H = locate(href_list["CentcomFaxReply"]) - var/obj/machinery/photocopier/faxmachine/fax = locate(href_list["originfax"]) in GLOB.allfaxes - - var/inputsubject = input(src.owner, "Please enter a Subject", "Outgoing message from Centcom", "") as text|null - if(!inputsubject) return + var/obj/machinery/photocopier/faxmachine/F = locate(href_list["originfax"]) in GLOB.allfaxes + if(!istype(F)) + to_chat(src.owner, span_danger("Unable to locate fax!")) + return + owner.send_admin_fax(F) - var/inputmessage = input(src.owner, "Please enter a message to reply to [key_name(H)] via secure connection. Use
for line breaks.", "Outgoing message from Centcom", "") as message|null - if(!inputmessage) return +/client/proc/send_global_fax() + set category = "Admin.Round Interaction" + set name = "Send Global Fax" + if(!check_rights(R_ADMIN)) + return + send_admin_fax() - var/inputsigned = input(src.owner, "Please enter Centcom Offical name.", "Outgoing message from Centcom", "") as text|null - if(!inputsigned) return +/client/proc/send_admin_fax(obj/machinery/photocopier/faxmachine/F) + var/inputsubject = input(src, "Please enter a subject", "Outgoing message from CentCom", "") as text|null + if(!inputsubject) + return - var/customname = input(src.owner, "Pick a title for the report", "Title") as text|null - var/input = "
NanoTrasen Fax Network

RE: [inputsubject]

[inputmessage]
Signed: [inputsigned]" + var/inputmessage = input(src, "Please enter the message sent to [istype(F) ? F : "all fax machines"] via secure connection. Supports pen markdown.", "Outgoing message from CentCom", "") as message|null + if(!inputmessage) + return - for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes) - if(F == fax) - if(! (F.stat & (BROKEN|NOPOWER) ) ) + var/inputsigned = input(src, "Please enter CentCom Official name.", "Outgoing message from CentCom", usr?.client?.holder?.admin_signature || "") as text|null + if(!inputsigned) + return - // animate! it's alive! - flick("faxreceive", F) + var/customname = input(src, "Pick a title for the report", "Title") as text|null + var/prefix = "
NanoTrasen Fax Network

RE: [inputsubject]

" + var/suffix = "
Signed: [inputsigned]" - // give the sprite some time to flick - spawn(20) - var/obj/item/paper/P = new /obj/item/paper( F.loc ) - P.name = "[command_name()]- [customname]" - P.info = input - P.update_icon() + inputmessage = parsemarkdown(inputmessage) + inputmessage = "[prefix][inputmessage][suffix]" - playsound(F.loc, "sound/items/polaroid1.ogg", 50, 1) + var/list/T = splittext(inputmessage,PAPER_FIELD,1,0,TRUE) // The list of subsections.. Splits the text on where paper fields have been created. + //The TRUE marks that we're keeping these "seperator" paper fields; they're included in this list. - // Stamps - var/image/stampoverlay = image('icons/obj/bureaucracy.dmi') - stampoverlay.icon_state = "paper_stamp-cent" - if(!P.stamped) - P.stamped = new - P.stamped += /obj/item/stamp - P.overlays += stampoverlay - P.stamps += "
This paper has been stamped by the Central Command Quantum Relay." + log_admin("[key_name(src)] sent a fax message to [istype(F) ? F : "all fax machines"]: [inputmessage]") + message_admins("[key_name_admin(src)] sent a fax message to [istype(F) ? F : "all fax machines"]") + if(!istype(F)) + minor_announce("Central Command has sent a fax message, it will be printed out at all fax machines.") - to_chat(owner, "Message reply to Station transmitted successfully.") - log_admin("[key_name(src.owner)] replied to a fax message from [key_name(H)]: [input]") - message_admins("[key_name_admin(src.owner)] replied to a fax message from [key_name_admin(H)]", 1) - return - to_chat(src.owner, span_danger("Unable to locate fax!")) - else if(href_list["checkAIDash"]) - var/mob/living/silicon/ai/AI = locate(href_list["checkAIDash"]) - if(!AI) - return - if(!AI.dashboard) - return - AI.dashboard.ui_interact(src.owner.mob) + if(istype(F)) + INVOKE_ASYNC(F, /obj/machinery/photocopier/faxmachine.proc/recieve_admin_fax, customname, T) + return + + for(var/obj/machinery/photocopier/faxmachine/fax in GLOB.allfaxes) + INVOKE_ASYNC(fax, /obj/machinery/photocopier/faxmachine.proc/recieve_admin_fax, customname, T) /datum/admins/proc/HandleCMode() if(!check_rights(R_ADMIN)) diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm index 69b19b8c4cfe..7b7fc0be5d51 100644 --- a/code/modules/paperwork/faxmachine.dm +++ b/code/modules/paperwork/faxmachine.dm @@ -21,7 +21,6 @@ GLOBAL_LIST_EMPTY(adminfaxes) /obj/machinery/photocopier/faxmachine/Initialize() . = ..() GLOB.allfaxes += src - if( !((department in GLOB.alldepartments) || (department in GLOB.admin_departments)) ) GLOB.alldepartments |= department @@ -54,7 +53,8 @@ GLOBAL_LIST_EMPTY(adminfaxes) if(!copier_empty()) if(sendcooldown - world.time > 0) to_chat(usr, "Transmitter recharging") - return + return + sendcooldown = world.time + 1 MINUTES if (destination in GLOB.admin_departments) INVOKE_ASYNC(src, .proc/send_admin_fax, usr, destination) else @@ -91,28 +91,22 @@ GLOBAL_LIST_EMPTY(adminfaxes) authenticated = TRUE auth_name = "[id_card.registered_name] - [id_card.assignment]" return - if("logout") authenticated = FALSE auth_name = null return - return FALSE /obj/machinery/photocopier/faxmachine/proc/sendfax(var/destination) if(stat & (BROKEN|NOPOWER)) return - use_power(200) - var/success = FALSE for(var/obj/machinery/photocopier/faxmachine/F in GLOB.allfaxes) if( F.department == destination ) success ||= F.recievefax(copy || photocopy) - if (success) visible_message("[src] beeps, \"Message transmitted successfully.\"") - sendcooldown = world.time + 1 MINUTES else visible_message("[src] beeps, \"Error transmitting message.\"") @@ -125,10 +119,8 @@ GLOBAL_LIST_EMPTY(adminfaxes) flick("faxreceive", src) playsound(loc, "sound/items/polaroid1.ogg", 50, 1) - // give the sprite some time to flick sleep(2.3 SECONDS) - if (istype(incoming, /obj/item/paper)) copy(incoming) else if (istype(incoming, /obj/item/photo)) @@ -137,14 +129,12 @@ GLOBAL_LIST_EMPTY(adminfaxes) bundlecopy(incoming) else return FALSE - use_power(active_power_usage) return TRUE /obj/machinery/photocopier/faxmachine/proc/send_admin_fax(var/mob/sender, var/destination) if(stat & (BROKEN|NOPOWER)) return - use_power(200) var/obj/item/rcvdcopy @@ -174,10 +164,9 @@ GLOBAL_LIST_EMPTY(adminfaxes) sendcooldown = world.time + 1 MINUTES sleep(5 SECONDS) visible_message("[src] beeps, \"Message transmitted successfully.\"") - /obj/machinery/photocopier/faxmachine/proc/send_adminmessage(var/mob/sender, var/faxname, var/obj/item/sent, var/reply_type, font_colour="#006100") - var/msg = "[faxname]: [key_name(sender, 1)] (PP) (VV) (SM) (JMP) (REPLY): Receiving '[sent.name]' via secure connection ... view message" + var/msg = "[faxname]: [key_name(sender, 1)] (PP) (VV) (SM) (JMP) (REPLY): Receiving '[sent.name]' via secure connection ... view message" msg = span_admin("[msg]") to_chat(GLOB.admins, type = MESSAGE_TYPE_ADMINLOG, @@ -186,3 +175,47 @@ GLOBAL_LIST_EMPTY(adminfaxes) /obj/machinery/photocopier/faxmachine/check_ass() return FALSE // No ass here + +/obj/machinery/photocopier/faxmachine/proc/recieve_admin_fax(customname, list/T) + if(stat & (BROKEN|NOPOWER)) + return + // animate! it's alive! + flick("faxreceive", src) + + // give the sprite some time to flick + spawn(20) + var/obj/item/paper/P = new /obj/item/paper( loc ) + P.name = "[command_name()] - [customname]" + + var/list/templist = list() // All the stuff we're adding to $written + for(var/text in T) + if(text == PAPER_FIELD) + templist += text + else + var/datum/langtext/L = new(text,/datum/language/common) + templist += L + + P.written += templist + P.update_icon() + playsound(loc, "sound/items/polaroid1.ogg", 50, 1) + + // Stamps + var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/simple/paper) + if (isnull(P.stamps)) + P.stamps = sheet.css_tag() + P.stamps += sheet.icon_tag("stamp-cent") + P.stamps += "
This paper has been verified by the Central Command Quantum Relay.
" + var/mutable_appearance/stampoverlay = mutable_appearance('icons/obj/bureaucracy.dmi', "paper_stamp-cent") + stampoverlay.pixel_x = rand(-2, 2) + stampoverlay.pixel_y = rand(-3, 2) + + LAZYADD(P.stamped, "stamp-cent") + P.add_overlay(stampoverlay) + +/obj/machinery/photocopier/faxmachine/AltClick(mob/user) + if(IsAdminGhost(user)) + send_admin_fax(src) + +/obj/machinery/photocopier/faxmachine/examine(mob/user) + if(IsAdminGhost(user)) + .+= span_notice("You can send admin faxes via Alt-Click to this specific fax machine.") diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index a47b74e04884..477ff473ce6d 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -5,8 +5,6 @@ * lipstick wiping is in code/game/objects/items/weapons/cosmetics.dm! */ -#define PAPER_FIELD "" - /datum/langtext // A datum to describe a piece of writing that stores a language value with it. var/text = "" // The text that is written. var/datum/language/lang // the language it's written in. @@ -384,5 +382,3 @@ /obj/item/paper/crumpled/bloody icon_state = "scrap_bloodied" - -#undef PAPER_FIELD