From f4197524059996d5d695f50b5593c9fb5bfdc214 Mon Sep 17 00:00:00 2001 From: BeebBeebBoob Date: Mon, 27 Jan 2025 18:59:13 +0300 Subject: [PATCH] =?UTF-8?q?bugfix:=20PP=20=D0=B4=D0=BB=D1=8F=20=D0=BC?= =?UTF-8?q?=D0=BE=D0=B4=D0=B5=D1=80=D0=BE=D0=B2,=20=D0=BF=D0=BE=D0=B4?= =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20=D0=BE=D0=BA=D0=BD=D0=B0?= =?UTF-8?q?=20=D0=B8=20=D1=81=D0=BA=D1=80=D1=8B=D1=82=D0=B8=D0=B5=20=D0=B8?= =?UTF-8?q?=D0=BD=D1=84=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/modules/admin/player_options_panel.dm | 2 +- code/modules/tgui/states/admin_mod.dm | 12 ++++++++ paradise.dme | 1 + tgui/packages/tgui/interfaces/PlayerPanel.tsx | 30 ++++++++++++------- .../tgui/interfaces/VethPlayerPanel.js | 2 +- tgui/public/tgui.bundle.js | 4 +-- 6 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 code/modules/tgui/states/admin_mod.dm diff --git a/code/modules/admin/player_options_panel.dm b/code/modules/admin/player_options_panel.dm index 0c1fba6dd5d..dc2c3771fe7 100644 --- a/code/modules/admin/player_options_panel.dm +++ b/code/modules/admin/player_options_panel.dm @@ -329,7 +329,7 @@ /datum/vuap_personal/ui_state(mob/user) - return GLOB.admin_state + return GLOB.admin_mod_state /datum/admins/proc/vuap_open(ckey, mob/M) if (!check_rights(NONE)) diff --git a/code/modules/tgui/states/admin_mod.dm b/code/modules/tgui/states/admin_mod.dm new file mode 100644 index 00000000000..7ea9b10040c --- /dev/null +++ b/code/modules/tgui/states/admin_mod.dm @@ -0,0 +1,12 @@ +/** + * tgui state: mod_state + * + * Checks that the user is admin or mod, end-of-story. + */ + +GLOBAL_DATUM_INIT(admin_mod_state, /datum/ui_state/admin_mod_state, new) + +/datum/ui_state/admin_mod_state/can_use_topic(src_object, mob/user, atom/ui_source) + if(check_rights_for(user.client, R_ADMIN) || check_rights_for(user.client, R_MOD)) + return UI_INTERACTIVE + return UI_CLOSE diff --git a/paradise.dme b/paradise.dme index 69547f14504..ad31208117a 100644 --- a/paradise.dme +++ b/paradise.dme @@ -3278,6 +3278,7 @@ #include "code\modules\tgui\states\hands.dm" #include "code\modules\tgui\states\human_adjacent.dm" #include "code\modules\tgui\states\inventory.dm" +#include "code\modules\tgui\states\admin_mod.dm" #include "code\modules\tgui\states\not_incapacitated.dm" #include "code\modules\tgui\states\notcontained.dm" #include "code\modules\tgui\states\observer.dm" diff --git a/tgui/packages/tgui/interfaces/PlayerPanel.tsx b/tgui/packages/tgui/interfaces/PlayerPanel.tsx index bd661c8f454..3854b6e2f37 100644 --- a/tgui/packages/tgui/interfaces/PlayerPanel.tsx +++ b/tgui/packages/tgui/interfaces/PlayerPanel.tsx @@ -1,4 +1,4 @@ -import { useBackend } from '../backend'; +import { useBackend, useLocalState } from '../backend'; import { Box, Button, Section, Table, Stack, Grid } from '../components'; import { Window } from '../layouts'; @@ -103,6 +103,8 @@ export const PlayerPanel = (props, context) => { const PlayerInformation = (props, context) => { const { act, data } = useBackend(context); + const [hideIP, setIP] = useLocalState(context, 'show_ip', false) + const [hideCID, setCID] = useLocalState(context, 'show_cid', false) const handleAction = (action: string, params = {}) => { act(action, { selectedPlayerCkey: data.ckey, ...params }); @@ -119,28 +121,36 @@ const PlayerInformation = (props, context) => { {data.ckey} - IP Address: - {data.ipAddress} + Rank: + {data.rank} Discord: {data.discord} - Rank: - {data.rank} + Account Registered: + {data.accountRegistered} Byond Version: {data.byondVersion} - Mob Type: - {data.mobType} CID: - {data.CID} + +