Skip to content

Commit

Permalink
finished styling the panel
Browse files Browse the repository at this point in the history
  • Loading branch information
mullenpaul committed Nov 14, 2023
1 parent 1596785 commit 907eee0
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 17 deletions.
21 changes: 11 additions & 10 deletions tgui/packages/tgui/interfaces/DropshipWeaponsConsole.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -334,19 +334,20 @@ const PrimaryPanel = (props: MfdProps, context) => {
}
};

export const DropshipWeaponsConsole = (_, context) => {
const { data } = useBackend<DropshipProps>(context);
export const DropshipWeaponsConsole = () => {
return (
<Window height={700} width={1300}>
<Window.Content>
<Stack horizontal className="WeaponsConsole">
<Stack.Item>
<PrimaryPanel panelStateId="left-screen" />
</Stack.Item>
<Stack.Item>
<PrimaryPanel panelStateId="right-screen" />
</Stack.Item>
</Stack>
<Box className="WeaponsConsoleBackground">
<Stack horizontal className="WeaponsConsole">
<Stack.Item>
<PrimaryPanel panelStateId="left-screen" />
</Stack.Item>
<Stack.Item>
<PrimaryPanel panelStateId="right-screen" />
</Stack.Item>
</Stack>
</Box>
</Window.Content>
</Window>
);
Expand Down
28 changes: 24 additions & 4 deletions tgui/packages/tgui/interfaces/MfdPanels/MultifunctionDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ export const VerticalPanel = (
);
};

const HexScrew = () => {
return (
<svg viewBox="0 0 10 10" width="30px" height="30px">
<circle cx="5" cy="5" r="4" fill="#202020" />
<polygon
points="3.5,2.5 6.5,2.5 8,5 6.5,7.5 3.5,7.5 2,5"
fill="#040404"
/>
</svg>
);
};

export const MfdPanel = (props: MfdProps) => {
const topProps = props.topButtons ?? [];
const botProps = props.bottomButtons ?? [];
Expand All @@ -94,11 +106,15 @@ export const MfdPanel = (props: MfdProps) => {
return (
<Table className="primarypanel">
<TableRow>
<TableCell />
<TableCell className={classes(['Screw_cell_top', 'Screw_cell_left'])}>
<HexScrew />
</TableCell>
<TableCell>
<HorizontalPanel buttons={topButtons} />
</TableCell>
<TableCell />
<TableCell className={classes(['Screw_cell_top', 'Screw_cell_right'])}>
<HexScrew />
</TableCell>
</TableRow>
<TableRow>
<TableCell>
Expand All @@ -114,11 +130,15 @@ export const MfdPanel = (props: MfdProps) => {
</TableCell>
</TableRow>
<TableRow>
<TableCell />
<TableCell className={classes(['Screw_cell_bot', 'Screw_cell_left'])}>
<HexScrew />
</TableCell>
<TableCell>
<HorizontalPanel buttons={bottomButtons} />
</TableCell>
<TableCell />
<TableCell className={classes(['Screw_cell_bot', 'Screw_cell_right'])}>
<HexScrew />
</TableCell>
</TableRow>
</Table>
);
Expand Down
9 changes: 6 additions & 3 deletions tgui/packages/tgui/interfaces/MfdPanels/TargetAquisition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,13 @@ const lazeMapper = (context) => {
return (index: number) => {
const target = lazes.length > index ? lazes[index] : undefined;
const label = target?.target_name.split(' ')[0] ?? '';
const squad = label[0] ?? '';
const number = label.split('-')[1] ?? '';
const squad = label[0] ?? undefined;
const number = label.split('-')[1] ?? undefined;
return {
children: `${squad}-${number}`,
children:
squad !== undefined && number !== undefined
? `${squad}-${number}`
: undefined,
onClick: target
? () => {
act('set-camera', { 'equipment_id': target.target_tag });
Expand Down
22 changes: 22 additions & 0 deletions tgui/packages/tgui/styles/interfaces/DropshipWeapons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
border: 1px solid red;
}

.WeaponsConsoleBackground {
background-color: #040404;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}

.WeaponsConsole {
padding: 8px;
.primarypanel {
width: fit-content;
height: 512px;
Expand Down Expand Up @@ -209,6 +219,18 @@
padding: 2px;
margin: 0px;
}
.Screw_cell_top {
vertical-align: top;
}
.Screw_cell_bot {
vertical-align: bottom;
}
.Screw_cell_right {
text-align: right;
}
.Screw_cell_left {
text-align: left;
}
}

.Test {
Expand Down

0 comments on commit 907eee0

Please sign in to comment.