Conflict resolution
This commit is contained in:
@@ -1,138 +0,0 @@
|
||||
import { Fragment } from 'inferno';
|
||||
import { useBackend } from '../backend';
|
||||
import { Box, Button, LabeledList, Section, Tabs } from '../components';
|
||||
|
||||
export const AirlockElectronics = props => {
|
||||
const { act, data } = useBackend(props);
|
||||
const regions = data.regions || [];
|
||||
|
||||
const diffMap = {
|
||||
0: {
|
||||
icon: 'times-circle',
|
||||
},
|
||||
1: {
|
||||
icon: 'stop-circle',
|
||||
},
|
||||
2: {
|
||||
icon: 'check-circle',
|
||||
},
|
||||
};
|
||||
|
||||
const checkAccessIcon = accesses => {
|
||||
let oneAccess = false;
|
||||
let oneInaccess = false;
|
||||
|
||||
accesses.forEach(element => {
|
||||
if (element.req) {
|
||||
oneAccess = true;
|
||||
}
|
||||
else {
|
||||
oneInaccess = true;
|
||||
}
|
||||
});
|
||||
|
||||
if (!oneAccess && oneInaccess) {
|
||||
return 0;
|
||||
}
|
||||
else if (oneAccess && oneInaccess) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
return 2;
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<Section title="Main">
|
||||
<LabeledList>
|
||||
<LabeledList.Item
|
||||
label="Access Required">
|
||||
<Button
|
||||
icon={data.oneAccess ? 'unlock' : 'lock'}
|
||||
content={data.oneAccess ? 'One' : 'All'}
|
||||
onClick={() => act('one_access')}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item
|
||||
label="Mass Modify">
|
||||
<Button
|
||||
icon="check-double"
|
||||
content="Grant All"
|
||||
onClick={() => act('grant_all')}
|
||||
/>
|
||||
<Button
|
||||
icon="undo"
|
||||
content="Clear All"
|
||||
onClick={() => act('clear_all')}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item
|
||||
label="Unrestricted Access">
|
||||
<Button
|
||||
icon={data.unres_direction & 1 ? 'check-square-o' : 'square-o'}
|
||||
content="North"
|
||||
selected={data.unres_direction & 1}
|
||||
onClick={() => act('direc_set', {
|
||||
unres_direction: '1',
|
||||
})}
|
||||
/>
|
||||
<Button
|
||||
icon={data.unres_direction & 2 ? 'check-square-o' : 'square-o'}
|
||||
content="South"
|
||||
selected={data.unres_direction & 2}
|
||||
onClick={() => act('direc_set', {
|
||||
unres_direction: '2',
|
||||
})}
|
||||
/>
|
||||
<Button
|
||||
icon={data.unres_direction & 4 ? 'check-square-o' : 'square-o'}
|
||||
content="East"
|
||||
selected={data.unres_direction & 4}
|
||||
onClick={() => act('direc_set', {
|
||||
unres_direction: '4',
|
||||
})}
|
||||
/>
|
||||
<Button
|
||||
icon={data.unres_direction & 8 ? 'check-square-o' : 'square-o'}
|
||||
content="West"
|
||||
selected={data.unres_direction & 8}
|
||||
onClick={() => act('direc_set', {
|
||||
unres_direction: '8',
|
||||
})}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
</LabeledList>
|
||||
</Section>
|
||||
<Section title="Access">
|
||||
<Box height="261px">
|
||||
<Tabs vertical>
|
||||
{regions.map(region => {
|
||||
const { name } = region;
|
||||
const accesses = region.accesses || [];
|
||||
const icon = diffMap[checkAccessIcon(accesses)].icon;
|
||||
return (
|
||||
<Tabs.Tab
|
||||
key={name}
|
||||
icon={icon}
|
||||
label={name}>
|
||||
{() => accesses.map(access => (
|
||||
<Box key={access.id}>
|
||||
<Button
|
||||
icon={access.req ? 'check-square-o' : 'square-o'}
|
||||
content={access.name}
|
||||
selected={access.req}
|
||||
onClick={() => act('set', {
|
||||
access: access.id,
|
||||
})} />
|
||||
</Box>
|
||||
))}
|
||||
</Tabs.Tab>
|
||||
);
|
||||
})}
|
||||
</Tabs>
|
||||
</Box>
|
||||
</Section>
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
@@ -1,112 +0,0 @@
|
||||
import { multiline } from 'common/string';
|
||||
import { Fragment } from 'inferno';
|
||||
import { act } from '../byond';
|
||||
import { Section, LabeledList, Button, NumberInput, Box, Grid } from '../components';
|
||||
|
||||
export const Bepis = props => {
|
||||
const { state } = props;
|
||||
const { config, data } = state;
|
||||
const { ref } = config;
|
||||
const {
|
||||
amount,
|
||||
} = data;
|
||||
return (
|
||||
<Section title="Business Exploration Protocol Incubation Sink">
|
||||
<Section
|
||||
title="Information"
|
||||
backgroundColor="#450F44"
|
||||
buttons={(
|
||||
<Button
|
||||
icon="power-off"
|
||||
content={data.manual_power ? 'Off' : 'On'}
|
||||
selected={!data.manual_power}
|
||||
onClick={() => act(ref, 'toggle_power')} />
|
||||
)}>
|
||||
All you need to know about the B.E.P.I.S. and you!
|
||||
The B.E.P.I.S. performs hundreds of tests a second
|
||||
using electrical and financial resources to invent
|
||||
new products, or discover new technologies otherwise
|
||||
overlooked for being too risky or too niche to produce!
|
||||
</Section>
|
||||
<Section
|
||||
title="Payer's Account"
|
||||
buttons={(
|
||||
<Button
|
||||
icon="redo-alt"
|
||||
content="Reset Account"
|
||||
onClick={() => act(ref, 'account_reset')} />
|
||||
)}>
|
||||
Console is currently being operated
|
||||
by {data.account_owner ? data.account_owner : 'no one'}.
|
||||
</Section>
|
||||
<Grid>
|
||||
<Grid.Column size={1.5}>
|
||||
<Section title="Stored Data and Statistics">
|
||||
<LabeledList>
|
||||
<LabeledList.Item label="Deposited Credits">
|
||||
{data.stored_cash}
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Investment Variability">
|
||||
{data.accuracy_percentage}%
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Innovation Bonus">
|
||||
{data.positive_cash_offset}
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Risk Offset"
|
||||
color="bad">
|
||||
{data.negative_cash_offset}
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Deposit Amount">
|
||||
<NumberInput
|
||||
value={amount}
|
||||
unit="Credits"
|
||||
minValue={100}
|
||||
maxValue={30000}
|
||||
step={100}
|
||||
stepPixelSize={2}
|
||||
onChange={(e, value) => act(ref, 'amount', {
|
||||
amount: value,
|
||||
})} />
|
||||
</LabeledList.Item>
|
||||
</LabeledList>
|
||||
</Section>
|
||||
<Box>
|
||||
<Button
|
||||
icon="donate"
|
||||
content="Deposit Credits"
|
||||
disabled={data.manual_power === 1 || data.silicon_check === 1}
|
||||
onClick={() => act(ref, 'deposit_cash')}
|
||||
/>
|
||||
<Button
|
||||
icon="eject"
|
||||
content="Withdraw Credits"
|
||||
disabled={data.manual_power === 1}
|
||||
onClick={() => act(ref, 'withdraw_cash')} />
|
||||
</Box>
|
||||
</Grid.Column>
|
||||
<Grid.Column>
|
||||
<Section title="Market Data and Analysis">
|
||||
<Box>
|
||||
Average technology cost: {data.mean_value}
|
||||
</Box>
|
||||
<Box>
|
||||
Current chance of Success: Est. {data.success_estimate}%
|
||||
</Box>
|
||||
{data.error_name && (
|
||||
<Box color="bad">
|
||||
Previous Failure Reason: Deposited cash value too low.
|
||||
Please insert more money for future success.
|
||||
</Box>
|
||||
)}
|
||||
<Box m={1} />
|
||||
<Button
|
||||
icon="microscope"
|
||||
disabled={data.manual_power === 1}
|
||||
onClick={() => act(ref, 'begin_experiment')}
|
||||
content="Begin Testing" />
|
||||
</Section>
|
||||
</Grid.Column>
|
||||
</Grid>
|
||||
</Section>
|
||||
);
|
||||
};
|
||||
@@ -1,77 +0,0 @@
|
||||
import { Fragment } from 'inferno';
|
||||
import { useBackend } from '../backend';
|
||||
import { Button, Icon, Input, LabeledList, Section } from '../components';
|
||||
|
||||
export const HypnoChair = props => {
|
||||
const { act, data } = useBackend(props);
|
||||
return (
|
||||
<Fragment>
|
||||
<Section
|
||||
title="Information"
|
||||
backgroundColor="#450F44">
|
||||
The Enhanced Interrogation Chamber is designed to induce a deep-rooted
|
||||
trance trigger into the subject. Once the procedure is complete,
|
||||
by using the implanted trigger phrase, the authorities are able to
|
||||
ensure immediate and complete obedience and truthfulness.
|
||||
</Section>
|
||||
<Section
|
||||
title="Occupant Information"
|
||||
textAlign="center">
|
||||
<LabeledList>
|
||||
<LabeledList.Item label="Name">
|
||||
{data.occupant.name ? data.occupant.name : 'No Occupant'}
|
||||
</LabeledList.Item>
|
||||
{!!data.occupied && (
|
||||
<LabeledList.Item
|
||||
label="Status"
|
||||
color={data.occupant.stat === 0
|
||||
? 'good'
|
||||
: data.occupant.stat === 1
|
||||
? 'average'
|
||||
: 'bad'}>
|
||||
{data.occupant.stat === 0
|
||||
? 'Conscious'
|
||||
: data.occupant.stat === 1
|
||||
? 'Unconcious'
|
||||
: 'Dead'}
|
||||
</LabeledList.Item>
|
||||
)}
|
||||
</LabeledList>
|
||||
</Section>
|
||||
<Section
|
||||
title="Operations"
|
||||
textAlign="center">
|
||||
<LabeledList>
|
||||
<LabeledList.Item label="Door">
|
||||
<Button
|
||||
icon={data.open ? 'unlock' : 'lock'}
|
||||
color={data.open ? 'default' : 'red'}
|
||||
content={data.open ? 'Open' : 'Closed'}
|
||||
onClick={() => act('door')} />
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Trigger Phrase">
|
||||
<Input
|
||||
value={data.trigger}
|
||||
onChange={(e, value) => act('set_phrase', {
|
||||
phrase: value,
|
||||
})} />
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Interrogate Occupant">
|
||||
<Button
|
||||
icon="code-branch"
|
||||
content={data.interrogating
|
||||
? "Interrupt Interrogation"
|
||||
: 'Begin Enhanced Interrogation'}
|
||||
onClick={() => act('interrogate')} />
|
||||
{data.interrogating === 1 && (
|
||||
<Icon
|
||||
name="cog"
|
||||
color="orange"
|
||||
spin />
|
||||
)}
|
||||
</LabeledList.Item>
|
||||
</LabeledList>
|
||||
</Section>
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user