Adds an Escape Menu (#72906)

This commit is contained in:
Mothblocks
2023-01-26 00:25:16 -08:00
committed by GitHub
parent 908bab48a0
commit 9d0cdfe909
36 changed files with 873 additions and 78 deletions
+23 -8
View File
@@ -197,6 +197,10 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
var/webhook_sent = WEBHOOK_NONE
/// List of player interactions
var/list/player_interactions
/// List of admin ckeys that are involved, like through responding
var/list/admins_involved = list()
/// Has the player replied to this ticket yet?
var/player_replied = FALSE
/**
* Call this on its own to create a ticket, don't manually assign current_ticket
@@ -274,7 +278,7 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
"PLAYERS" = player_count,
"ROUND STATE" = round_state,
"ROUND ID" = GLOB.round_id,
"ROUND TIME" = ROUND_TIME,
"ROUND TIME" = ROUND_TIME(),
"MESSAGE" = message,
"ADMINS" = admin_text,
)
@@ -346,9 +350,12 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
return ..()
/datum/admin_help/proc/AddInteraction(formatted_message, player_message)
if(heard_by_no_admins && usr && usr.ckey != initiator_ckey)
heard_by_no_admins = FALSE
send2adminchat(initiator_ckey, "Ticket #[id]: Answered by [key_name(usr)]")
if (!isnull(usr) && usr.ckey != initiator_ckey)
admins_involved |= usr.ckey
if(heard_by_no_admins)
heard_by_no_admins = FALSE
send2adminchat(initiator_ckey, "Ticket #[id]: Answered by [key_name(usr)]")
ticket_interactions += "[time_stamp()]: [formatted_message]"
if (!isnull(player_message))
player_interactions += "[time_stamp()]: [player_message]"
@@ -412,12 +419,20 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
confidential = TRUE)
//show it to the person adminhelping too
to_chat(initiator,
type = MESSAGE_TYPE_ADMINPM,
html = span_adminnotice("PM to-<b>Admins</b>: [span_linkify(msg)]"),
confidential = TRUE)
reply_to_admins_notification(msg)
SSblackbox.LogAhelp(id, "Ticket Opened", msg, null, initiator.ckey, urgent = urgent)
/// Sends a message to the player that they are replying to admins.
/datum/admin_help/proc/reply_to_admins_notification(message)
to_chat(
initiator,
type = MESSAGE_TYPE_ADMINPM,
html = span_notice("PM to-<b>Admins</b>: [span_linkify(message)]"),
confidential = TRUE,
)
player_replied = TRUE
//Reopen a closed ticket
/datum/admin_help/proc/Reopen()
if(state == AHELP_ACTIVE)
+35 -20
View File
@@ -326,13 +326,12 @@
var/name_key_with_link = key_name(src, TRUE, TRUE)
if(ambiguious_recipient == EXTERNAL_PM_USER)
to_chat(src,
type = MESSAGE_TYPE_ADMINPM,
html = span_notice("PM to-<b>Admins</b>: [span_linkify(raw_message)]"),
confidential = TRUE)
var/datum/admin_help/new_admin_help = admin_ticket_log(src,
"<font color='red'>Reply PM from-<b>[name_key_with_link]</b> to <i>External</i>: [keyword_parsed_msg]</font>",
player_message = "<font color='red'>Reply PM from-<b>[name_key_with_link]</b> to <i>External</i>: [send_message]</font>")
new_admin_help.reply_to_admins_notification(raw_message)
var/new_help_id = new_admin_help?.id
externalreplyamount--
@@ -409,10 +408,12 @@
type = MESSAGE_TYPE_ADMINPM,
html = "<font color='red' size='4'><b>-- Administrator private message --</b></font>",
confidential = TRUE)
to_chat(recipient,
type = MESSAGE_TYPE_ADMINPM,
html = span_adminsay("Admin PM from-<b>[link_to_us]</b>: [span_linkify(send_message)]"),
confidential = TRUE)
recipient.receive_ahelp(
link_to_us,
span_linkify(send_message),
)
to_chat(recipient,
type = MESSAGE_TYPE_ADMINPM,
html = span_adminsay("<i>Click on the administrator's name to reply.</i>"),
@@ -474,10 +475,12 @@
// Admin on admin violence first
if(our_holder)
to_chat(recipient,
type = MESSAGE_TYPE_ADMINPM,
html = span_danger("Admin PM from-<b>[name_key_with_link]</b>: [span_linkify(keyword_parsed_msg)]"),
confidential = TRUE)
recipient.receive_ahelp(
name_key_with_link,
span_linkify(keyword_parsed_msg),
"danger",
)
to_chat(src,
type = MESSAGE_TYPE_ADMINPM,
html = span_notice("Admin PM to-<b>[their_name_with_link]</b>: [span_linkify(keyword_parsed_msg)]"),
@@ -510,11 +513,10 @@
type = MESSAGE_TYPE_ADMINPM,
html = span_danger("[replymsg]"),
confidential = TRUE)
to_chat(src,
type = MESSAGE_TYPE_ADMINPM,
html = span_notice("PM to-<b>Admins</b>: [span_linkify(send_message)]"),
confidential = TRUE)
ticket.reply_to_admins_notification(send_message)
SSblackbox.LogAhelp(ticket_id, "Reply", send_message, recip_ckey, our_ckey)
return TRUE
/// Notifies all admins about the existance of an admin pm, then logs the pm
@@ -726,10 +728,12 @@
type = MESSAGE_TYPE_ADMINPM,
html = "<font color='red' size='4'><b>-- Administrator private message --</b></font>",
confidential = TRUE)
to_chat(recipient,
type = MESSAGE_TYPE_ADMINPM,
html = span_adminsay("Admin PM from-<b><a href='?priv_msg=[stealthkey]'>[adminname]</A></b>: [message]"),
confidential = TRUE)
recipient.receive_ahelp(
"<a href='?priv_msg=[stealthkey]'>[adminname]</a>",
message,
)
to_chat(recipient,
type = MESSAGE_TYPE_ADMINPM,
html = span_adminsay("<i>Click on the administrator's name to reply.</i>"),
@@ -775,6 +779,17 @@
return GLOB.directory[searching_ckey]
/client/proc/receive_ahelp(reply_to, message, span_class = "adminsay")
to_chat(
src,
type = MESSAGE_TYPE_ADMINPM,
html = "<span class='[span_class]'>Admin PM from-<b>[reply_to]</b>: [message]</span>",
confidential = TRUE,
)
current_ticket?.player_replied = FALSE
SEND_SIGNAL(src, COMSIG_ADMIN_HELP_RECEIVED, message)
#undef EXTERNAL_PM_USER
#undef EXTERNALREPLYCOUNT