From a460d064ee935b4f69c760bbc38d7c4a103c7b87 Mon Sep 17 00:00:00 2001 From: Matt Atlas Date: Wed, 27 Sep 2023 13:51:05 +0200 Subject: [PATCH] fusion core ui improvements --- .../tgui/interfaces/FusionCoreControl.tsx | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/tgui/packages/tgui/interfaces/FusionCoreControl.tsx b/tgui/packages/tgui/interfaces/FusionCoreControl.tsx index ee1ef874580..fec38c0e300 100644 --- a/tgui/packages/tgui/interfaces/FusionCoreControl.tsx +++ b/tgui/packages/tgui/interfaces/FusionCoreControl.tsx @@ -1,5 +1,7 @@ +import { round } from '../../common/math'; import { BooleanLike } from '../../common/react'; -import { useBackend } from '../backend'; +import { capitalize } from '../../common/string'; +import { useBackend, useSharedState } from '../backend'; import { Box, Button, Dimmer, Divider, LabeledList, NoticeBox, NumberInput, ProgressBar, Section } from '../components'; import { Window } from '../layouts'; @@ -29,6 +31,11 @@ type Reactant = { export const FusionCoreControl = (props, context) => { const { act, data } = useBackend(context); + const [override, setOverride] = useSharedState( + context, + 'override', + false + ); return ( @@ -45,7 +52,7 @@ export const FusionCoreControl = (props, context) => { color="red" icon="radiation" onClick={() => act('toggle_active', { machine: core.ref })} - disabled={!core.field || !core.shutdown_safe} + disabled={!core.field || (!core.shutdown_safe && !override)} /> ) : (