diff --git a/code/modules/admin/verbs/adminhelp.dm b/code/modules/admin/verbs/adminhelp.dm index fe782099af9..e83799af2e2 100644 --- a/code/modules/admin/verbs/adminhelp.dm +++ b/code/modules/admin/verbs/adminhelp.dm @@ -99,7 +99,8 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) var/datum/admin_help/AH = I if(AH.initiator) var/obj/effect/statclick/updated = AH.statclick.update() - L[++L.len] = list("#[AH.id]. [AH.initiator_key_name]:", "[updated.name]", REF(AH)) + //L[++L.len] = list("#[AH.id]. [AH.initiator_key_name]:", "[updated.name]", REF(AH)) //ORIGINAL + L[++L.len] = list("[AH.handler ? "H-[AH.handler]" : ""]#[AH.id]. [AH.initiator_key_name]:", "[updated.name]", REF(AH)) //SKYRAT EDIT CHANGE - ADMIN else ++num_disconnected if(num_disconnected) @@ -175,13 +176,19 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) //call this on its own to create a ticket, don't manually assign current_ticket //msg is the title of the ticket: usually the ahelp text //is_bwoink is TRUE if this ticket was started by an admin PM -/datum/admin_help/New(msg, client/C, is_bwoink) +///datum/admin_help/New(msg, client/C, is_bwoink) //ORIGINAL +/datum/admin_help/New(msg, client/C, is_bwoink, client/admin_C) //SKYRAT EDIT CHANGE - ADMIN //clean the input msg msg = sanitize(copytext_char(msg, 1, MAX_MESSAGE_LEN)) if(!msg || !C || !C.mob) qdel(src) return + //SKYRAT EDIT ADDITION BEGIN + if(admin_C && is_bwoink) + handler = "[admin_C.ckey]" + //SKYRAT EDIT END + id = ++ticket_counter opened_at = world.time @@ -248,6 +255,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) . += " (IC)" . += " (CLOSE)" . += " (RSLVE)" + . += " (HANDLE)" //SKYRAT EDIT ADDITION - ADMIN //private /datum/admin_help/proc/LinkedReplyName(ref_src) @@ -468,6 +476,10 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new) Resolve() if("reopen") Reopen() + //SKYRAT EDIT ADDITION BEING - ADMIN + if("handleissue") + HandleIssue() + //SKYRAT EDIT ADDITION END // // TICKET STATCLICK diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 200ccff0da5..89475d56f08 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -248,10 +248,22 @@ if(holder) //sender is an admin but recipient is not. Do BIG RED TEXT var/already_logged = FALSE if(!recipient.current_ticket) - new /datum/admin_help(msg, recipient, TRUE) + //new /datum/admin_help(msg, recipient, TRUE) //ORIGINAL + new /datum/admin_help(msg, recipient, TRUE, src) //SKYRAT EDIT CHANGE - ADMIN already_logged = TRUE SSblackbox.LogAhelp(recipient.current_ticket.id, "Ticket Opened", msg, recipient.ckey, src.ckey) + //SKYRAT EDIT ADDITION BEGIN - ADMIN + if(recipient.current_ticket.handler) + if(recipient.current_ticket.handler != usr.ckey) + var/response = alert(usr, "This ticket is already being handled by [recipient.current_ticket.handler]. Do you want to continue?", "Ticket already assigned", "Yes", "No") + + if(response == "No") + return + else + recipient.current_ticket.HandleIssue() + //SKYRAT EDIT ADDITION END + to_chat(recipient, type = MESSAGE_TYPE_ADMINPM, html = "-- Administrator private message --", diff --git a/modular_skyrat/modules/admin/code/admin_help.dm b/modular_skyrat/modules/admin/code/admin_help.dm new file mode 100644 index 00000000000..4aeb8674cde --- /dev/null +++ b/modular_skyrat/modules/admin/code/admin_help.dm @@ -0,0 +1,20 @@ +/datum/admin_help + var/handler + +//Let the initiator know their ahelp is being handled +/datum/admin_help/proc/HandleIssue(key_name = key_name_admin(usr)) + if(state != AHELP_ACTIVE) + return + + var/msg = "Your ticket is now being handled by [usr?.client?.holder?.fakekey? usr.client.holder.fakekey : "an administrator"]! Please wait while they type their response and/or gather relevant information." + + if(initiator) + to_chat(initiator, msg) + + SSblackbox.record_feedback("tally", "ahelp_stats", 1, "handling") + msg = "Ticket [TicketHref("#[id]")] is being handled by [key_name]" + message_admins(msg) + log_admin_private(msg) + AddInteraction("Being handled by [key_name]") + + handler = "[usr.ckey]" diff --git a/modular_skyrat/modules/admin/readme.md b/modular_skyrat/modules/admin/readme.md index 34b14177194..03e79e1c34e 100644 --- a/modular_skyrat/modules/admin/readme.md +++ b/modular_skyrat/modules/admin/readme.md @@ -12,6 +12,8 @@ Adds multuple admin features, loud asay. As well as bold/itallics/underline. - code\datums\chatmessage.dm > /datum/chatmessage/proc/generate_image - code\game\say.dm > /atom/movable/proc/compose_message +- code\modules\admin\verbs\adminhelp.dm +- code\modules\admin\verbs\adminpm.dm - code\modules\admin\admin_verbs.dm - code\modules\mob\living\emote.dm > /datum/emote/living/custom/run_emote diff --git a/tgstation.dme b/tgstation.dme index f22caae8b4b..317bc0b834e 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3268,6 +3268,7 @@ #include "modular_skyrat\master_files\code\modules\clothing\non_anthro_clothes.dm" #include "modular_skyrat\master_files\code\modules\mob\living\carbon\carbon_say.dm" #include "modular_skyrat\master_files\code\modules\power\lighting.dm" +#include "modular_skyrat\modules\admin\code\admin_help.dm" #include "modular_skyrat\modules\admin\code\loud_say.dm" #include "modular_skyrat\modules\alerts\code\config.dm" #include "modular_skyrat\modules\alerts\code\firealarm.dm"