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