From 63e800fb7ee31dbd5d9cc7fea715f3708c288376 Mon Sep 17 00:00:00 2001 From: ItsSelis Date: Sun, 11 Dec 2022 18:17:20 +0100 Subject: [PATCH] Ability for non-admin mentors to use stuff --- code/modules/mentor/mentorhelp.dm | 2 +- code/modules/mob/mob.dm | 5 ++++- code/modules/tgui/states/mentor.dm | 12 ++++++++++++ vorestation.dme | 1 + 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 code/modules/tgui/states/mentor.dm diff --git a/code/modules/mentor/mentorhelp.dm b/code/modules/mentor/mentorhelp.dm index a80429648af..8827bc8a020 100644 --- a/code/modules/mentor/mentorhelp.dm +++ b/code/modules/mentor/mentorhelp.dm @@ -304,7 +304,7 @@ GLOBAL_DATUM_INIT(mhelp_tickets, /datum/mentor_help_tickets, new) ui.open() /datum/mentor_help/tgui_state(mob/user) - return GLOB.tgui_admin_state + return GLOB.tgui_mentor_state /datum/mentor_help/tgui_data(mob/user) var/list/data = list() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index bed0702179e..d269d8901ed 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -686,7 +686,6 @@ if(statpanel("Tickets")) GLOB.ahelp_tickets.stat_entry() - GLOB.mhelp_tickets.stat_entry() if(length(GLOB.sdql2_queries)) @@ -695,6 +694,10 @@ for(var/datum/SDQL2_query/Q as anything in GLOB.sdql2_queries) Q.generate_stat() + if(has_mentor_powers(client)) + if(statpanel("Tickets")) + GLOB.mhelp_tickets.stat_entry() + if(listed_turf && client) if(!TurfAdjacent(listed_turf)) listed_turf = null diff --git a/code/modules/tgui/states/mentor.dm b/code/modules/tgui/states/mentor.dm new file mode 100644 index 00000000000..2a746a02683 --- /dev/null +++ b/code/modules/tgui/states/mentor.dm @@ -0,0 +1,12 @@ + /** + * tgui state: mentor_state + * + * Checks that the user is an mentor. + **/ + +GLOBAL_DATUM_INIT(tgui_mentor_state, /datum/tgui_state/mentor_state, new) + +/datum/tgui_state/mentor_state/can_use_topic(src_object, mob/user) + if(has_mentor_powers(user.client)) + return STATUS_INTERACTIVE + return STATUS_CLOSE diff --git a/vorestation.dme b/vorestation.dme index d2e071e791a..f39b57820fb 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -3954,6 +3954,7 @@ #include "code\modules\tgui\states\human_adjacent.dm" #include "code\modules\tgui\states\inventory.dm" #include "code\modules\tgui\states\inventory_vr.dm" +#include "code\modules\tgui\states\mentor.dm" #include "code\modules\tgui\states\not_incapacitated.dm" #include "code\modules\tgui\states\notcontained.dm" #include "code\modules\tgui\states\observer.dm"