[MANUAL MIRROR] Adds an Escape Menu (#19217)

* Adds an Escape Menu (#72906)

* suicide

---------

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
This commit is contained in:
lessthanthree
2023-02-08 02:20:09 +00:00
committed by GitHub
co-authored by Mothblocks
parent a74a354ebc
commit 12d989be4c
37 changed files with 883 additions and 80 deletions
+23 -8
View File
@@ -202,6 +202,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
//SKYRAT EDIT START
/// Have we requested this ticket to stop being part of the Ticket Ping subsystem?
@@ -294,7 +298,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,
)
@@ -366,9 +370,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]"
@@ -434,12 +441,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>"),
@@ -480,10 +481,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)]"),
@@ -516,11 +519,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
@@ -732,10 +734,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>"),
@@ -781,6 +785,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