Skip to content

Commit

Permalink
Modularisation edits.
Browse files Browse the repository at this point in the history
  • Loading branch information
Crowbar764 committed Jul 11, 2024
1 parent a0ad47c commit ef2e066
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions code/modules/admin/verbs/admingame.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(show_player_panel, R_ADMIN, "Show Player Panel", mo
to_chat(user, span_warning("You seem to be selecting a mob that doesn't exist anymore."), confidential = TRUE)
return

// SPLURT EDIT START
var/useModern = user.prefs.read_preference(/datum/preference/toggle/use_tgui_player_panel)
if (useModern)
if(!player.mob_panel)
player.create_player_panel()
player.mob_panel.ui_interact(user.mob)
return
// SPLURT EDIT END

log_admin("[key_name(user)] checked the individual player panel for [key_name(player)][isobserver(user.mob)?"":" while in game"].")

Expand Down
11 changes: 10 additions & 1 deletion tgui/packages/tgui/components/Collapsible.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ type Props = Partial<{
open: boolean;
title: ReactNode;
icon: string;
// SPLURT EDIT START
disabled: boolean;
// SPLURT EDIT END
}> &
BoxProps;

Expand All @@ -30,7 +32,9 @@ export function Collapsible(props: Props) {
fluid
color={color}
icon={icon ? icon : open ? 'chevron-down' : 'chevron-right'}
// SPLURT EDIT START
disabled={disabled}
// SPLURT EDIT END
onClick={() => setOpen(!open)}
{...rest}
>
Expand All @@ -41,7 +45,12 @@ export function Collapsible(props: Props) {
<div className="Table__cell Table__cell--collapsing">{buttons}</div>
)}
</div>
{open && !disabled && <Box mt={1}>{children}</Box>}
{open &&
// SPLURT EDIT START
!disabled && (
// SPLURT EDIT END
<Box mt={1}>{children}</Box>
)}
</Box>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import {
} from '../base';
import { FeatureDropdownInput } from '../dropdowns';

// SPLURT EDIT START
export const use_tgui_player_panel: FeatureToggle = {
name: 'Use modern player panel',
category: 'ADMIN',
description: 'Whether to use the new TGUI player panel or the old HTML one.',
component: CheckboxInput,
};
// SPLURT EDIT END

export const asaycolor: Feature<string> = {
name: 'Admin chat color',
Expand Down

0 comments on commit ef2e066

Please sign in to comment.