Skip to content

Commit

Permalink
bugfix: PP для модеров, подправка окна и скрытие инфы (#6470)
Browse files Browse the repository at this point in the history
* bugfix: PP для модеров, подправка окна и скрытие инфы

* prettier
  • Loading branch information
BeebBeebBoob authored Jan 27, 2025
1 parent 7ea48e8 commit b0b1ecc
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 14 deletions.
2 changes: 1 addition & 1 deletion code/modules/admin/player_options_panel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
12 changes: 12 additions & 0 deletions code/modules/tgui/states/admin_mod.dm
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions paradise.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
32 changes: 22 additions & 10 deletions tgui/packages/tgui/interfaces/PlayerPanel.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -103,6 +103,8 @@ export const PlayerPanel = (props, context) => {

const PlayerInformation = (props, context) => {
const { act, data } = useBackend<playerData>(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 });
Expand All @@ -119,28 +121,38 @@ const PlayerInformation = (props, context) => {
<Table.Cell>{data.ckey}</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell bold>IP Address:</Table.Cell>
<Table.Cell>{data.ipAddress}</Table.Cell>
<Table.Cell bold>Rank:</Table.Cell>
<Table.Cell>{data.rank}</Table.Cell>
<Table.Cell bold>Discord:</Table.Cell>
<Table.Cell>{data.discord}</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell bold>Rank:</Table.Cell>
<Table.Cell>{data.rank}</Table.Cell>
<Table.Cell bold>Account Registered:</Table.Cell>
<Table.Cell>{data.accountRegistered}</Table.Cell>
<Table.Cell bold>Byond Version:</Table.Cell>
<Table.Cell>{data.byondVersion}</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell bold>Mob Type:</Table.Cell>
<Table.Cell>{data.mobType}</Table.Cell>
<Table.Cell bold>CID:</Table.Cell>
<Table.Cell>{data.CID}</Table.Cell>
<Table.Cell>
<Button
content={!hideCID ? 'Hidden' : data.CID}
onClick={() => setCID(!hideCID)}
/>
</Table.Cell>
<Table.Cell bold>IP Address:</Table.Cell>
<Table.Cell>
<Button
content={!hideIP ? 'Hidden' : data.ipAddress}
onClick={() => setIP(!hideIP)}
/>
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell bold>Mob Type:</Table.Cell>
<Table.Cell>{data.mobType}</Table.Cell>
<Table.Cell bold>Game State:</Table.Cell>
<Table.Cell>{data.gameState}</Table.Cell>
<Table.Cell bold>Account Registered:</Table.Cell>
<Table.Cell>{data.accountRegistered}</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell bold>Related By CID:</Table.Cell>
Expand Down
2 changes: 1 addition & 1 deletion tgui/packages/tgui/interfaces/VethPlayerPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const VethPlayerPanel = (props, context) => {

return (
<Box>
<Window title="Player Panel Veth" width={1000} height={640}>
<Window title="Player Panel Veth" width={1100} height={640}>
<Window.Content>
<Section>
<Button
Expand Down
4 changes: 2 additions & 2 deletions tgui/public/tgui.bundle.js

Large diffs are not rendered by default.

0 comments on commit b0b1ecc

Please sign in to comment.