Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 72 additions & 66 deletions tgui/packages/tgui/interfaces/AnomalyAISpawner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@ import { classes } from 'common/react';
import { useState } from 'react';

import { useBackend } from '../backend';
import {
Box,
Button,
Collapsible,
Divider,
Section,
Stack,
} from '../components';
import { Box, Button, Divider, Section, Stack } from '../components';
import { Window } from '../layouts';

type AnomalyAIPreset = {
Expand Down Expand Up @@ -56,66 +49,79 @@ const AnomalyAISpawnerr = (props) => {
const { presets } = data;
return (
<Section fill className="AnomalySpawner__Main">
<Stack fill vertical>
<Stack fill>
<Stack.Item grow mr={1}>
<Section fill scrollable>
{Object.keys(presets).map((dictKey) => (
<Collapsible
title={dictKey}
key={dictKey}
className="AnomalyClass"
>
{presets[dictKey].map((squad) => (
<Box pb={'12px'} key={squad.path}>
<Button
className="AnomalyType"
selected={squad === chosenPreset}
key={squad.path}
onClick={() => setPreset(squad)}
>
{squad.name}
</Button>
</Box>
))}
</Collapsible>
))}
</Section>
</Stack.Item>
<Divider vertical />
<Stack.Item width="35%">
<Section title="Selected Preset" height="100%">
<Stack vertical height="100%">
<Stack.Item height="50%">
<Box align="center">
<span
className={classes([
'anomaly_menu128x128',
`${chosenPreset ? chosenPreset.icon : 'ss13'}`,
])}
/>
</Box>
</Stack.Item>
<Stack.Item>
{chosenPreset ? chosenPreset.description : 'NULL'}
</Stack.Item>
<Stack.Item>
<Button
textAlign="center"
width="100%"
onClick={() =>
act('create_ai', {
path: chosenPreset && chosenPreset.path,
})
}
>
Spawn
</Button>
<Stack fill>
<Stack.Item grow mr={1}>
<Section fill scrollable>
{Object.keys(presets).map((dictKey) => (
<Stack key={dictKey} vertical>
<Stack.Item className="AnomalyClass" fontSize={1.1} bold>
&gt;&gt;&gt; {dictKey} Class Hazard
</Stack.Item>
{presets[dictKey].map((squad) => (
<Stack.Item pb={'12px'} key={squad.path}>
<Button
className="AnomalyType"
selected={squad === chosenPreset}
key={squad.path}
onClick={() => setPreset(squad)}
>
- {squad.name} -
</Button>
</Stack.Item>
))}
</Stack>
</Section>
</Stack.Item>
</Stack>
))}
</Section>
</Stack.Item>
<Divider vertical />
<Stack.Item width="40%">
<Stack height="100%" vertical>
<Stack.Item
className="AnomalyClass"
fontSize={1.1}
bold
textAlign="center"
pb="3px"
>
Selected Preset
</Stack.Item>
<Stack.Item
className="SelectedPreset"
fontSize={1.2}
bold
textAlign="center"
mt="3px"
>
{chosenPreset ? chosenPreset.name : 'NONE'}
</Stack.Item>
<Stack fill pt="5%">
<Stack.Item width="50%">
<Box align="left" ml="-30%">
<span
className={classes([
'anomaly_menu128x128',
`${chosenPreset ? chosenPreset.icon : 'ss13'}`,
])}
/>
</Box>
</Stack.Item>
<Stack.Item className="AnomalyInfo" height="90%">
{chosenPreset ? chosenPreset.description : 'NULL'}
</Stack.Item>
</Stack>
<Button
textAlign="center"
width="100%"
onClick={() =>
act('create_ai', {
path: chosenPreset && chosenPreset.path,
})
}
>
Spawns
</Button>
</Stack>
</Stack.Item>
</Stack>
</Section>
);
Expand Down
31 changes: 25 additions & 6 deletions tgui/packages/tgui/styles/interfaces/AnomalyAISpawner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,40 @@
width: 100%;
height: 100%;
filter: brightness(2);
.AnomalyClass {
.AnomalyType {
background-color: #02b83e42;
border-left: 1.5px #00e94ed3 solid;
border-right: 1.5px #00e94ed3 solid;
padding-bottom: 1px;
font-weight: bold;
border-radius: 0px;
width: 100%;
text-align: center;
color: #00e94ed3;
}
.AnomalyType {
.AnomalyClass {
background-color: transparent;
margin-left: 4%;
width: 92%;
width: 100%;
margin-right: 4%;
padding-bottom: 2px;
border-radius: 0px;
border-bottom: 1px #00e94ed3 solid;
border-top: 1px #00e94ed3 solid;
text-align: center;
text-align: left;
}
.SelectedPreset {
background-color: #00e94eb6;
color: black;
width: 100%;
margin-right: 4%;
padding-bottom: 2px;
border-radius: 0px;
}
.AnomalyInfo {
background-color: #02b83e42;
border-left: 1.5px #00e94ed3 solid;
border-right: 1.5px #00e94ed3 solid;
padding-left: 5px;
width: 100%;
border-radius: 0px;
}
}
Loading