mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 01:34:01 +00:00
## About The Pull Request Swaps out local components for tgui-core components for interfaces D-M I'm doing this in small batches for easier debugging. ## Reopened: With the release of tgui core v1.3, I am much more confident that the library can replace our usage. I've expanded this PR to many more UIs for testing ## Why It's Good For The Game Centralized, maintained component library that many external developers contribute to ## Changelog n/a
114 lines
3.3 KiB
JavaScript
114 lines
3.3 KiB
JavaScript
import { Button, Flex, NoticeBox, Section } from 'tgui-core/components';
|
|
|
|
import { useBackend } from '../backend';
|
|
import { Window } from '../layouts';
|
|
|
|
export const GhostPoolProtection = (props) => {
|
|
const { act, data } = useBackend();
|
|
const {
|
|
events_or_midrounds,
|
|
spawners,
|
|
station_sentience,
|
|
silicons,
|
|
minigames,
|
|
} = data;
|
|
return (
|
|
<Window
|
|
title="Ghost Pool Protection"
|
|
width={400}
|
|
height={270}
|
|
theme="admin"
|
|
>
|
|
<Window.Content>
|
|
<Flex grow={1} height="100%">
|
|
<Section
|
|
title="Options"
|
|
buttons={
|
|
<>
|
|
<Button
|
|
color="good"
|
|
icon="plus-circle"
|
|
content="Enable Everything"
|
|
onClick={() => act('all_roles')}
|
|
/>
|
|
<Button
|
|
color="bad"
|
|
icon="minus-circle"
|
|
content="Disable Everything"
|
|
onClick={() => act('no_roles')}
|
|
/>
|
|
</>
|
|
}
|
|
>
|
|
<NoticeBox danger>
|
|
For people creating a sneaky event: If you toggle Station Created
|
|
Sentience, people may catch on that admins have disabled roles for
|
|
your event...
|
|
</NoticeBox>
|
|
<Flex.Item>
|
|
<Button
|
|
fluid
|
|
textAlign="center"
|
|
color={events_or_midrounds ? 'good' : 'bad'}
|
|
icon="meteor"
|
|
content="Events and Midround Rulesets"
|
|
onClick={() => act('toggle_events_or_midrounds')}
|
|
/>
|
|
</Flex.Item>
|
|
<Flex.Item>
|
|
<Button
|
|
fluid
|
|
textAlign="center"
|
|
color={spawners ? 'good' : 'bad'}
|
|
icon="pastafarianism"
|
|
content="Ghost Role Spawners"
|
|
onClick={() => act('toggle_spawners')}
|
|
/>
|
|
</Flex.Item>
|
|
<Flex.Item>
|
|
<Button
|
|
fluid
|
|
textAlign="center"
|
|
color={station_sentience ? 'good' : 'bad'}
|
|
icon="user-astronaut"
|
|
content="Station Created Sentience"
|
|
onClick={() => act('toggle_station_sentience')}
|
|
/>
|
|
</Flex.Item>
|
|
<Flex.Item>
|
|
<Button
|
|
fluid
|
|
textAlign="center"
|
|
color={silicons ? 'good' : 'bad'}
|
|
icon="robot"
|
|
content="Silicons"
|
|
onClick={() => act('toggle_silicons')}
|
|
/>
|
|
</Flex.Item>
|
|
<Flex.Item>
|
|
<Button
|
|
fluid
|
|
textAlign="center"
|
|
color={minigames ? 'good' : 'bad'}
|
|
icon="gamepad"
|
|
content="Minigames"
|
|
onClick={() => act('toggle_minigames')}
|
|
/>
|
|
</Flex.Item>
|
|
<Flex.Item>
|
|
<Button
|
|
fluid
|
|
textAlign="center"
|
|
color="orange"
|
|
icon="check"
|
|
content="Apply Changes"
|
|
onClick={() => act('apply_settings')}
|
|
/>
|
|
</Flex.Item>
|
|
</Section>
|
|
</Flex>
|
|
</Window.Content>
|
|
</Window>
|
|
);
|
|
};
|