From 6a8ef737194d06edb8fa61c710091336f6c644ce Mon Sep 17 00:00:00 2001 From: SabreML <57483089+SabreML@users.noreply.github.com> Date: Wed, 3 Feb 2021 21:57:07 +0000 Subject: [PATCH] Some Admin/Mentor help improvements (#15415) * Ticket thing V1 * Flipped Buttons --- code/controllers/subsystem/tickets/tickets.dm | 53 +++++++++++++------ code/modules/admin/verbs/adminhelp.dm | 25 +++++---- 2 files changed, 49 insertions(+), 29 deletions(-) diff --git a/code/controllers/subsystem/tickets/tickets.dm b/code/controllers/subsystem/tickets/tickets.dm index 3c7f810ce85..1cce61e6ccb 100644 --- a/code/controllers/subsystem/tickets/tickets.dm +++ b/code/controllers/subsystem/tickets/tickets.dm @@ -172,6 +172,9 @@ SUBSYSTEM_DEF(tickets) if(!other_ticket_system_staff_check()) return var/datum/ticket/T = allTickets[ticketId] + if(T.ticket_converted) + to_chat(usr, "This ticket has already been converted!") + return convert_ticket(T) /datum/controller/subsystem/tickets/proc/other_ticket_system_staff_check() @@ -183,6 +186,7 @@ SUBSYSTEM_DEF(tickets) /datum/controller/subsystem/tickets/proc/convert_ticket(datum/ticket/T) T.ticketState = TICKET_CLOSED + T.ticket_converted = TRUE var/client/C = usr.client var/client/owner = get_client_by_ckey(T.client_ckey) to_chat_safe(owner, list("[key_name_hidden(C)] has converted your ticket to a [other_ticket_name] ticket.",\ @@ -282,7 +286,7 @@ SUBSYSTEM_DEF(tickets) /datum/controller/subsystem/tickets/proc/assignStaffToTicket(client/C, N) var/datum/ticket/T = allTickets[N] - if(T.staffAssigned != null && T.staffAssigned != C && alert("Ticket is already assigned to [T.staffAssigned.ckey]. Are you sure you want to take it?","Take ticket","No","Yes") != "Yes") + if(T.staffAssigned != null && T.staffAssigned != C && alert("Ticket is already assigned to [T.staffAssigned.ckey]. Are you sure you want to take it?", "Take ticket", "Yes", "No") != "Yes") return FALSE T.assignStaff(C) return TRUE @@ -290,21 +294,36 @@ SUBSYSTEM_DEF(tickets) //Single staff ticket /datum/ticket - var/ticketNum // Ticket number - /// ckey of the client who opened the ticket + /// Ticket number. + var/ticketNum + /// ckey of the client who opened the ticket. var/client_ckey - var/timeOpened // Time the ticket was opened - var/title //The initial message with links - var/raw_title // The title without URLs added - var/list/content // content of the staff help - var/lastStaffResponse // Last staff member who responded - var/lastResponseTime // When the staff last responded - var/locationSent // Location the player was when they send the ticket - var/mobControlled // Mob they were controlling - var/ticketState // State of the ticket, open, closed, resolved etc - var/timeUntilStale // When the ticket goes stale - var/ticketCooldown // Cooldown before allowing the user to open another ticket. - var/client/staffAssigned // Staff member who has assigned themselves to this ticket + /// Time the ticket was opened. + var/timeOpened + /// The initial message with links. + var/title + /// The title without URLs added. + var/raw_title + /// Content of the staff help. + var/list/content + /// Last staff member who responded. + var/lastStaffResponse + /// When the staff last responded. + var/lastResponseTime + /// The location the player was when they sent the ticket. + var/locationSent + /// The mob the player was controlling when they sent the ticket. + var/mobControlled + /// State of the ticket, open, closed, resolved etc. + var/ticketState + /// Has the ticket been converted to another type? (Mhelp to Ahelp, etc.) + var/ticket_converted = FALSE + /// When the ticket goes stale. + var/timeUntilStale + /// Cooldown before allowing the user to open another ticket. + var/ticketCooldown + /// Staff member who has assigned themselves to this ticket. + var/client/staffAssigned /datum/ticket/New(tit, raw_tit, cont, num) title = tit @@ -328,6 +347,8 @@ SUBSYSTEM_DEF(tickets) //Return the ticket state as a colour coded text string. /datum/ticket/proc/state2text() + if(ticket_converted) + return "CONVERTED" switch(ticketState) if(TICKET_OPEN) return "OPEN" @@ -430,7 +451,7 @@ UI STUFF dat += "
| [T.title] |