diff --git a/code/modules/paperwork/faxmachine.dm b/code/modules/paperwork/faxmachine.dm
index c0811a4575..009ba71997 100644
--- a/code/modules/paperwork/faxmachine.dm
+++ b/code/modules/paperwork/faxmachine.dm
@@ -1,16 +1,17 @@
var/list/obj/machinery/photocopier/faxmachine/allfaxes = list()
-var/list/admin_departments = list("[using_map.boss_name]", "Virgo-Prime Governmental Authority", "Virgo-Erigonne Job Boards", "Supply") // Vorestation Edit
+var/list/admin_departments = list("[using_map.boss_name]", "Virgo-Prime Governmental Authority", "Virgo-Erigonne Job Boards", "Supply")
var/list/alldepartments = list()
+var/global/last_fax_role_request
var/list/adminfaxes = list() //cache for faxes that have been sent to admins
/obj/machinery/photocopier/faxmachine
name = "fax machine"
- desc = "Sent papers and pictures far away! Or to your co-worker's office a few doors down."
+ desc = "Send papers and pictures far away! Or to your co-worker's office a few doors down."
icon = 'icons/obj/library.dmi'
icon_state = "fax"
insert_anim = "faxsend"
- req_one_access = list(access_lawyer, access_heads, access_armory, access_qm)
+ req_one_access = list()
use_power = USE_POWER_IDLE
idle_power_usage = 30
@@ -37,6 +38,86 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins
tgui_interact(user)
+/obj/machinery/photocopier/faxmachine/verb/request_roles()
+ set name = "Staff Request Form"
+ set category = "Object"
+ set src in oview(1)
+
+ var/mob/living/L = usr
+
+ if(!L || !isturf(L.loc) || !isliving(L))
+ return
+ if(!ishuman(L) && !issilicon(L))
+ return
+ if(L.stat || L.restrained())
+ return
+ if(last_fax_role_request && (world.time - last_fax_role_request < 5 MINUTES))
+ to_chat(L, "The global automated relays are still recalibrating. Try again later or relay your request in written form for processing.")
+ return
+
+ var/confirmation = tgui_alert(L, "Are you sure you want to send automated crew request?", "Confirmation", list("Yes", "No", "Cancel"))
+ if(confirmation != "Yes")
+ return
+
+ var/list/jobs = list()
+ for(var/datum/department/dept as anything in SSjob.get_all_department_datums())
+ if(!dept.assignable || dept.centcom_only)
+ continue
+ for(var/job in SSjob.get_job_titles_in_department(dept.name))
+ var/datum/job/J = SSjob.get_job(job)
+ if(J.requestable)
+ jobs |= job
+
+ var/role = tgui_input_list(L, "Pick the job to request.", "Job Request", jobs)
+ if(!role)
+ return
+
+ var/datum/job/job_to_request = SSjob.get_job(role)
+ var/reason = "Unspecified"
+ var/list/possible_reasons = list("Unspecified", "General duties", "Emergency situation")
+ possible_reasons += job_to_request.get_request_reasons()
+ reason = tgui_input_list(L, "Pick request reason.", "Request reason", possible_reasons)
+
+ var/final_conf = tgui_alert(L, "You are about to request [role]. Are you sure?", "Confirmation", list("Yes", "No", "Cancel"))
+ if(final_conf != "Yes")
+ return
+
+ var/datum/department/ping_dept = SSjob.get_ping_role(role)
+ if(!ping_dept)
+ to_chat(L, "Selected job cannot be requested for \[ERRORDEPTNOTFOUND] reason. Please report this to system administrator.")
+ return
+ var/message_color = "#FFFFFF"
+ var/ping_name = null
+ switch(ping_dept.name)
+ if(DEPARTMENT_COMMAND)
+ ping_name = "Command"
+ if(DEPARTMENT_SECURITY)
+ ping_name = "Security"
+ if(DEPARTMENT_ENGINEERING)
+ ping_name = "Engineering"
+ if(DEPARTMENT_MEDICAL)
+ ping_name = "Medical"
+ if(DEPARTMENT_RESEARCH)
+ ping_name = "Research"
+ if(DEPARTMENT_CARGO)
+ ping_name = "Supply"
+ if(DEPARTMENT_CIVILIAN)
+ ping_name = "Service"
+ if(DEPARTMENT_PLANET)
+ ping_name = "Expedition"
+ if(DEPARTMENT_SYNTHETIC)
+ ping_name = "Silicon"
+ //if(DEPARTMENT_TALON)
+ // ping_name = "Offmap"
+ if(!ping_name)
+ to_chat(L, "Selected job cannot be requested for \[ERRORUNKNOWNDEPT] reason. Please report this to system administrator.")
+ return
+ message_color = ping_dept.color
+
+ message_chat_rolerequest(message_color, ping_name, reason, role)
+ last_fax_role_request = world.time
+ to_chat(L, "Your request was transmitted.")
+
/obj/machinery/photocopier/faxmachine/tgui_interact(mob/user, datum/tgui/ui)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
@@ -216,8 +297,8 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins
// Sadly, we can't use a switch statement here due to not using a constant value for the current map's centcom name.
if(destination == using_map.boss_name)
message_admins(sender, "[uppertext(using_map.boss_short)] FAX", rcvdcopy, "CentComFaxReply", "#006100")
- else if(destination == "Virgo-Prime Governmental Authority") // Vorestation Edit
- message_admins(sender, "VIRGO GOVERNMENT FAX", rcvdcopy, "CentComFaxReply", "#1F66A0") // Vorestation Edit
+ else if(destination == "Virgo-Prime Governmental Authority")
+ message_admins(sender, "VIRGO GOVERNMENT FAX", rcvdcopy, "CentComFaxReply", "#1F66A0")
else if(destination == "Supply")
message_admins(sender, "[uppertext(using_map.boss_short)] SUPPLY FAX", rcvdcopy, "CentComFaxReply", "#5F4519")
else
@@ -253,10 +334,8 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins
to_chat(C,msg)
C << 'sound/machines/printer.ogg'
- // VoreStation Edit Start
var/faxid = export_fax(sent)
- message_chat_admins(sender, faxname, sent, faxid, font_colour)
- // VoreStation Edit End
+ message_chat_admins(sender, faxname, sent, faxid, font_colour) //Sends to admin chat
// Webhooks don't parse the HTML on the paper, so we gotta strip them out so it's still readable.
var/summary = make_summary(sent)
@@ -277,3 +356,80 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins
"body" = summary
)
)
+
+/*
+ ##### ####
+ ##### Webhook Functionality ####
+ ##### ####
+*/
+
+/datum/configuration
+ var/chat_webhook_url = "" // URL of the webhook for sending announcements/faxes to discord chat.
+ var/chat_webhook_key = "" // Shared secret for authenticating to the chat webhook
+ var/fax_export_dir = "data/faxes" // Directory in which to write exported fax HTML files.
+
+
+/**
+ * Write the fax to disk as (potentially multiple) HTML files.
+ * If the fax is a paper_bundle, do so recursively for each page.
+ * returns a random unique faxid.
+ */
+/obj/machinery/photocopier/faxmachine/proc/export_fax(fax)
+ var faxid = "[num2text(world.realtime,12)]_[rand(10000)]"
+ if (istype(fax, /obj/item/weapon/paper))
+ var/obj/item/weapon/paper/P = fax
+ var/text = "
[P.name][P.info][P.stamps]";
+ file("[config.fax_export_dir]/fax_[faxid].html") << text;
+ else if (istype(fax, /obj/item/weapon/photo))
+ var/obj/item/weapon/photo/H = fax
+ fcopy(H.img, "[config.fax_export_dir]/photo_[faxid].png")
+ var/text = "[H.name]" \
+ + "" \
+ + "
" \
+ + "[H.scribble ? "
Written on the back:
[H.scribble]" : ""]"\
+ + ""
+ file("[config.fax_export_dir]/fax_[faxid].html") << text
+ else if (istype(fax, /obj/item/weapon/paper_bundle))
+ var/obj/item/weapon/paper_bundle/B = fax
+ var/data = ""
+ for (var/page = 1, page <= B.pages.len, page++)
+ var/obj/pageobj = B.pages[page]
+ var/page_faxid = export_fax(pageobj)
+ data += "Page [page] - [pageobj.name]
"
+ var/text = "[B.name][data]"
+ file("[config.fax_export_dir]/fax_[faxid].html") << text
+ return faxid
+
+
+
+/**
+ * Call the chat webhook to transmit a notification of an admin fax to the admin chat.
+ */
+/obj/machinery/photocopier/faxmachine/proc/message_chat_admins(var/mob/sender, var/faxname, var/obj/item/sent, var/faxid, font_colour="#006100")
+ if (config.chat_webhook_url)
+ spawn(0)
+ var/query_string = "type=fax"
+ query_string += "&key=[url_encode(config.chat_webhook_key)]"
+ query_string += "&faxid=[url_encode(faxid)]"
+ query_string += "&color=[url_encode(font_colour)]"
+ query_string += "&faxname=[url_encode(faxname)]"
+ query_string += "&sendername=[url_encode(sender.name)]"
+ query_string += "&sentname=[url_encode(sent.name)]"
+ world.Export("[config.chat_webhook_url]?[query_string]")
+
+
+
+
+/**
+ * Call the chat webhook to transmit a notification of a job request
+ */
+/obj/machinery/photocopier/faxmachine/proc/message_chat_rolerequest(var/font_colour="#006100", var/role_to_ping, var/reason, var/jobname)
+ if(config.chat_webhook_url)
+ spawn(0)
+ var/query_string = "type=rolerequest"
+ query_string += "&key=[url_encode(config.chat_webhook_key)]"
+ query_string += "&ping=[url_encode(role_to_ping)]"
+ query_string += "&color=[url_encode(font_colour)]"
+ query_string += "&reason=[url_encode(reason)]"
+ query_string += "&job=[url_encode(jobname)]"
+ world.Export("[config.chat_webhook_url]?[query_string]")
diff --git a/code/modules/paperwork/faxmachine_vr.dm b/code/modules/paperwork/faxmachine_vr.dm
deleted file mode 100644
index 078a17403f..0000000000
--- a/code/modules/paperwork/faxmachine_vr.dm
+++ /dev/null
@@ -1,154 +0,0 @@
-var/global/last_fax_role_request
-
-/obj/machinery/photocopier/faxmachine
- req_one_access = list()
-
-/**
- * Write the fax to disk as (potentially multiple) HTML files.
- * If the fax is a paper_bundle, do so recursively for each page.
- * returns a random unique faxid.
- */
-/obj/machinery/photocopier/faxmachine/proc/export_fax(fax)
- var faxid = "[num2text(world.realtime,12)]_[rand(10000)]"
- if (istype(fax, /obj/item/weapon/paper))
- var/obj/item/weapon/paper/P = fax
- var/text = "[P.name][P.info][P.stamps]";
- file("[config.fax_export_dir]/fax_[faxid].html") << text;
- else if (istype(fax, /obj/item/weapon/photo))
- var/obj/item/weapon/photo/H = fax
- fcopy(H.img, "[config.fax_export_dir]/photo_[faxid].png")
- var/text = "[H.name]" \
- + "" \
- + "
" \
- + "[H.scribble ? "
Written on the back:
[H.scribble]" : ""]"\
- + ""
- file("[config.fax_export_dir]/fax_[faxid].html") << text
- else if (istype(fax, /obj/item/weapon/paper_bundle))
- var/obj/item/weapon/paper_bundle/B = fax
- var/data = ""
- for (var/page = 1, page <= B.pages.len, page++)
- var/obj/pageobj = B.pages[page]
- var/page_faxid = export_fax(pageobj)
- data += "Page [page] - [pageobj.name]
"
- var/text = "[B.name][data]"
- file("[config.fax_export_dir]/fax_[faxid].html") << text
- return faxid
-
-/**
- * Call the chat webhook to transmit a notification of an admin fax to the admin chat.
- */
-/obj/machinery/photocopier/faxmachine/proc/message_chat_admins(var/mob/sender, var/faxname, var/obj/item/sent, var/faxid, font_colour="#006100")
- if (config.chat_webhook_url)
- spawn(0)
- var/query_string = "type=fax"
- query_string += "&key=[url_encode(config.chat_webhook_key)]"
- query_string += "&faxid=[url_encode(faxid)]"
- query_string += "&color=[url_encode(font_colour)]"
- query_string += "&faxname=[url_encode(faxname)]"
- query_string += "&sendername=[url_encode(sender.name)]"
- query_string += "&sentname=[url_encode(sent.name)]"
- world.Export("[config.chat_webhook_url]?[query_string]")
-
-/**
- * Call the chat webhook to transmit a notification of a job request
- */
-/obj/machinery/photocopier/faxmachine/proc/message_chat_rolerequest(var/font_colour="#006100", var/role_to_ping, var/reason, var/jobname)
- if(config.chat_webhook_url)
- spawn(0)
- var/query_string = "type=rolerequest"
- query_string += "&key=[url_encode(config.chat_webhook_key)]"
- query_string += "&ping=[url_encode(role_to_ping)]"
- query_string += "&color=[url_encode(font_colour)]"
- query_string += "&reason=[url_encode(reason)]"
- query_string += "&job=[url_encode(jobname)]"
- world.Export("[config.chat_webhook_url]?[query_string]")
-
-//
-// Overrides/additions to stock defines go here, as well as hooks. Sort them by
-// the object they are overriding. So all /mob/living together, etc.
-//
-/datum/configuration
- var/chat_webhook_url = "" // URL of the webhook for sending announcements/faxes to discord chat.
- var/chat_webhook_key = "" // Shared secret for authenticating to the chat webhook
- var/fax_export_dir = "data/faxes" // Directory in which to write exported fax HTML files.
-
-
-/obj/machinery/photocopier/faxmachine/verb/request_roles()
- set name = "Staff Request Form"
- set category = "Object"
- set src in oview(1)
-
- var/mob/living/L = usr
-
- if(!L || !isturf(L.loc) || !isliving(L))
- return
- if(!ishuman(L) && !issilicon(L))
- return
- if(L.stat || L.restrained())
- return
- if(last_fax_role_request && (world.time - last_fax_role_request < 5 MINUTES))
- to_chat(L, "The global automated relays are still recalibrating. Try again later or relay your request in written form for processing.")
- return
-
- var/confirmation = tgui_alert(L, "Are you sure you want to send automated crew request?", "Confirmation", list("Yes", "No", "Cancel"))
- if(confirmation != "Yes")
- return
-
- var/list/jobs = list()
- for(var/datum/department/dept as anything in SSjob.get_all_department_datums())
- if(!dept.assignable || dept.centcom_only)
- continue
- for(var/job in SSjob.get_job_titles_in_department(dept.name))
- var/datum/job/J = SSjob.get_job(job)
- if(J.requestable)
- jobs |= job
-
- var/role = tgui_input_list(L, "Pick the job to request.", "Job Request", jobs)
- if(!role)
- return
-
- var/datum/job/job_to_request = SSjob.get_job(role)
- var/reason = "Unspecified"
- var/list/possible_reasons = list("Unspecified", "General duties", "Emergency situation")
- possible_reasons += job_to_request.get_request_reasons()
- reason = tgui_input_list(L, "Pick request reason.", "Request reason", possible_reasons)
-
- var/final_conf = tgui_alert(L, "You are about to request [role]. Are you sure?", "Confirmation", list("Yes", "No", "Cancel"))
- if(final_conf != "Yes")
- return
-
- var/datum/department/ping_dept = SSjob.get_ping_role(role)
- if(!ping_dept)
- to_chat(L, "Selected job cannot be requested for \[ERRORDEPTNOTFOUND] reason. Please report this to system administrator.")
- return
- var/message_color = "#FFFFFF"
- var/ping_name = null
- switch(ping_dept.name)
- if(DEPARTMENT_COMMAND)
- ping_name = "Command"
- if(DEPARTMENT_SECURITY)
- ping_name = "Security"
- if(DEPARTMENT_ENGINEERING)
- ping_name = "Engineering"
- if(DEPARTMENT_MEDICAL)
- ping_name = "Medical"
- if(DEPARTMENT_RESEARCH)
- ping_name = "Research"
- if(DEPARTMENT_CARGO)
- ping_name = "Supply"
- if(DEPARTMENT_CIVILIAN)
- ping_name = "Service"
- if(DEPARTMENT_PLANET)
- ping_name = "Expedition"
- if(DEPARTMENT_SYNTHETIC)
- ping_name = "Silicon"
- //if(DEPARTMENT_TALON)
- // ping_name = "Offmap"
- if(!ping_name)
- to_chat(L, "Selected job cannot be requested for \[ERRORUNKNOWNDEPT] reason. Please report this to system administrator.")
- return
- message_color = ping_dept.color
-
- message_chat_rolerequest(message_color, ping_name, reason, role)
- last_fax_role_request = world.time
- to_chat(L, "Your request was transmitted.")
diff --git a/vorestation.dme b/vorestation.dme
index 6ca8007f23..9adb998e3a 100644
--- a/vorestation.dme
+++ b/vorestation.dme
@@ -3469,7 +3469,6 @@
#include "code\modules\paperwork\carbonpaper.dm"
#include "code\modules\paperwork\clipboard.dm"
#include "code\modules\paperwork\faxmachine.dm"
-#include "code\modules\paperwork\faxmachine_vr.dm"
#include "code\modules\paperwork\filingcabinet.dm"
#include "code\modules\paperwork\folders.dm"
#include "code\modules\paperwork\handlabeler.dm"