Fixes a bunch of fallout from the tgui PR (#13648)

* screamies

fixes a bunch of fallout from the tgui PR.. probably

* Empty commit to poke travis
This commit is contained in:
DeltaFire15
2020-11-01 21:59:22 +01:00
committed by GitHub
parent 002c0b231b
commit 91584053f5
12 changed files with 93 additions and 14 deletions

View File

@@ -8,6 +8,7 @@ export const RoboticsControlConsole = (props, context) => {
const [tab, setTab] = useSharedState(context, 'tab', 1);
const {
can_hack,
can_convert,
cyborgs = [],
drones = [],
} = data;
@@ -34,7 +35,9 @@ export const RoboticsControlConsole = (props, context) => {
</Tabs.Tab>
</Tabs>
{tab === 1 && (
<Cyborgs cyborgs={cyborgs} can_hack={can_hack} />
<Cyborgs cyborgs={cyborgs}
can_hack={can_hack}
can_convert={can_convert} />
)}
{tab === 2 && (
<Drones drones={drones} />
@@ -45,7 +48,7 @@ export const RoboticsControlConsole = (props, context) => {
};
const Cyborgs = (props, context) => {
const { cyborgs, can_hack } = props;
const { cyborgs, can_hack, can_convert } = props;
const { act, data } = useBackend(context);
if (!cyborgs.length) {
return (
@@ -70,6 +73,15 @@ const Cyborgs = (props, context) => {
ref: cyborg.ref,
})} />
)}
{!!can_convert && !cyborg.servant && (
<Button
icon="terminal"
content="Convert"
color="bad"
onClick={() => act('convert', {
ref: cyborg.ref,
})} />
)}
<Button.Confirm
icon={cyborg.locked_down ? 'unlock' : 'lock'}
color={cyborg.locked_down ? 'good' : 'default'}

File diff suppressed because one or more lines are too long