Give admins the ability to put a popup notice for players in tickets (#61010)

Admins can now give players a popup if they are not responding to tickets.
Popup is cleared when player replies or ticket is resolved/closed.
As more and more of the chat screen is made irrelevant, new players read it less and less.
This means that a lot of new players are ignoring ahelps, which is something I've encountered myself.
This commit is contained in:
Mothblocks
2021-08-29 21:11:38 -03:00
committed by GitHub
parent 8d47ed2d82
commit 0990a8ddcf
9 changed files with 164 additions and 19 deletions
+16
View File
@@ -1055,6 +1055,22 @@
to_chat(H, span_adminnotice("Your prayers have been answered!! You received the <b>best [new_item.name]!</b>"), confidential = TRUE)
SEND_SOUND(H, sound('sound/effects/pray_chaplain.ogg'))
else if (href_list["adminpopup"])
if (!check_rights(R_ADMIN))
return
var/message = input(owner, "As well as a popup, they'll also be sent a message to reply to. What do you want that to be?", "Message") as text|null
if (!message)
to_chat(owner, span_notice("Popup cancelled."))
return
var/client/target = locate(href_list["adminpopup"])
if (!istype(target))
to_chat(owner, span_notice("The mob doesn't exist anymore!"))
return
give_admin_popup(target, owner, message)
else if(href_list["adminsmite"])
if(!check_rights(R_ADMIN|R_FUN))
return
+5
View File
@@ -254,6 +254,9 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
if(state == AHELP_ACTIVE)
. += ClosureLinks(ref_src)
if (CONFIG_GET(flag/popup_admin_pm))
. += " (<A HREF='?_src_=holder;[HrefToken(TRUE)];adminpopup=[REF(initiator)]'>POPUP</A>)"
//private
/datum/admin_help/proc/ClosureLinks(ref_src)
if(!ref_src)
@@ -345,6 +348,8 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
if(initiator && initiator.current_ticket == src)
initiator.current_ticket = null
SEND_SIGNAL(src, COMSIG_ADMIN_HELP_MADE_INACTIVE)
//Mark open ticket as closed/meme
/datum/admin_help/proc/Close(key_name = key_name_admin(usr), silent = FALSE)
if(state != AHELP_ACTIVE)
+2 -15
View File
@@ -212,6 +212,8 @@
if(holder && recipient.holder && !current_ticket) //Both are admins, and this is not a reply to our own ticket.
badmin = TRUE
if(recipient.holder && !badmin)
SEND_SIGNAL(current_ticket, COMSIG_ADMIN_HELP_REPLIED)
if(holder)
to_chat(recipient,
type = MESSAGE_TYPE_ADMINPM,
@@ -243,7 +245,6 @@
//play the receiving admin the adminhelp sound (if they have them enabled)
if(recipient.prefs.toggles & SOUND_ADMINHELP)
SEND_SOUND(recipient, sound('sound/effects/adminhelp.ogg'))
else
if(holder) //sender is an admin but recipient is not. Do BIG RED TEXT
var/already_logged = FALSE
@@ -277,10 +278,6 @@
//always play non-admin recipients the adminhelp sound
SEND_SOUND(recipient, sound('sound/effects/adminhelp.ogg'))
//AdminPM popup for ApocStation and anybody else who wants to use it. Set it with POPUP_ADMIN_PM in config.txt ~Carn
if(CONFIG_GET(flag/popup_admin_pm))
INVOKE_ASYNC(src, .proc/popup_admin_pm, recipient, msg)
else //neither are admins
if(!current_ticket)
to_chat(src,
@@ -312,16 +309,6 @@
html = span_notice("<B>PM: [key_name(src, X, 0)]-&gt;[key_name(recipient, X, 0)]:</B> [keywordparsedmsg]") ,
confidential = TRUE)
/client/proc/popup_admin_pm(client/recipient, msg)
var/sender = src
var/sendername = key
var/reply = input(recipient, msg,"Admin PM from-[sendername]", "") as message|null //show message and await a reply
if(recipient && reply)
if(sender)
recipient.cmd_admin_pm(sender,reply) //sender is still about, let's reply to them
else
adminhelp(reply) //sender has left, adminhelp instead
#define TGS_AHELP_USAGE "Usage: ticket <close|resolve|icissue|reject|reopen \[ticket #\]|list>"
/proc/TgsPm(target,msg,sender)
target = ckey(target)