mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-29 15:08:34 +01:00
Merge branch 'master' of https://github.com/VOREStation/VOREStation into upstream-merge-8298
This commit is contained in:
@@ -87,7 +87,7 @@
|
||||
to_chat(usr, "<span class='info'>There isn't enough space left on \the [src] to write anything.</span>")
|
||||
return
|
||||
|
||||
var/raw_t = tgui_input_message(usr, "Enter what you want to write:", "Write")
|
||||
var/raw_t = tgui_input_text(usr, "Enter what you want to write:", "Write", multiline = TRUE, prevent_enter = TRUE)
|
||||
if(!raw_t)
|
||||
return
|
||||
var/t = sanitize(raw_t, free_space, extra = 0)
|
||||
@@ -158,4 +158,4 @@
|
||||
return
|
||||
|
||||
/obj/item/weapon/paper/admin/get_signature()
|
||||
return input(usr, "Enter the name you wish to sign the paper with (will prompt for multiple entries, in order of entry)", "Signature") as text|null
|
||||
return tgui_input_text(usr, "Enter the name you wish to sign the paper with (will prompt for multiple entries, in order of entry)", "Signature")
|
||||
|
||||
@@ -133,7 +133,7 @@ var/list/adminfaxes = list() //cache for faxes that have been sent to admins
|
||||
|
||||
/obj/machinery/photocopier/faxmachine/attackby(obj/item/O as obj, mob/user as mob)
|
||||
if(O.is_multitool() && panel_open)
|
||||
var/input = sanitize(input(usr, "What Department ID would you like to give this fax machine?", "Multitool-Fax Machine Interface", department))
|
||||
var/input = sanitize(tgui_input_text(usr, "What Department ID would you like to give this fax machine?", "Multitool-Fax Machine Interface", department))
|
||||
if(!input)
|
||||
to_chat(usr, "No input found. Please hang up and try your call again.")
|
||||
return
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
var/global/last_fax_role_request
|
||||
|
||||
/obj/machinery/photocopier/faxmachine
|
||||
req_one_access = list()
|
||||
|
||||
@@ -47,6 +49,20 @@
|
||||
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.
|
||||
@@ -55,3 +71,84 @@
|
||||
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, "<span class='warning'>The global automated relays are still recalibrating. Try again later or relay your request in written form for processing.</span>")
|
||||
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, "<span class='warning'>Selected job cannot be requested for \[ERRORDEPTNOTFOUND] reason. Please report this to system administrator.</span>")
|
||||
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, "<span class='warning'>Selected job cannot be requested for \[ERRORUNKNOWNDEPT] reason. Please report this to system administrator.</span>")
|
||||
return
|
||||
message_color = ping_dept.color
|
||||
|
||||
message_chat_rolerequest(message_color, ping_name, reason, role)
|
||||
last_fax_role_request = world.time
|
||||
to_chat(L, "<span class='notice'>Your request was transmitted.</span>")
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
to_chat(user, "<span class='notice'>You put the [W] into \the [src].</span>")
|
||||
update_icon()
|
||||
else if(istype(W, /obj/item/weapon/pen))
|
||||
var/n_name = sanitizeSafe(input(usr, "What would you like to label the folder?", "Folder Labelling", null) as text, MAX_NAME_LEN)
|
||||
var/n_name = sanitizeSafe(tgui_input_text(usr, "What would you like to label the folder?", "Folder Labelling", null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if((loc == usr && usr.stat == 0))
|
||||
name = "folder[(n_name ? text("- '[n_name]'") : null)]"
|
||||
return
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
if(mode)
|
||||
to_chat(user, SPAN_NOTICE("You turn on \the [src]."))
|
||||
//Now let them chose the text.
|
||||
var/str = sanitizeSafe(input(user,"Label text?","Set label",""), MAX_NAME_LEN)
|
||||
var/str = sanitizeSafe(tgui_input_text(user,"Label text?","Set label","",MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if(!str || !length(str))
|
||||
to_chat(user, SPAN_WARNING("Invalid text."))
|
||||
return
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
if((CLUMSY in usr.mutations) && prob(50))
|
||||
to_chat(usr, "<span class='warning'>You cut yourself on the paper.</span>")
|
||||
return
|
||||
var/n_name = sanitizeSafe(input(usr, "What would you like to label the paper?", "Paper Labelling", null) as text, MAX_NAME_LEN)
|
||||
var/n_name = sanitizeSafe(tgui_input_text(usr, "What would you like to label the paper?", "Paper Labelling", null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
|
||||
// We check loc one level up, so we can rename in clipboards and such. See also: /obj/item/weapon/photo/rename()
|
||||
if((loc == usr || loc.loc && loc.loc == usr) && usr.stat == 0 && n_name)
|
||||
@@ -422,7 +422,7 @@
|
||||
to_chat(usr, "<span class='info'>There isn't enough space left on \the [src] to write anything.</span>")
|
||||
return
|
||||
|
||||
var/raw = input(usr, "Enter what you want to write:", "Write") as null|message
|
||||
var/raw = tgui_input_text(usr, "Enter what you want to write:", "Write", multiline = TRUE, prevent_enter = TRUE)
|
||||
if(!raw)
|
||||
return
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
var/n_name = sanitizeSafe(input(usr, "What would you like to label the bundle?", "Bundle Labelling", null) as text, MAX_NAME_LEN)
|
||||
var/n_name = sanitizeSafe(tgui_input_text(usr, "What would you like to label the bundle?", "Bundle Labelling", null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
if((loc == usr || loc.loc && loc.loc == usr) && usr.stat == 0)
|
||||
name = "[(n_name ? text("[n_name]") : "paper")]"
|
||||
add_fingerprint(usr)
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
if(writing_space <= 0)
|
||||
to_chat(user, SPAN_WARNING("There is no room left on \the [src]."))
|
||||
return
|
||||
var/text = sanitizeSafe(input(usr, "What would you like to write?") as text, writing_space)
|
||||
var/text = sanitizeSafe(tgui_input_text(usr, "What would you like to write?", null, null, writing_space), writing_space)
|
||||
if(!text || thing.loc != user || (!Adjacent(user) && loc != user) || user.incapacitated())
|
||||
return
|
||||
user.visible_message("<b>\The [user]</b> jots a note down on \the [src].")
|
||||
|
||||
@@ -282,7 +282,7 @@
|
||||
if(new_signature)
|
||||
signature = new_signature
|
||||
*/
|
||||
signature = sanitize(input(usr, "Enter new signature. Leave blank for 'Anonymous'", "New Signature", signature))
|
||||
signature = sanitize(tgui_input_text(usr, "Enter new signature. Leave blank for 'Anonymous'", "New Signature", signature))
|
||||
|
||||
/obj/item/weapon/pen/proc/get_signature(var/mob/user)
|
||||
return (user && user.real_name) ? user.real_name : "Anonymous"
|
||||
|
||||
@@ -384,5 +384,6 @@
|
||||
|
||||
/obj/item/device/toner
|
||||
name = "toner cartridge"
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "tonercartridge"
|
||||
var/toner_amount = 30
|
||||
|
||||
@@ -46,7 +46,7 @@ var/global/photo_count = 0
|
||||
|
||||
/obj/item/weapon/photo/attackby(obj/item/weapon/P as obj, mob/user as mob)
|
||||
if(istype(P, /obj/item/weapon/pen))
|
||||
var/txt = sanitize(input(user, "What would you like to write on the back?", "Photo Writing", null) as text, 128)
|
||||
var/txt = sanitize(tgui_input_text(user, "What would you like to write on the back?", "Photo Writing", null, 128), 128)
|
||||
if(loc == user && user.stat == 0)
|
||||
scribble = txt
|
||||
..()
|
||||
@@ -74,7 +74,7 @@ var/global/photo_count = 0
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
var/n_name = sanitizeSafe(input(usr, "What would you like to label the photo?", "Photo Labelling", null) as text, MAX_NAME_LEN)
|
||||
var/n_name = sanitizeSafe(tgui_input_text(usr, "What would you like to label the photo?", "Photo Labelling", null, MAX_NAME_LEN), MAX_NAME_LEN)
|
||||
//loc.loc check is for making possible renaming photos in clipboards
|
||||
if(( (loc == usr || (loc.loc && loc.loc == usr)) && usr.stat == 0))
|
||||
name = "[(n_name ? text("[n_name]") : "photo")]"
|
||||
|
||||
Reference in New Issue
Block a user