diff --git a/tgui/packages/tgui/interfaces/Tank.js b/tgui/packages/tgui/interfaces/Tank.js index 0922a3efb95..bee6deddea0 100644 --- a/tgui/packages/tgui/interfaces/Tank.js +++ b/tgui/packages/tgui/interfaces/Tank.js @@ -1,54 +1,59 @@ import { useBackend } from '../backend'; import { Button, LabeledList, NumberInput, ProgressBar, Section } from '../components'; +import { Window } from '../layouts'; -export const Tank = props => { - const { act, data } = useBackend(props); +export const Tank = (props, context) => { + const { act, data } = useBackend(context); return ( -
- - - - {data.tankPressure + ' kPa'} - - - -
+ + +
+ + + + {data.tankPressure + ' kPa'} + + + +
+
+
); }; diff --git a/tgui/packages/tgui/interfaces/TankDispenser.js b/tgui/packages/tgui/interfaces/TankDispenser.js index de05a5750b1..a11476df2c8 100644 --- a/tgui/packages/tgui/interfaces/TankDispenser.js +++ b/tgui/packages/tgui/interfaces/TankDispenser.js @@ -1,34 +1,39 @@ import { useBackend } from '../backend'; import { Button, LabeledList, Section } from '../components'; +import { Window } from '../layouts'; -export const TankDispenser = props => { - const { act, data } = useBackend(props); +export const TankDispenser = (props, context) => { + const { act, data } = useBackend(context); return ( -
- - act('plasma')} /> - )}> - {data.plasma} - - act('oxygen')} /> - )}> - {data.oxygen} - - -
+ + +
+ + act('plasma')} /> + )}> + {data.plasma} + + act('oxygen')} /> + )}> + {data.oxygen} + + +
+
+
); }; diff --git a/tgui/packages/tgui/interfaces/Teleporter.js b/tgui/packages/tgui/interfaces/Teleporter.js index 0e0490ea07a..8f61f9d8c4e 100644 --- a/tgui/packages/tgui/interfaces/Teleporter.js +++ b/tgui/packages/tgui/interfaces/Teleporter.js @@ -1,8 +1,9 @@ import { useBackend } from '../backend'; import { Box, Button, LabeledList, Section } from '../components'; +import { Window } from '../layouts'; -export const Teleporter = props => { - const { act, data } = useBackend(props); +export const Teleporter = (props, context) => { + const { act, data } = useBackend(context); const { calibrated, calibrating, @@ -12,58 +13,62 @@ export const Teleporter = props => { target, } = data; return ( -
- {!power_station && ( - - No power station linked. - - ) || (!teleporter_hub && ( - - No hub linked. - - )) || ( - - act('regimeset')} /> - )}> - {regime_set} - - act('settarget')} /> - )}> - {target} - - act('calibrate')} /> - )}> - {calibrating && ( - - In Progress - - ) || (calibrated && ( - - Optimal - - ) || ( - - Sub-Optimal - - ))} - - - )} -
+ + +
+ {!power_station && ( + + No power station linked. + + ) || (!teleporter_hub && ( + + No hub linked. + + )) || ( + + act('regimeset')} /> + )}> + {regime_set} + + act('settarget')} /> + )}> + {target} + + act('calibrate')} /> + )}> + {calibrating && ( + + In Progress + + ) || (calibrated && ( + + Optimal + + ) || ( + + Sub-Optimal + + ))} + + + )} +
+
+
); }; diff --git a/tgui/packages/tgui/interfaces/ThermoMachine.js b/tgui/packages/tgui/interfaces/ThermoMachine.js index acb31e34d7f..40364ebffd5 100644 --- a/tgui/packages/tgui/interfaces/ThermoMachine.js +++ b/tgui/packages/tgui/interfaces/ThermoMachine.js @@ -2,76 +2,79 @@ import { toFixed } from 'common/math'; import { Fragment } from 'inferno'; import { useBackend } from '../backend'; import { AnimatedNumber, Button, LabeledList, NumberInput, Section } from '../components'; +import { Window } from '../layouts'; -export const ThermoMachine = props => { - const { act, data } = useBackend(props); +export const ThermoMachine = (props, context) => { + const { act, data } = useBackend(context); return ( - -
- - - toFixed(value, 2)} /> - {' K'} - - - toFixed(value, 2)} /> - {' kPa'} - - -
-
act('power')} /> - )}> - - - act('target', { - target: value, - })} /> - - + + +
+ + + toFixed(value, 2)} /> + {' K'} + + + toFixed(value, 2)} /> + {' kPa'} + + +
+
act('target', { - target: data.min, - })} /> -
- + icon={data.on ? 'power-off' : 'times'} + content={data.on ? 'On' : 'Off'} + selected={data.on} + onClick={() => act('power')} /> + )}> + + + act('target', { + target: value, + })} /> + + +
+ + ); }; diff --git a/tgui/packages/tgui/interfaces/Timer.js b/tgui/packages/tgui/interfaces/Timer.js index 86b49cbac72..9ba3366a68d 100644 --- a/tgui/packages/tgui/interfaces/Timer.js +++ b/tgui/packages/tgui/interfaces/Timer.js @@ -1,9 +1,10 @@ import { Fragment } from 'inferno'; import { useBackend } from '../backend'; import { Button, Section } from '../components'; +import { Window } from '../layouts'; -export const Timer = props => { - const { act, data } = useBackend(props); +export const Timer = (props, context) => { + const { act, data } = useBackend(context); const { minutes, seconds, @@ -11,42 +12,46 @@ export const Timer = props => { loop, } = data; return ( -
+ + +
+
+ icon="backward" + disabled={timing} + onClick={() => act('input', { adjust: -1 })} /> + {' '} + {String(minutes).padStart(2, '0')}: + {String(seconds).padStart(2, '0')} + {' '} +
+ + ); }; diff --git a/tgui/packages/tgui/interfaces/TransferValve.js b/tgui/packages/tgui/interfaces/TransferValve.js index ed480a97b1b..c66883b6db2 100644 --- a/tgui/packages/tgui/interfaces/TransferValve.js +++ b/tgui/packages/tgui/interfaces/TransferValve.js @@ -1,9 +1,10 @@ import { Fragment } from 'inferno'; import { useBackend } from '../backend'; import { Button, LabeledList, NoticeBox, Section } from '../components'; +import { Window } from '../layouts'; -export const TransferValve = props => { - const { act, data } = useBackend(props); +export const TransferValve = (props, context) => { + const { act, data } = useBackend(context); const { tank_one, tank_two, @@ -11,78 +12,80 @@ export const TransferValve = props => { valve, } = data; return ( - -
- - + + +
+ + +
+
act('toggle')} /> - - -
-
act('device')} /> - )}> - - {attached_device ? ( - -
-
- - {tank_one ? ( - -
-
- - {tank_two ? ( - -
- + textAlign="center" + width="30px" + icon={"cog"} + disabled={(!attached_device)} + onClick={() => act('device')} /> + )}> + + {attached_device ? ( + +
+
+ + {tank_one ? ( + +
+
+ + {tank_two ? ( + +
+ + ); }; diff --git a/tgui/packages/tgui/interfaces/TurbineComputer.js b/tgui/packages/tgui/interfaces/TurbineComputer.js index 4f632cc149f..1f851286822 100644 --- a/tgui/packages/tgui/interfaces/TurbineComputer.js +++ b/tgui/packages/tgui/interfaces/TurbineComputer.js @@ -1,64 +1,69 @@ import { Fragment } from 'inferno'; import { useBackend } from '../backend'; import { Button, LabeledList, Section } from '../components'; +import { Window } from '../layouts'; -export const TurbineComputer = props => { - const { act, data } = useBackend(props); +export const TurbineComputer = (props, context) => { + const { act, data } = useBackend(context); const operational = Boolean(data.compressor && !data.compressor_broke && data.turbine && !data.turbine_broke); return ( -
-
+ + +
+
+
+
); }; diff --git a/tgui/packages/tgui/interfaces/Uplink.js b/tgui/packages/tgui/interfaces/Uplink.js index 4f2b047c9b5..be245dc4d2f 100644 --- a/tgui/packages/tgui/interfaces/Uplink.js +++ b/tgui/packages/tgui/interfaces/Uplink.js @@ -2,6 +2,8 @@ import { decodeHtmlEntities } from 'common/string'; import { Component, Fragment } from 'inferno'; import { act } from '../byond'; import { Box, Button, Input, Section, Table, Tabs } from '../components'; +import { useBackend } from '../backend'; +import { Window } from '../layouts'; // It's a class because we need to store state in the form of the current // hovered item, and current search terms @@ -27,9 +29,7 @@ export class Uplink extends Component { } render() { - const { state } = this.props; - const { config, data } = state; - const { ref } = config; + const { act, data } = useBackend(this.context); const { compact_mode, lockable, @@ -38,84 +38,90 @@ export class Uplink extends Component { } = data; const { hoveredItem, currentSearch } = this.state; return ( -
0 ? 'good' : 'bad'}> - {telecrystals} TC - - )} - buttons={( - - Search - this.setSearchText(value)} - ml={1} - mr={1} /> -
+ + ); } } diff --git a/tgui/packages/tgui/interfaces/VaultController.js b/tgui/packages/tgui/interfaces/VaultController.js index dc6cbfa00f2..f5fb00add92 100644 --- a/tgui/packages/tgui/interfaces/VaultController.js +++ b/tgui/packages/tgui/interfaces/VaultController.js @@ -1,33 +1,38 @@ import { toFixed } from 'common/math'; import { useBackend } from '../backend'; import { Button, LabeledList, ProgressBar, Section } from '../components'; +import { Window } from '../layouts'; -export const VaultController = props => { - const { act, data } = useBackend(props); +export const VaultController = (props, context) => { + const { act, data } = useBackend(context); return ( -
act('togglelock')} /> - )}> - - - - {toFixed(data.stored / 1000) + ' / ' + + +
act('togglelock')} /> + )}> + + + + {toFixed(data.stored / 1000) + ' / ' + toFixed(data.max / 1000) + ' kW'} - - - -
+
+
+
+
+ + ); }; diff --git a/tgui/packages/tgui/interfaces/Vending.js b/tgui/packages/tgui/interfaces/Vending.js index 8d252291ba7..74d7566e91a 100644 --- a/tgui/packages/tgui/interfaces/Vending.js +++ b/tgui/packages/tgui/interfaces/Vending.js @@ -2,9 +2,95 @@ import { classes } from 'common/react'; import { Fragment } from 'inferno'; import { useBackend } from '../backend'; import { Box, Button, Section, Table } from '../components'; +import { Window } from '../layouts'; -export const Vending = props => { - const { act, data } = useBackend(props); +export const VendingRow = (props, context) => { + const { act, data } = useBackend(context); + + const { + product, + productStock, + custom, + } = props; + + const free = ( + !data.onstation + || product.price === 0 + || ( + !product.premium + && data.department + && data.user + && data.department === data.user.department + ) + ); + + return ( + + + {product.base64 ? ( + + ) : ( + + )} + + + {product.name} + + + + {productStock} in stock + + + + {custom && ( +