From eca72f6c37e5c04cb8776ee5691e85da564b36ad Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 22 Jul 2024 15:53:06 +0200 Subject: [PATCH] [MIRROR] Centcom fax (#28973) * Centcom fax * Update topic.dm --------- Co-authored-by: Josh Co-authored-by: SpaceLoveSs13 <68121607+SpaceLoveSs13@users.noreply.github.com> --- _maps/map_files/generic/CentCom.dmm | 3 +-- code/__DEFINES/admin.dm | 2 ++ code/modules/admin/topic.dm | 9 +++++++++ code/modules/paperwork/fax.dm | 4 ++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/_maps/map_files/generic/CentCom.dmm b/_maps/map_files/generic/CentCom.dmm index 8039f5c170b..c9756094124 100644 --- a/_maps/map_files/generic/CentCom.dmm +++ b/_maps/map_files/generic/CentCom.dmm @@ -6936,9 +6936,8 @@ /area/centcom/tdome/observation) "Ga" = ( /obj/structure/table/reinforced, -/obj/item/book/manual/wiki/security_space_law, -/obj/item/taperecorder, /obj/effect/turf_decal/tile/neutral/fourcorners, +/obj/machinery/fax, /turf/open/floor/iron/dark, /area/centcom/central_command_areas/ferry) "Gb" = ( diff --git a/code/__DEFINES/admin.dm b/code/__DEFINES/admin.dm index a0ab44002a0..2118fafc665 100644 --- a/code/__DEFINES/admin.dm +++ b/code/__DEFINES/admin.dm @@ -76,6 +76,8 @@ #define ADMIN_LUAVIEW_CHUNK(state, log_index) "(VIEW CODE)" /// Displays "(SHOW)" in the chat, when clicked it tries to show atom(paper). First you need to set the request_state variable to TRUE for the paper. #define ADMIN_SHOW_PAPER(atom) "(SHOW)" +/// Displays "(PRINT)" in the chat, when clicked it will try to print the atom(paper) on the CentCom fax machine. +#define ADMIN_PRINT_FAX(atom, fax_name) "(PRINT)" /// Displays "(PLAY)" in the chat, when clicked it tries to play internet sounds from the request. #define ADMIN_PLAY_INTERNET(text, credit) "(PLAY)" /// Displays "(SEE Z-LEVEL LAYOUT)" in the chat, when clicked it shows the z-level layouts for the current world state. diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index dc851793775..42d51b0b349 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1764,6 +1764,15 @@ if(!paper_to_show) return paper_to_show.ui_interact(usr) + else if (href_list["print_fax"]) + if(!check_rights(R_ADMIN)) + return + + for(var/obj/machinery/fax/FAX as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/fax)) + if(!is_centcom_level(FAX.z)) + continue + + FAX.receive(locate(href_list["print_fax"]), href_list["fax_name"]) // SKYRAT EDIT ADDITION START else if(href_list["pass_opfor_candidate"]) if(!check_rights(R_ADMIN)) diff --git a/code/modules/paperwork/fax.dm b/code/modules/paperwork/fax.dm index 0be6375ed17..e8dba75a869 100644 --- a/code/modules/paperwork/fax.dm +++ b/code/modules/paperwork/fax.dm @@ -233,7 +233,7 @@ GLOBAL_VAR_INIT(nt_fax_department, pick("NT HR Department", "NT Legal Department var/list/data = list() //Record a list of all existing faxes. for(var/obj/machinery/fax/FAX as anything in SSmachines.get_machines_by_type_and_subtypes(/obj/machinery/fax)) - if(FAX.fax_id == fax_id) //skip yourself + if(FAX.fax_id == fax_id || is_centcom_level(FAX.z)) //skip yourself and the centcom fax machine. continue var/list/fax_data = list() fax_data["fax_name"] = FAX.fax_name @@ -301,7 +301,7 @@ GLOBAL_VAR_INIT(nt_fax_department, pick("NT HR Department", "NT Legal Department history_add("Send", params["name"]) GLOB.requests.fax_request(usr.client, "sent a fax message from [fax_name]/[fax_id] to [params["name"]]", fax_paper) - to_chat(GLOB.admins, span_adminnotice("[icon2html(src.icon, GLOB.admins)]FAX REQUEST: [ADMIN_FULLMONTY(usr)]: [span_linkify("sent a fax message from [fax_name]/[fax_id][ADMIN_FLW(src)] to [html_encode(params["name"])]")] [ADMIN_SHOW_PAPER(fax_paper)]"), confidential = TRUE) + to_chat(GLOB.admins, span_adminnotice("[icon2html(src.icon, GLOB.admins)]FAX REQUEST: [ADMIN_FULLMONTY(usr)]: [span_linkify("sent a fax message from [fax_name]/[fax_id][ADMIN_FLW(src)] to [html_encode(params["name"])]")] [ADMIN_SHOW_PAPER(fax_paper)] [ADMIN_PRINT_FAX(fax_paper, fax_name)]"), confidential = TRUE) for(var/client/staff as anything in GLOB.admins) if(staff?.prefs.read_preference(/datum/preference/toggle/comms_notification)) SEND_SOUND(staff, sound('sound/misc/server-ready.ogg'))