Skip to content

Commit

Permalink
Unmarked admin tickets are automatically marked when responding to one (
Browse files Browse the repository at this point in the history
#6167)

# About the pull request
If a ticket is unmarked and you start responding to it, it automatically
marks itself for you.

# Explain why it's good for the game
This is something that's bugged me for a while, and it's always tripped
me up when responding to tickets. One should reason that a ticket you're
responding to is being handled by you.
# Changelog
:cl:
admin: Unmarked tickets now mark themselves when an admin starts
responding to one
/:cl:
  • Loading branch information
Zonespace27 authored Apr 21, 2024
1 parent 96fdf71 commit 8f9c8e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 8 additions & 7 deletions code/modules/admin/verbs/adminhelp.dm
Original file line number Diff line number Diff line change
Expand Up @@ -543,27 +543,28 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
log_ahelp(id, "Defer", "Deferred to mentors by [usr.key]", null, usr.ckey)
Close(silent = TRUE)

/datum/admin_help/proc/mark_ticket()
/datum/admin_help/proc/mark_ticket(mob/marking_admin)
var/mob/user = marking_admin || usr
if(marked_admin)
if(marked_admin == usr.ckey)
if(marked_admin == user.ckey)
unmark_ticket()
return
to_chat(usr, SPAN_WARNING("This ticket has already been marked by [marked_admin]."))
var/unmark_option = tgui_alert(usr, "This message has been marked by [marked_admin]. Do you want to override?", "Marked Ticket", list("Overwrite Mark", "Unmark", "Cancel"))
to_chat(user, SPAN_WARNING("This ticket has already been marked by [marked_admin]."))
var/unmark_option = tgui_alert(user, "This message has been marked by [marked_admin]. Do you want to override?", "Marked Ticket", list("Overwrite Mark", "Unmark", "Cancel"))
if(unmark_option == "Unmark")
unmark_ticket()
return
if(unmark_option != "Overwrite Mark")
return

var/key_name = key_name_admin(usr)
var/key_name = key_name_admin(user)
AddInteraction("Marked by [key_name].", player_message = "Ticket marked!")
to_chat(initiator, SPAN_ADMINHELP("An admin is preparing to respond to your ticket."))
var/msg = "Ticket [TicketHref("#[id]")] marked by [key_name]."
message_admins(msg)
log_admin_private(msg)
log_ahelp(id, "Marked", "Marked by [usr.key]", sender = usr.ckey)
marked_admin = usr.ckey
log_ahelp(id, "Marked", "Marked by [user.key]", sender = user.ckey)
marked_admin = user.ckey

/datum/admin_help/proc/unmark_ticket()
var/key_name = key_name_admin(usr)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/admin/verbs/adminpm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@

var/message_prompt = "Message:"

if(AH && !AH.marked_admin)
AH.mark_ticket()

if((AH?.opening_responders && length(AH.ticket_interactions) == 1 ) || ((AH?.marked_admin && AH?.marked_admin != usr.ckey) && length(AH.ticket_interactions) == 2))
SEND_SOUND(src, sound('sound/machines/buzz-sigh.ogg', volume=30))
message_prompt += "\n\n**This ticket is already being responded to by: [length(AH.opening_responders) ? english_list(AH.opening_responders) : AH.marked_admin]**"
Expand Down

0 comments on commit 8f9c8e2

Please sign in to comment.