Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion code/__DEFINES/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@
#define SIGNFONT "Times New Roman"
#define CHARCOAL_FONT "Candara"

#define PAPER_FIELD "<span class=\"paper_field\"></span>"


#define RESIZE_DEFAULT_SIZE 1

Expand Down Expand Up @@ -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"
#define ui_sunlight_display "WEST:6,CENTER-0:0"
1 change: 1 addition & 0 deletions code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
89 changes: 46 additions & 43 deletions code/modules/admin/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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 <br> 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 = "<center><b>NanoTrasen Fax Network</b></center><hr><center>RE: [inputsubject]</center><hr>[inputmessage]<hr><b>Signed:</b> <i>[inputsigned]</i>"
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 = "<center><b>NanoTrasen Fax Network</b></center><hr><center>RE: [inputsubject]</center><hr>"
var/suffix = "<hr><b>Signed:</b> <font face=\"[SIGNFONT]\"><i>[inputsigned]</i></font>"

// 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]<font face=\"Verdana\" color=black>[inputmessage]</font>[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 += "<HR><i>This paper has been stamped by the Central Command Quantum Relay.</i>"
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))
Expand Down
61 changes: 47 additions & 14 deletions code/modules/paperwork/faxmachine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -54,7 +53,8 @@ GLOBAL_LIST_EMPTY(adminfaxes)
if(!copier_empty())
if(sendcooldown - world.time > 0)
to_chat(usr, "<span class='warning'>Transmitter recharging</span>")
return
return
sendcooldown = world.time + 1 MINUTES
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we really should start using the COOLDOWN system for these

if (destination in GLOB.admin_departments)
INVOKE_ASYNC(src, .proc/send_admin_fax, usr, destination)
else
Expand Down Expand Up @@ -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.\"")

Expand All @@ -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))
Expand All @@ -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
Expand Down Expand Up @@ -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 = "<b><font color='[font_colour]'>[faxname]: </font>[key_name(sender, 1)] (<A HREF='?_src_=holder;[HrefToken()];adminplayeropts=\ref[sender]'>PP</A>) (<A HREF='?_src_=vars;[HrefToken()];Vars=\ref[sender]'>VV</A>) (<A HREF='?_src_=holder;[HrefToken()];subtlemessage=\ref[sender]'>SM</A>) (<A HREF='?_src_=holder;[HrefToken()];adminplayerobservefollow=\ref[sender]'>JMP</A>) (<a href='?_src_=holder;[HrefToken()];[reply_type]=\ref[sender];originfax=\ref[src]'>REPLY</a>)</b>: Receiving '[sent.name]' via secure connection ... <a href='?_src_=holder;[HrefToken()];AdminFaxView=\ref[sent]'>view message</a>"
var/msg = "<b><font color='[font_colour]'>[faxname]: </font>[key_name(sender, 1)] (<A HREF='?_src_=holder;[HrefToken(TRUE)];adminplayeropts=\ref[sender]'>PP</A>) (<A HREF='?_src_=vars;[HrefToken(TRUE)];Vars=\ref[sender]'>VV</A>) (<A HREF='?_src_=holder;[HrefToken(TRUE)];subtlemessage=\ref[sender]'>SM</A>) (<A HREF='?_src_=holder;[HrefToken(TRUE)];adminplayerobservefollow=\ref[sender]'>JMP</A>) (<a href='?_src_=holder;[HrefToken(TRUE)];[reply_type]=\ref[sender];originfax=\ref[src]'>REPLY</a>)</b>: Receiving '[sent.name]' via secure connection ... <a href='?_src_=holder;[HrefToken(TRUE)];AdminFaxView=\ref[sent]'>view message</a>"
msg = span_admin("<span class=\"message linkify\">[msg]</span>")
to_chat(GLOB.admins,
type = MESSAGE_TYPE_ADMINLOG,
Expand All @@ -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 += "<br><i>This paper has been verified by the Central Command Quantum Relay.</i><br>"
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.")
4 changes: 0 additions & 4 deletions code/modules/paperwork/paper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* lipstick wiping is in code/game/objects/items/weapons/cosmetics.dm!
*/

#define PAPER_FIELD "<span class=\"paper_field\"></span>"

/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.
Expand Down Expand Up @@ -384,5 +382,3 @@
/obj/item/paper/crumpled/bloody
icon_state = "scrap_bloodied"


#undef PAPER_FIELD