mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Various ticket fixes (#6748)
This commit is contained in:
@@ -129,13 +129,13 @@ GLOBAL_DATUM_INIT(tickets, /datum/tickets, new)
|
||||
if(C.current_ticket)
|
||||
C.current_ticket.AddInteraction("Client reconnected.")
|
||||
C.current_ticket.initiator = C
|
||||
C.current_ticket.initiator.mob.throw_alert("open ticket", /obj/screen/alert/open_ticket)
|
||||
// C.current_ticket.initiator.mob.throw_alert("open ticket", /obj/screen/alert/open_ticket) // Uncomment this line to enable player-side ticket ui
|
||||
|
||||
//Dissasociate ticket
|
||||
/datum/tickets/proc/ClientLogout(client/C)
|
||||
if(C.current_ticket)
|
||||
C.current_ticket.AddInteraction("Client disconnected.")
|
||||
C.current_ticket.initiator.mob.clear_alert("open ticket")
|
||||
// C.current_ticket.initiator.mob.clear_alert("open ticket") // Uncomment this line to enable player-side ticket ui
|
||||
C.current_ticket.initiator = null
|
||||
C.current_ticket = null
|
||||
|
||||
@@ -301,7 +301,8 @@ GLOBAL_DATUM_INIT(tickets, /datum/tickets, new)
|
||||
//var/datum/ticket_chat/TC = new()
|
||||
//TC.T = src
|
||||
//TC.tgui_interact(C.mob)
|
||||
C.mob.throw_alert("open ticket", /obj/screen/alert/open_ticket)
|
||||
|
||||
// C.mob.throw_alert("open ticket", /obj/screen/alert/open_ticket) // Uncomment this line to enable player-side ticket ui
|
||||
|
||||
/datum/ticket/Destroy()
|
||||
RemoveActive()
|
||||
@@ -471,7 +472,7 @@ GLOBAL_DATUM_INIT(tickets, /datum/tickets, new)
|
||||
"color" = COLOR_WEBHOOK_BAD
|
||||
)
|
||||
)
|
||||
initiator?.mob?.clear_alert("open ticket")
|
||||
// initiator?.mob?.clear_alert("open ticket") // Uncomment this line to enable player-side ticket ui
|
||||
|
||||
//Mark open ticket as resolved/legitimate, returns ahelp verb
|
||||
/datum/ticket/proc/Resolve(silent = FALSE)
|
||||
@@ -502,7 +503,7 @@ GLOBAL_DATUM_INIT(tickets, /datum/tickets, new)
|
||||
"color" = COLOR_WEBHOOK_GOOD
|
||||
)
|
||||
)
|
||||
initiator?.mob?.clear_alert("open ticket")
|
||||
// initiator?.mob?.clear_alert("open ticket") // Uncomment this line to enable player-side ticket ui
|
||||
|
||||
//Close and return ahelp verb, use if ticket is incoherent
|
||||
/datum/ticket/proc/Reject(key_name = key_name_admin(usr))
|
||||
|
||||
@@ -6,19 +6,22 @@
|
||||
var/datum/ticket/T
|
||||
|
||||
/datum/ticket_chat/tgui_interact(mob/user, datum/tgui/ui)
|
||||
ui = SStgui.try_update_ui(user, src, ui)
|
||||
if(!ui)
|
||||
ui = new(user, src, "TicketChat", "Ticket #[T.id] - [T.LinkedReplyName("\ref[T]")]")
|
||||
ui.open()
|
||||
user.clear_alert("open ticket")
|
||||
return // Remove this line to enable player-side ticket ui
|
||||
//ui = SStgui.try_update_ui(user, src, ui)
|
||||
//if(!ui)
|
||||
// ui = new(user, src, "TicketChat", "Ticket #[T.id] - [T.LinkedReplyName("\ref[T]")]")
|
||||
// ui.open()
|
||||
// user.clear_alert("open ticket")
|
||||
|
||||
/datum/ticket_chat/tgui_close(mob/user)
|
||||
. = ..()
|
||||
if(user.client.current_ticket)
|
||||
user.throw_alert("open ticket", /obj/screen/alert/open_ticket)
|
||||
return // Remove this line to enable player-side ticket ui
|
||||
//if(user.client.current_ticket)
|
||||
// user.throw_alert("open ticket", /obj/screen/alert/open_ticket)
|
||||
|
||||
/datum/ticket_chat/tgui_state(mob/user)
|
||||
return GLOB.tgui_ticket_state
|
||||
return GLOB.tgui_admin_state // Remove this line to enable player-side ticket ui
|
||||
//return GLOB.tgui_ticket_state
|
||||
|
||||
/datum/ticket_chat/tgui_data(mob/user)
|
||||
var/list/data = list()
|
||||
@@ -26,9 +29,9 @@
|
||||
data["id"] = T.id
|
||||
|
||||
data["level"] = T.level
|
||||
data["handler"] = T.handler
|
||||
// data["handler"] = T.handler // Uncomment this line to enable player-side ticket ui
|
||||
|
||||
data["log"] = T._interactions
|
||||
// data["log"] = T._interactions // Uncomment this line to enable player-side ticket ui
|
||||
|
||||
return data
|
||||
|
||||
|
||||
@@ -103,6 +103,14 @@ export const Ticket = (props, context) => {
|
||||
</LabeledList>
|
||||
<Divider />
|
||||
<Flex direction="column">
|
||||
<Flex.Item>
|
||||
{Object.keys(log)
|
||||
.slice(0)
|
||||
.map((L) => (
|
||||
<div dangerouslySetInnerHTML={{ __html: log[L] }} />
|
||||
))}
|
||||
</Flex.Item>
|
||||
<Divider />
|
||||
<Flex.Item>
|
||||
<Flex>
|
||||
<Flex.Item grow>
|
||||
@@ -141,15 +149,6 @@ export const Ticket = (props, context) => {
|
||||
</Flex.Item>
|
||||
</Flex>
|
||||
</Flex.Item>
|
||||
<Divider />
|
||||
<Flex.Item>
|
||||
{Object.keys(log)
|
||||
.slice(0)
|
||||
.reverse()
|
||||
.map((L) => (
|
||||
<div dangerouslySetInnerHTML={{ __html: log[L] }} />
|
||||
))}
|
||||
</Flex.Item>
|
||||
</Flex>
|
||||
</Section>
|
||||
</Window.Content>
|
||||
|
||||
@@ -54,6 +54,14 @@ export const TicketChat = (props, context) => {
|
||||
</LabeledList>
|
||||
<Divider />
|
||||
<Flex direction="column">
|
||||
<Flex.Item>
|
||||
{Object.keys(log)
|
||||
.slice(0)
|
||||
.map((L) => (
|
||||
<div dangerouslySetInnerHTML={{ __html: log[L] }} />
|
||||
))}
|
||||
</Flex.Item>
|
||||
<Divider />
|
||||
<Flex.Item>
|
||||
<Flex>
|
||||
<Flex.Item grow>
|
||||
@@ -86,15 +94,6 @@ export const TicketChat = (props, context) => {
|
||||
</Flex.Item>
|
||||
</Flex>
|
||||
</Flex.Item>
|
||||
<Divider />
|
||||
<Flex.Item>
|
||||
{Object.keys(log)
|
||||
.slice(0)
|
||||
.reverse()
|
||||
.map((L) => (
|
||||
<div dangerouslySetInnerHTML={{ __html: log[L] }} />
|
||||
))}
|
||||
</Flex.Item>
|
||||
</Flex>
|
||||
</Section>
|
||||
</Window.Content>
|
||||
|
||||
@@ -224,6 +224,18 @@ export const TicketsPanel = (props, context) => {
|
||||
</LabeledList>
|
||||
<Divider />
|
||||
<Flex direction="column">
|
||||
<Flex.Item maxWidth={'500px'}>
|
||||
{Object.keys(selected_ticket.log)
|
||||
.slice(0)
|
||||
.map((L) => (
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: selected_ticket.log[L],
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</Flex.Item>
|
||||
<Divider />
|
||||
<Flex.Item>
|
||||
<Flex>
|
||||
<Flex.Item grow>
|
||||
@@ -256,19 +268,6 @@ export const TicketsPanel = (props, context) => {
|
||||
</Flex.Item>
|
||||
</Flex>
|
||||
</Flex.Item>
|
||||
<Divider />
|
||||
<Flex.Item maxWidth={'500px'}>
|
||||
{Object.keys(selected_ticket.log)
|
||||
.slice(0)
|
||||
.reverse()
|
||||
.map((L) => (
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: selected_ticket.log[L],
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</Flex.Item>
|
||||
</Flex>
|
||||
</Section>
|
||||
)) || (
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user