mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13.git
synced 2026-08-26 02:46:56 +01:00
update
This commit is contained in:
@@ -2,7 +2,7 @@ import { useBackend, useLocalState } from '../backend';
|
||||
import { Button, LabeledList, Section, Box, NoticeBox, Table } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
import { AdventureDataProvider, AdventureScreen } from './ExodroneConsole';
|
||||
import { formatTime } from '../format';
|
||||
import { formatTime } from 'tgui-core/format';
|
||||
|
||||
type Adventure = {
|
||||
ref: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { filter } from 'common/collections';
|
||||
import { flow } from 'common/fp';
|
||||
import { createSearch } from 'common/string';
|
||||
import { createSearch } from 'tgui-core/string';
|
||||
import { useBackend } from '../backend';
|
||||
import { Button, Collapsible, Icon, Input, Section, Stack, Tabs } from 'tgui-core/components';
|
||||
import { useLocalState } from '../backend';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
import { multiline } from 'common/string';
|
||||
import { multiline } from 'tgui-core/string';
|
||||
import { BlockQuote, Button, Dimmer, Section, Stack } from 'tgui-core/components';
|
||||
import { BooleanLike } from 'common/react';
|
||||
import { Window } from '../layouts';
|
||||
@@ -51,11 +51,11 @@ const ObjectivePrintout = (props) => {
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
{!objectives && "None!"
|
||||
|| objectives.map(objective => (
|
||||
<Stack.Item key={objective.count}>
|
||||
#{objective.count}: {objective.explanation}
|
||||
</Stack.Item>
|
||||
)) }
|
||||
|| objectives.map(objective => (
|
||||
<Stack.Item key={objective.count}>
|
||||
#{objective.count}: {objective.explanation}
|
||||
</Stack.Item>
|
||||
))}
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
);
|
||||
@@ -148,20 +148,20 @@ const UplinkSection = (props) => {
|
||||
</Stack.Item>
|
||||
</Dimmer>
|
||||
) || (
|
||||
<>
|
||||
<Stack.Item bold>
|
||||
{uplink_intro}
|
||||
<br />
|
||||
<span style={goalstyle}>Code: {code}</span>
|
||||
</Stack.Item>
|
||||
<Stack.Divider />
|
||||
<Stack.Item mt="1%">
|
||||
<BlockQuote>
|
||||
{uplink_unlock_info}
|
||||
</BlockQuote>
|
||||
</Stack.Item>
|
||||
</>
|
||||
)}
|
||||
<>
|
||||
<Stack.Item bold>
|
||||
{uplink_intro}
|
||||
<br />
|
||||
<span style={goalstyle}>Code: {code}</span>
|
||||
</Stack.Item>
|
||||
<Stack.Divider />
|
||||
<Stack.Item mt="1%">
|
||||
<BlockQuote>
|
||||
{uplink_unlock_info}
|
||||
</BlockQuote>
|
||||
</Stack.Item>
|
||||
</>
|
||||
)}
|
||||
</Stack>
|
||||
</Section>
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
import { Button, LabeledList, Section, ProgressBar, Flex, Box, Table, Collapsible, Input, Dimmer, Icon } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
import { capitalize } from "common/string";
|
||||
import { capitalize } from "tgui-core/string";
|
||||
|
||||
export const Autolathe = (props) => {
|
||||
const { act, data } = useBackend<any>();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { multiline } from 'common/string';
|
||||
import { multiline } from 'tgui-core/string';
|
||||
import { useBackend } from '../backend';
|
||||
import { Button, Input, LabeledList, Section } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useBackend } from '../backend';
|
||||
import { AnimatedNumber, Button, LabeledList, NoticeBox, Section } from 'tgui-core/components';
|
||||
import { formatMoney } from '../format';
|
||||
import { formatMoney } from 'tgui-core/format';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
export const BankMachine = (props) => {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { classes } from 'common/react';
|
||||
import { createSearch } from 'common/string';
|
||||
import { createSearch } from 'tgui-core/string';
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
import { Box, Button, Dimmer, Flex, Icon, Input, NoticeBox, NumberInput, Section, Table, Tabs } from 'tgui-core/components';
|
||||
import { formatMoney } from '../format';
|
||||
import { formatMoney } from 'tgui-core/format';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
const MAX_SEARCH_RESULTS = 25;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useBackend } from '../backend';
|
||||
import { AnimatedNumber, Box, Button, Flex, Modal, Section, Stack, Tabs } from 'tgui-core/components';
|
||||
import { formatMoney } from '../format';
|
||||
import { formatMoney } from 'tgui-core/format';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
export const BlackMarketUplink = (props) => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { filter, sortBy } from 'common/collections';
|
||||
import { flow } from 'common/fp';
|
||||
import { toFixed } from 'common/math';
|
||||
import { multiline } from 'common/string';
|
||||
import { multiline } from 'tgui-core/string';
|
||||
import { useBackend } from '../backend';
|
||||
import { Button, Divider, LabeledList, NumberInput, ProgressBar, Section, Stack, Box } from 'tgui-core/components';
|
||||
import { getGasColor, getGasLabel } from '../constants';
|
||||
@@ -122,16 +122,16 @@ export const BluespaceVendor = (props) => {
|
||||
gas_id: gas.id,
|
||||
})} />
|
||||
) || (
|
||||
<Button
|
||||
ml={1}
|
||||
disabled={data.selected_gas !== gas.id}
|
||||
icon="minus"
|
||||
tooltipPosition="left"
|
||||
tooltip={"Stop adding " + gas.name + "."}
|
||||
onClick={() => act('stop_pumping', {
|
||||
gas_id: gas.id,
|
||||
})} />
|
||||
)}
|
||||
<Button
|
||||
ml={1}
|
||||
disabled={data.selected_gas !== gas.id}
|
||||
icon="minus"
|
||||
tooltipPosition="left"
|
||||
tooltip={"Stop adding " + gas.name + "."}
|
||||
onClick={() => act('stop_pumping', {
|
||||
gas_id: gas.id,
|
||||
})} />
|
||||
)}
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
<Divider />
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { filter, sortBy } from 'common/collections';
|
||||
import { flow } from 'common/fp';
|
||||
import { classes } from 'common/react';
|
||||
import { createSearch } from 'common/string';
|
||||
import { createSearch } from 'tgui-core/string';
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
import { Button, ByondUi, Flex, Input, Section } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
@@ -115,8 +115,8 @@ export const CameraConsoleContent = (props) => {
|
||||
fill
|
||||
scrollable>
|
||||
{cameras.map(camera => (
|
||||
// We're not using the component here because performance
|
||||
// would be absolutely abysmal (50+ ms for each re-render).
|
||||
// We're not using the component here because performance
|
||||
// would be absolutely abysmal (50+ ms for each re-render).
|
||||
<div
|
||||
key={camera.name}
|
||||
title={camera.name}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { toFixed } from 'common/math';
|
||||
import { useBackend } from '../backend';
|
||||
import { Box, Button, Flex, Icon, Knob, LabeledControls, LabeledList, RoundGauge, Section, Tooltip } from 'tgui-core/components';
|
||||
import { formatSiUnit } from '../format';
|
||||
import { formatSiUnit } from 'tgui-core/format';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
const formatPressure = value => {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { toArray } from 'common/collections';
|
||||
import { Fragment } from 'react';
|
||||
import { useBackend, useSharedState } from '../backend';
|
||||
import { AnimatedNumber, Box, Button, Flex, LabeledList, Section, Table, Tabs } from 'tgui-core/components';
|
||||
import { formatMoney } from '../format';
|
||||
import { formatMoney } from 'tgui-core/format';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
export const Cargo = (props) => {
|
||||
@@ -10,7 +10,7 @@ export const Cargo = (props) => {
|
||||
<Window
|
||||
width={780}
|
||||
height={750}
|
||||
>
|
||||
>
|
||||
<Window.Content scrollable>
|
||||
<CargoContent />
|
||||
</Window.Content>
|
||||
@@ -98,7 +98,7 @@ const CargoStatus = (props) => {
|
||||
)}>
|
||||
<LabeledList>
|
||||
<LabeledList.Item label="Shuttle">
|
||||
{docked && !requestonly && can_send &&(
|
||||
{docked && !requestonly && can_send && (
|
||||
<Button
|
||||
content={location}
|
||||
onClick={() => act('send')} />
|
||||
@@ -115,10 +115,10 @@ const CargoStatus = (props) => {
|
||||
disabled={!(away && docked)}
|
||||
onClick={() => act('loan')} />
|
||||
) || (
|
||||
<Box color="bad">
|
||||
Loaned to Centcom
|
||||
</Box>
|
||||
)}
|
||||
<Box color="bad">
|
||||
Loaned to Centcom
|
||||
</Box>
|
||||
)}
|
||||
</LabeledList.Item>
|
||||
)}
|
||||
</LabeledList>
|
||||
@@ -261,7 +261,7 @@ const CargoRequests = (props) => {
|
||||
<Table.Cell collapsing textAlign="right">
|
||||
{formatMoney(request.cost)} cr
|
||||
</Table.Cell>
|
||||
{(!requestonly || can_send)&& can_approve_requests &&(
|
||||
{(!requestonly || can_send) && can_approve_requests && (
|
||||
<Table.Cell collapsing>
|
||||
<Button
|
||||
icon="check"
|
||||
@@ -357,7 +357,7 @@ const CargoCart = (props) => {
|
||||
{formatMoney(entry.cost)} cr
|
||||
</Table.Cell>
|
||||
<Table.Cell collapsing>
|
||||
{can_send &&(
|
||||
{can_send && (
|
||||
<Button
|
||||
icon="minus"
|
||||
onClick={() => act('remove', {
|
||||
@@ -381,10 +381,10 @@ const CargoCart = (props) => {
|
||||
content="Confirm the order"
|
||||
onClick={() => act('send')} />
|
||||
) || (
|
||||
<Box opacity={0.5}>
|
||||
Shuttle in {location}.
|
||||
</Box>
|
||||
)}
|
||||
<Box opacity={0.5}>
|
||||
Shuttle in {location}.
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
)}
|
||||
</Section>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useBackend } from '../backend';
|
||||
import { AnimatedNumber, Box, Button, Section, Table } from 'tgui-core/components';
|
||||
import { formatMoney } from '../format';
|
||||
import { formatMoney } from 'tgui-core/format';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
export const CargoBountyConsole = (props) => {
|
||||
@@ -12,7 +12,7 @@ export const CargoBountyConsole = (props) => {
|
||||
<Window
|
||||
width={750}
|
||||
height={600}
|
||||
>
|
||||
>
|
||||
<Window.Content scrollable>
|
||||
<Section
|
||||
title={<BountyHeader />}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { toFixed } from 'common/math';
|
||||
import { classes } from 'common/react';
|
||||
import { storage } from 'common/storage';
|
||||
import { multiline } from 'common/string';
|
||||
import { multiline } from 'tgui-core/string';
|
||||
import { createUuid } from 'common/uuid';
|
||||
import { Component, Fragment } from 'react';
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
@@ -799,13 +799,13 @@ class PresetsPage extends Component {
|
||||
const [
|
||||
presetIndex,
|
||||
setSelectedPreset,
|
||||
] = useLocalState(this.context, 'presetIndex', 0);
|
||||
] = useLocalState(this.'presetIndex', 0);
|
||||
const [
|
||||
settingName,
|
||||
setEditingNameStatus,
|
||||
] = useLocalState(this.context, 'settingName', 0);
|
||||
const [newNameText, setText] = useLocalState(this.context, 'newNameText', "");
|
||||
const [hue, setHue] = useLocalState(this.context, 'hue', 0);
|
||||
] = useLocalState(this.'settingName', 0);
|
||||
const [newNameText, setText] = useLocalState(this.'newNameText', "");
|
||||
const [hue, setHue] = useLocalState(this.'hue', 0);
|
||||
return (
|
||||
<Section scrollable
|
||||
fill
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { toFixed } from 'common/math';
|
||||
import { toTitleCase } from 'common/string';
|
||||
import { toTitleCase } from 'tgui-core/string';
|
||||
import { Fragment } from 'react';
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
import { AnimatedNumber, Box, Button, Icon, LabeledList, ProgressBar, Section, Table, NumberInput } from 'tgui-core/components';
|
||||
@@ -9,9 +9,9 @@ export const ChemDispenser = (props) => {
|
||||
const { act, data } = useBackend<any>();
|
||||
const recording = !!data.recordingRecipe;
|
||||
const [hasCol, setHasCol] = useLocalState(
|
||||
context, 'fs_title', false);
|
||||
'fs_title', false);
|
||||
const [modeToggle, setModeToggle] = useLocalState(
|
||||
context, 'mode_toggle', true);
|
||||
'mode_toggle', true);
|
||||
const {
|
||||
storedContents = [],
|
||||
} = data;
|
||||
@@ -36,7 +36,7 @@ export const ChemDispenser = (props) => {
|
||||
<Window
|
||||
width={565}
|
||||
height={data.canStore ? 720 : 620}
|
||||
>
|
||||
>
|
||||
<Window.Content scrollable>
|
||||
<Section
|
||||
title="Status"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
import { useBackend, useLocalState, useSharedState } from '../backend';
|
||||
import { createSearch } from 'common/string';
|
||||
import { createSearch } from 'tgui-core/string';
|
||||
import { map } from 'common/collections';
|
||||
import { Section, Tabs, Table, Button, Box, NoticeBox, Divider, Input } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { sortBy } from "common/collections";
|
||||
import { capitalize } from "common/string";
|
||||
import { capitalize } from "tgui-core/string";
|
||||
import { useBackend, useLocalState } from "../backend";
|
||||
import { Blink, Box, Button, Dimmer, Flex, Icon, Input, Modal, Section, TextArea } from "tgui-core/components";
|
||||
import { Window } from "../layouts";
|
||||
@@ -321,13 +321,13 @@ const PageMain = (props) => {
|
||||
} = data;
|
||||
|
||||
const [callingShuttle, setCallingShuttle] = useLocalState(
|
||||
context, "calling_shuttle", false);
|
||||
"calling_shuttle", false);
|
||||
const [messagingAssociates, setMessagingAssociates] = useLocalState(
|
||||
context, "messaging_associates", false);
|
||||
"messaging_associates", false);
|
||||
const [messagingSector, setMessagingSector] = useLocalState(
|
||||
context, "messaing_sector", null);
|
||||
"messaing_sector", null);
|
||||
const [requestingNukeCodes, setRequestingNukeCodes] = useLocalState(
|
||||
context, "requesting_nuke_codes", false);
|
||||
"requesting_nuke_codes", false);
|
||||
|
||||
const [
|
||||
[showAlertLevelConfirm, confirmingAlertLevelTick],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createSearch } from 'common/string';
|
||||
import { createSearch } from 'tgui-core/string';
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
import { Material, MaterialAmount, MaterialFormatting, Materials, MATERIAL_KEYS } from './common/Materials';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { multiline } from 'common/string';
|
||||
import { multiline } from 'tgui-core/string';
|
||||
import { useBackend } from '../backend';
|
||||
import { Box, Button, Section, Table, Tooltip } from 'tgui-core/components';
|
||||
import { Box, Button, Section, Table, Tooltip } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
import { Grid } from '../components/Grid';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { multiline } from 'common/string';
|
||||
import { multiline } from 'tgui-core/string';
|
||||
import { useBackend } from '../backend';
|
||||
import { Button, Input, LabeledList, Section } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { filter, uniqBy } from 'common/collections';
|
||||
import { flow } from 'common/fp';
|
||||
import { classes } from 'common/react';
|
||||
import { capitalize } from 'common/string';
|
||||
import { capitalize } from 'tgui-core/string';
|
||||
import { Fragment } from 'react';
|
||||
import { resolveAsset } from '../assets';
|
||||
import { useBackend } from '../backend';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useBackend } from '../backend';
|
||||
import { Box, Button, Section, NoticeBox } from 'tgui-core/components';
|
||||
import { toTitleCase } from 'common/string';
|
||||
import { Box, Button, Section, NoticeBox } from 'tgui-core/components';
|
||||
import { toTitleCase } from 'tgui-core/string';
|
||||
import { Window } from '../layouts';
|
||||
import { Grid } from '../components/Grid';
|
||||
|
||||
@@ -19,8 +19,8 @@ export const EightBallVote = (props) => {
|
||||
No question is currently being asked.
|
||||
</NoticeBox>
|
||||
) || (
|
||||
<EightBallVoteQuestion />
|
||||
)}
|
||||
<EightBallVoteQuestion />
|
||||
)}
|
||||
</Window.Content>
|
||||
</Window>
|
||||
);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { decodeHtmlEntities } from 'common/string';
|
||||
import { decodeHtmlEntities } from 'tgui-core/string';
|
||||
import { useBackend } from '../backend';
|
||||
import { Box, Button, LabeledList, Section, Stack } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
@@ -2,8 +2,8 @@ import { useBackend, useLocalState } from '../backend';
|
||||
import { BlockQuote, Box, Button, Dimmer, Icon, LabeledList, Modal, ProgressBar, Section, Stack } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
import { resolveAsset } from '../assets';
|
||||
import { formatTime } from '../format';
|
||||
import { capitalize } from 'common/string';
|
||||
import { formatTime } from 'tgui-core/format';
|
||||
import { capitalize } from 'tgui-core/string';
|
||||
import nt_logo from '../assets/bg-nanotrasen.svg';
|
||||
import { Fragment } from 'react';
|
||||
|
||||
@@ -196,11 +196,11 @@ const DroneSelectionSection = (props) => {
|
||||
{drone.controlled && (
|
||||
"Controlled by another console."
|
||||
) || (
|
||||
<Button
|
||||
content="Assume Control"
|
||||
icon="plug"
|
||||
onClick={() => act("select_drone", { "drone_ref": drone.ref })} />
|
||||
)}
|
||||
<Button
|
||||
content="Assume Control"
|
||||
icon="plug"
|
||||
onClick={() => act("select_drone", { "drone_ref": drone.ref })} />
|
||||
)}
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
</Stack.Item>
|
||||
@@ -254,11 +254,11 @@ const ToolSelectionModal = (props) => {
|
||||
</Button>
|
||||
</Stack.Item>
|
||||
)) || (
|
||||
<Stack.Item>
|
||||
<Button
|
||||
content="Back" />
|
||||
</Stack.Item>
|
||||
)}
|
||||
<Stack.Item>
|
||||
<Button
|
||||
content="Back" />
|
||||
</Stack.Item>
|
||||
)}
|
||||
</Stack>
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
@@ -495,7 +495,7 @@ const TravelTargetSelectionScreen = (props) => {
|
||||
act("start_travel", { "target_site": ref });
|
||||
};
|
||||
|
||||
const non_empty_bands = (dest : SiteData) => {
|
||||
const non_empty_bands = (dest: SiteData) => {
|
||||
const band_check = (s: string) => dest.band_info[s] !== undefined
|
||||
&& dest.band_info[s] !== 0;
|
||||
return Object.keys(all_bands).filter(band_check);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useBackend } from '../backend';
|
||||
import { BlockQuote, Box, Button, Flex, Icon, Modal, Section, LabeledList, NoticeBox, Stack } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
import { formatTime } from '../format';
|
||||
import { formatTime } from 'tgui-core/format';
|
||||
|
||||
|
||||
type SiteData = {
|
||||
@@ -223,8 +223,8 @@ export const ExoscannerConsole = (props) => {
|
||||
size={3} />
|
||||
</>
|
||||
) || (
|
||||
"No properly configured scanner arrays detected."
|
||||
)}
|
||||
"No properly configured scanner arrays detected."
|
||||
)}
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
<Section title="Special Scan Condtions">
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { uniqBy } from 'common/collections';
|
||||
import { createSearch } from 'common/string';
|
||||
import { createSearch } from 'tgui-core/string';
|
||||
import { Fragment } from 'react';
|
||||
import { useBackend, useSharedState } from '../backend';
|
||||
import { Box, Button, Icon, Input, ProgressBar, Section, Stack } from 'tgui-core/components';
|
||||
import { Materials, MaterialAmount, MaterialFormatting } from './common/Materials';
|
||||
import { formatMoney } from '../format';
|
||||
import { formatMoney } from 'tgui-core/format';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
const COLOR_NONE = 0;
|
||||
@@ -119,7 +119,7 @@ export const ExosuitFabricator = (props) => {
|
||||
textColors,
|
||||
} = queueCondFormat(materialAsObj, queue);
|
||||
const [displayMatCost, setDisplayMatCost] = useSharedState(
|
||||
context, 'display_mats', false);
|
||||
'display_mats', false);
|
||||
return (
|
||||
<Window
|
||||
title="Exosuit Fabricator"
|
||||
@@ -191,7 +191,7 @@ const PartSets = (props) => {
|
||||
const partSets = data.partSets || [];
|
||||
const buildableParts = data.buildableParts || {};
|
||||
const [selectedPartTab, setSelectedPartTab] = useSharedState(
|
||||
context, 'part_tab', partSets.length ? buildableParts[0] : '');
|
||||
'part_tab', partSets.length ? buildableParts[0] : '');
|
||||
return partSets
|
||||
.filter(set => buildableParts[set])
|
||||
.map(set => (
|
||||
|
||||
@@ -4,7 +4,7 @@ import { classes } from 'common/react';
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
import { Box, Button, LabeledList, Section, Stack } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
import { capitalize } from 'common/string';
|
||||
import { capitalize } from 'tgui-core/string';
|
||||
|
||||
export const FishCatalog = (props) => {
|
||||
const { act, data } = useBackend<any>();
|
||||
|
||||
@@ -4,7 +4,7 @@ import { toFixed } from 'common/math';
|
||||
import { useBackend } from '../backend';
|
||||
import { Button, LabeledList, NumberInput, ProgressBar, Section, Stack, Box } from 'tgui-core/components';
|
||||
import { getGasColor, getGasLabel } from '../constants';
|
||||
import { formatSiBaseTenUnit, formatSiUnit } from '../format';
|
||||
import { formatSiBaseTenUnit, formatSiUnit } from 'tgui-core/format';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
export const Hypertorus = (props) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { toTitleCase } from 'common/string';
|
||||
import { toTitleCase } from 'tgui-core/string';
|
||||
import { useBackend } from '../backend';
|
||||
import { Box, Button, LabeledList, Section, Table } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
@@ -13,7 +13,7 @@ export const Limbgrower = (props) => {
|
||||
disk = [],
|
||||
} = data;
|
||||
const [tab, setTab] = useSharedState(
|
||||
context, 'category', categories[0]?.name);
|
||||
'category', categories[0]?.name);
|
||||
const designList = categories
|
||||
.find(category => category.name === tab)
|
||||
?.designs;
|
||||
|
||||
@@ -23,21 +23,21 @@ export const ListInput = (props) => {
|
||||
|
||||
// Search
|
||||
const [showSearchBar, setShowSearchBar] = useLocalState(
|
||||
context, 'search_bar', false);
|
||||
'search_bar', false);
|
||||
const [displayedArray, setDisplayedArray] = useLocalState(
|
||||
context, 'displayed_array', buttons);
|
||||
'displayed_array', buttons);
|
||||
|
||||
// KeyPress
|
||||
const [searchArray, setSearchArray] = useLocalState(
|
||||
context, 'search_array', []);
|
||||
'search_array', []);
|
||||
const [searchIndex, setSearchIndex] = useLocalState(
|
||||
context, 'search_index', 0);
|
||||
'search_index', 0);
|
||||
const [lastCharCode, setLastCharCode] = useLocalState(
|
||||
context, 'last_char_code', null);
|
||||
'last_char_code', null);
|
||||
|
||||
// Selected Button
|
||||
const [selectedButton, setSelectedButton] = useLocalState(
|
||||
context, 'selected_button', buttons[0]);
|
||||
'selected_button', buttons[0]);
|
||||
|
||||
const handleKeyDown = e => {
|
||||
e.preventDefault();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useBackend } from '../backend';
|
||||
import { Box, Stack, Section, ByondUi, Slider, Flex, Button } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
import { capitalize } from 'common/string';
|
||||
import { capitalize } from 'tgui-core/string';
|
||||
|
||||
const colorToMatrix = (param) => {
|
||||
switch (param) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { classes } from 'common/react';
|
||||
import { multiline } from 'common/string';
|
||||
import { multiline } from 'tgui-core/string';
|
||||
import { useBackend } from '../backend';
|
||||
import { Box, Button, Collapsible, Flex, NoticeBox, Section, Stack, TimeDisplay } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { multiline } from 'common/string';
|
||||
import { multiline } from 'tgui-core/string';
|
||||
import { useBackend, useSharedState } from '../backend';
|
||||
import { AnimatedNumber, Box, Button, Flex, Icon, LabeledList, ProgressBar, Section, Stack } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useBackend } from '../backend';
|
||||
import { AnimatedNumber, Box, Button, Section, Table } from 'tgui-core/components';
|
||||
import { formatMoney } from '../format';
|
||||
import { formatMoney } from 'tgui-core/format';
|
||||
import { NtosWindow } from '../layouts';
|
||||
|
||||
export const NtosBountyConsole = (props) => {
|
||||
@@ -12,7 +12,7 @@ export const NtosBountyConsole = (props) => {
|
||||
<NtosWindow
|
||||
width={750}
|
||||
height={600}
|
||||
>
|
||||
>
|
||||
<NtosWindow.Content scrollable>
|
||||
<Section
|
||||
title={<BountyHeader />}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { filter, sortBy } from 'common/collections';
|
||||
import { flow } from 'common/fp';
|
||||
import { classes } from 'common/react';
|
||||
import { createSearch } from 'common/string';
|
||||
import { createSearch } from 'tgui-core/string';
|
||||
import { Fragment } from 'react';
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
import { Button, ByondUi, Input, Section } from 'tgui-core/components';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { classes } from 'common/react';
|
||||
import { createSearch } from 'common/string';
|
||||
import { multiline } from 'common/string';
|
||||
import { createSearch } from 'tgui-core/string';
|
||||
import { multiline } from 'tgui-core/string';
|
||||
import { resolveAsset } from '../assets';
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
import { Box, Button, Divider, Flex, Icon, Input, Section } from 'tgui-core/components';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { toTitleCase } from 'common/string';
|
||||
import { toTitleCase } from 'tgui-core/string';
|
||||
import { Box, Button, Section, Table } from 'tgui-core/components';
|
||||
import { useBackend } from '../backend';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { toTitleCase } from 'common/string';
|
||||
import { toTitleCase } from 'tgui-core/string';
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
import { BlockQuote, Box, Button, NumberInput, Section, Table } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { multiline } from 'common/string';
|
||||
import { multiline } from 'tgui-core/string';
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
import { Box, Button, Dimmer, Divider, Icon, NumberInput, Section, Stack } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
@@ -167,21 +167,21 @@ const AdventureStatus = (props) => {
|
||||
<Button
|
||||
fluid
|
||||
icon="wrench"
|
||||
content={"Hull Parts: "+hull}
|
||||
content={"Hull Parts: " + hull}
|
||||
color="average" />
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
<Button
|
||||
fluid
|
||||
icon="server"
|
||||
content={"Electronics: "+electronics}
|
||||
content={"Electronics: " + electronics}
|
||||
color="blue" />
|
||||
</Stack.Item>
|
||||
<Stack.Item mb={1}>
|
||||
<Button
|
||||
fluid
|
||||
icon="rocket"
|
||||
content={"Engine Parts: "+engine}
|
||||
content={"Engine Parts: " + engine}
|
||||
color="violet" />
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
@@ -373,11 +373,11 @@ const ORION_STATUS_NORMAL = (props) => {
|
||||
<Stack fill textAlign="center" vertical>
|
||||
<Stack.Item grow >
|
||||
<Box bold fontSize="15px">
|
||||
{!!eventname && eventname || locationInfo[turns-1].title}
|
||||
{!!eventname && eventname || locationInfo[turns - 1].title}
|
||||
</Box>
|
||||
<br />
|
||||
<Box fontSize="15px">
|
||||
{!!eventtext && eventtext || locationInfo[turns-1].blurb}
|
||||
{!!eventtext && eventtext || locationInfo[turns - 1].blurb}
|
||||
</Box>
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
@@ -394,14 +394,14 @@ const ORION_STATUS_NORMAL = (props) => {
|
||||
</Stack.Item>
|
||||
))
|
||||
) || (
|
||||
<Button
|
||||
mb={1}
|
||||
lineHeight={3}
|
||||
width={16}
|
||||
icon="arrow-right"
|
||||
content="Continue"
|
||||
onClick={() => act('continue')} />
|
||||
)}
|
||||
<Button
|
||||
mb={1}
|
||||
lineHeight={3}
|
||||
width={16}
|
||||
icon="arrow-right"
|
||||
content="Continue"
|
||||
onClick={() => act('continue')} />
|
||||
)}
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
</Section>
|
||||
@@ -483,9 +483,9 @@ const ORION_STATUS_MARKET = (props) => {
|
||||
to dock again would be certain death.
|
||||
</Box>
|
||||
) || (
|
||||
"Hello, Pioneer! We have supplies for you to help \
|
||||
"Hello, Pioneer! We have supplies for you to help \
|
||||
you reach Orion. They aren't free, though!"
|
||||
)}
|
||||
)}
|
||||
</Box>
|
||||
</Stack.Item>
|
||||
{spaceport_raided && (
|
||||
@@ -497,108 +497,108 @@ const ORION_STATUS_MARKET = (props) => {
|
||||
<Stack.Item grow />
|
||||
</>
|
||||
) || (
|
||||
<>
|
||||
<Stack.Item>
|
||||
General Markets:
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
<Stack mb={-1} fill>
|
||||
<Stack.Item grow basis={0}>
|
||||
<Stack vertical>
|
||||
<Stack.Item>
|
||||
<Button
|
||||
fluid
|
||||
icon="gas-pump"
|
||||
content={"5 Food -> 5 Fuel"}
|
||||
color="green"
|
||||
onClick={() => act('trade', {
|
||||
what: 2,
|
||||
})} />
|
||||
</Stack.Item>
|
||||
<Divider />
|
||||
<Stack.Item mt={0}>
|
||||
Port Hangar Bay:
|
||||
</Stack.Item>
|
||||
<Stack.Item mb={marketButtonSpacing}>
|
||||
<Button
|
||||
fluid
|
||||
icon="wrench"
|
||||
content={"5 Fuel for Hull Plates"}
|
||||
color="average"
|
||||
onClick={() => act('buyparts', {
|
||||
part: 2,
|
||||
})} />
|
||||
</Stack.Item>
|
||||
<Stack.Item mb={marketButtonSpacing}>
|
||||
<Button
|
||||
fluid
|
||||
icon="server"
|
||||
content={"5 Fuel for Electronics"}
|
||||
color="blue"
|
||||
onClick={() => act('buyparts', {
|
||||
part: 3,
|
||||
})} />
|
||||
</Stack.Item>
|
||||
<Stack.Item mb={marketButtonSpacing}>
|
||||
<Button
|
||||
fluid
|
||||
icon="rocket"
|
||||
content={"5 Fuel for Engine Parts"}
|
||||
color="violet"
|
||||
onClick={() => act('buyparts', {
|
||||
part: 1,
|
||||
})} />
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
</Stack.Item>
|
||||
<Stack.Item grow basis={0}>
|
||||
<Stack vertical>
|
||||
<Stack.Item>
|
||||
<Button
|
||||
fluid
|
||||
icon="hamburger"
|
||||
content={"5 Fuel -> 5 Food"}
|
||||
color="olive"
|
||||
onClick={() => act('trade', {
|
||||
what: 1,
|
||||
})} />
|
||||
</Stack.Item>
|
||||
<Divider />
|
||||
<Stack.Item mt={0}>
|
||||
Port Bar:
|
||||
</Stack.Item>
|
||||
<Stack.Item mb={marketButtonSpacing}>
|
||||
<Button
|
||||
fluid
|
||||
icon="user-plus"
|
||||
content={"10 Food, 10 Fuel for Crew"}
|
||||
color="white"
|
||||
onClick={() => act('buycrew')} />
|
||||
</Stack.Item>
|
||||
<Stack.Item mb={marketButtonSpacing}>
|
||||
<Button
|
||||
fluid
|
||||
icon="user-minus"
|
||||
content={"Crew for 7 Food, 7 Fuel"}
|
||||
color="black"
|
||||
onClick={() => act('sellcrew')} />
|
||||
</Stack.Item>
|
||||
<Stack.Item mb={marketButtonSpacing}>
|
||||
<Button
|
||||
fluid
|
||||
icon="meteor"
|
||||
content={"Odd Crew (Same Price)"}
|
||||
color="purple"
|
||||
onClick={() => act('buycrew', {
|
||||
odd: 1,
|
||||
})} />
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
</Stack.Item>
|
||||
</>
|
||||
)}
|
||||
<>
|
||||
<Stack.Item>
|
||||
General Markets:
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
<Stack mb={-1} fill>
|
||||
<Stack.Item grow basis={0}>
|
||||
<Stack vertical>
|
||||
<Stack.Item>
|
||||
<Button
|
||||
fluid
|
||||
icon="gas-pump"
|
||||
content={"5 Food -> 5 Fuel"}
|
||||
color="green"
|
||||
onClick={() => act('trade', {
|
||||
what: 2,
|
||||
})} />
|
||||
</Stack.Item>
|
||||
<Divider />
|
||||
<Stack.Item mt={0}>
|
||||
Port Hangar Bay:
|
||||
</Stack.Item>
|
||||
<Stack.Item mb={marketButtonSpacing}>
|
||||
<Button
|
||||
fluid
|
||||
icon="wrench"
|
||||
content={"5 Fuel for Hull Plates"}
|
||||
color="average"
|
||||
onClick={() => act('buyparts', {
|
||||
part: 2,
|
||||
})} />
|
||||
</Stack.Item>
|
||||
<Stack.Item mb={marketButtonSpacing}>
|
||||
<Button
|
||||
fluid
|
||||
icon="server"
|
||||
content={"5 Fuel for Electronics"}
|
||||
color="blue"
|
||||
onClick={() => act('buyparts', {
|
||||
part: 3,
|
||||
})} />
|
||||
</Stack.Item>
|
||||
<Stack.Item mb={marketButtonSpacing}>
|
||||
<Button
|
||||
fluid
|
||||
icon="rocket"
|
||||
content={"5 Fuel for Engine Parts"}
|
||||
color="violet"
|
||||
onClick={() => act('buyparts', {
|
||||
part: 1,
|
||||
})} />
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
</Stack.Item>
|
||||
<Stack.Item grow basis={0}>
|
||||
<Stack vertical>
|
||||
<Stack.Item>
|
||||
<Button
|
||||
fluid
|
||||
icon="hamburger"
|
||||
content={"5 Fuel -> 5 Food"}
|
||||
color="olive"
|
||||
onClick={() => act('trade', {
|
||||
what: 1,
|
||||
})} />
|
||||
</Stack.Item>
|
||||
<Divider />
|
||||
<Stack.Item mt={0}>
|
||||
Port Bar:
|
||||
</Stack.Item>
|
||||
<Stack.Item mb={marketButtonSpacing}>
|
||||
<Button
|
||||
fluid
|
||||
icon="user-plus"
|
||||
content={"10 Food, 10 Fuel for Crew"}
|
||||
color="white"
|
||||
onClick={() => act('buycrew')} />
|
||||
</Stack.Item>
|
||||
<Stack.Item mb={marketButtonSpacing}>
|
||||
<Button
|
||||
fluid
|
||||
icon="user-minus"
|
||||
content={"Crew for 7 Food, 7 Fuel"}
|
||||
color="black"
|
||||
onClick={() => act('sellcrew')} />
|
||||
</Stack.Item>
|
||||
<Stack.Item mb={marketButtonSpacing}>
|
||||
<Button
|
||||
fluid
|
||||
icon="meteor"
|
||||
content={"Odd Crew (Same Price)"}
|
||||
color="purple"
|
||||
onClick={() => act('buycrew', {
|
||||
odd: 1,
|
||||
})} />
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
</Stack.Item>
|
||||
</>
|
||||
)}
|
||||
|
||||
</Stack>
|
||||
</Section>
|
||||
@@ -628,8 +628,8 @@ export const OrionGame = (props) => {
|
||||
{eventname === "Space Port Raid" && (
|
||||
<MarketRaid />
|
||||
) || (
|
||||
<GameStatusComponent />
|
||||
)}
|
||||
<GameStatusComponent />
|
||||
)}
|
||||
</Window.Content>
|
||||
</Window>
|
||||
);
|
||||
|
||||
@@ -53,7 +53,7 @@ export const PersonalCrafting = (props) => {
|
||||
}
|
||||
// Sort out the tab state
|
||||
const [tab, setTab] = useLocalState(
|
||||
context, 'tab', categories[0]?.name);
|
||||
'tab', categories[0]?.name);
|
||||
const shownRecipes = recipes
|
||||
.filter(recipe => recipe.category === tab);
|
||||
return (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { sortBy } from 'common/collections';
|
||||
import { toTitleCase } from 'common/string';
|
||||
import { toTitleCase } from 'tgui-core/string';
|
||||
import { useBackend } from '../backend';
|
||||
import { AnimatedNumber, Box, Button, LabeledList, Section } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
@@ -76,14 +76,14 @@ export const PortableChemMixer = (props) => {
|
||||
{recording
|
||||
&& 'Virtual beaker'
|
||||
|| data.isBeakerLoaded
|
||||
&& (
|
||||
<>
|
||||
<AnimatedNumber
|
||||
initial={0}
|
||||
value={data.beakerCurrentVolume} />
|
||||
/{data.beakerMaxVolume} units
|
||||
</>
|
||||
)
|
||||
&& (
|
||||
<>
|
||||
<AnimatedNumber
|
||||
initial={0}
|
||||
value={data.beakerCurrentVolume} />
|
||||
/{data.beakerMaxVolume} units
|
||||
</>
|
||||
)
|
||||
|| 'No beaker'}
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { multiline } from 'common/string';
|
||||
import { multiline } from 'tgui-core/string';
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
import { Box, Button, Dimmer, Divider, Icon, NumberInput, Section, Stack } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
@@ -354,9 +354,9 @@ const RecipeLibrary = (props) => {
|
||||
} = data;
|
||||
|
||||
const [reagentFilter, setReagentFilter] = useLocalState(
|
||||
context, 'reagentFilter', true);
|
||||
'reagentFilter', true);
|
||||
const [bookmarkMode, setBookmarkMode] = useLocalState(
|
||||
context, 'bookmarkMode', false);
|
||||
'bookmarkMode', false);
|
||||
|
||||
const matchReagents = reaction => {
|
||||
if (!reagentFilter || currentReagents === null) {
|
||||
@@ -370,7 +370,7 @@ const RecipeLibrary = (props) => {
|
||||
|
||||
const bookmarkArray = Array.from(bookmarkedReactions);
|
||||
|
||||
const startIndex = 50 * (page-1);
|
||||
const startIndex = 50 * (page - 1);
|
||||
|
||||
const endIndex = 50 * page;
|
||||
|
||||
@@ -383,7 +383,7 @@ const RecipeLibrary = (props) => {
|
||||
&& matchReagents(reaction)
|
||||
));
|
||||
|
||||
const pageIndexMax = Math.ceil(visibleReactions.length/50);
|
||||
const pageIndexMax = Math.ceil(visibleReactions.length / 50);
|
||||
|
||||
const addBookmark = bookmark => {
|
||||
bookmarkedReactions.add(bookmark);
|
||||
@@ -400,7 +400,7 @@ const RecipeLibrary = (props) => {
|
||||
title={bookmarkMode ? "Bookmarked recipes" : "Possible recipes"}
|
||||
buttons={(
|
||||
<>
|
||||
Beaker: {linkedBeaker+" "}
|
||||
Beaker: {linkedBeaker + " "}
|
||||
<Button
|
||||
content="Filter by reagents in beaker"
|
||||
icon="search"
|
||||
@@ -500,11 +500,11 @@ const RecipeLibrary = (props) => {
|
||||
act('update_ui');
|
||||
}} />
|
||||
) || (
|
||||
<Button
|
||||
icon="trash"
|
||||
color="red"
|
||||
onClick={() => removeBookmark(reaction)} />
|
||||
)}
|
||||
<Button
|
||||
icon="trash"
|
||||
color="red"
|
||||
onClick={() => removeBookmark(reaction)} />
|
||||
)}
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
))}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { capitalize } from 'common/string';
|
||||
import { capitalize } from 'tgui-core/string';
|
||||
import { useBackend, useSharedState } from '../backend';
|
||||
import { AnimatedNumber, BlockQuote, Box, Button, Collapsible, Dimmer, Icon, LabeledList, NoticeBox, ProgressBar, Section, Stack, Tabs } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
@@ -80,7 +80,7 @@ const SectTab = (props) => {
|
||||
<Icon name={icon} color={ALIGNMENT2COLOR[alignment]} />
|
||||
</Stack.Item>
|
||||
<Stack.Item grow mb={2} color="grey">
|
||||
{"\""+quote+"\""}
|
||||
{"\"" + quote + "\""}
|
||||
</Stack.Item>
|
||||
<Stack.Item color={favor === 0 ? "white" : "green"}>
|
||||
{favordesc}
|
||||
@@ -95,8 +95,8 @@ const SectTab = (props) => {
|
||||
{!wanted && (
|
||||
deity + " doesn't want any sacrifices."
|
||||
) || (
|
||||
deity + " wishes for " + wanted + "."
|
||||
)}
|
||||
deity + " wishes for " + wanted + "."
|
||||
)}
|
||||
</Section>
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
@@ -126,7 +126,7 @@ const SectSelectTab = (props) => {
|
||||
{sect.name}
|
||||
</Stack.Item>
|
||||
<Stack.Item italic >
|
||||
{"\""+sect.quote+"\""}
|
||||
{"\"" + sect.quote + "\""}
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
)}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { decodeHtmlEntities } from 'common/string';
|
||||
import { decodeHtmlEntities } from 'tgui-core/string';
|
||||
import { useBackend } from '../backend';
|
||||
import { Box, Button, NoticeBox, Section, LabeledList } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
@@ -67,7 +67,7 @@ export const RemoteRobotControlContent = (props) => {
|
||||
<Box inline color="bad">
|
||||
(HACKED)
|
||||
</Box>
|
||||
) || "" }
|
||||
) || ""}
|
||||
</LabeledList.Item>
|
||||
<LabeledList.Item label="Location">
|
||||
{robot.location}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useBackend } from '../backend';
|
||||
import { Box, Button, Collapsible, Flex, LabeledList, NumberInput, Section, Stack, TextArea } from 'tgui-core/components';
|
||||
import { formatMoney } from '../format';
|
||||
import { formatMoney } from 'tgui-core/format';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
export const RequestKiosk = (props) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { sortBy } from 'common/collections';
|
||||
import { flow } from 'common/fp';
|
||||
import { toTitleCase } from 'common/string';
|
||||
import { toTitleCase } from 'tgui-core/string';
|
||||
import { useBackend } from '../backend';
|
||||
import { Button, Section, Table } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { filter, map, sortBy, uniq } from 'common/collections';
|
||||
import { flow } from 'common/fp';
|
||||
import { createSearch } from 'common/string';
|
||||
import { createSearch } from 'tgui-core/string';
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
import { Box, Button, Icon, Input, Section, Stack, Tabs } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
@@ -9,7 +9,7 @@ import { Window } from '../layouts';
|
||||
// custom outfits give a ref keyword instead of path
|
||||
const getOutfitKey = outfit => outfit.path || outfit.ref;
|
||||
|
||||
const useOutfitTabs = (context, categories) => {
|
||||
const useOutfitTabs = (categories) => {
|
||||
return useLocalState('selected-tab', categories[0]);
|
||||
};
|
||||
|
||||
@@ -38,10 +38,10 @@ export const SelectEquipment = (props) => {
|
||||
...outfits.map(entry => entry.category),
|
||||
'Custom',
|
||||
]);
|
||||
const [tab] = useOutfitTabs(context, categories);
|
||||
const [tab] = useOutfitTabs(categories);
|
||||
|
||||
const [searchText, setSearchText] = useLocalState(
|
||||
context, 'searchText', '');
|
||||
'searchText', '');
|
||||
const searchFilter = createSearch(searchText, entry => (
|
||||
entry.name + entry.path
|
||||
));
|
||||
@@ -120,7 +120,7 @@ export const SelectEquipment = (props) => {
|
||||
|
||||
const DisplayTabs = (props) => {
|
||||
const { categories } = props;
|
||||
const [tab, setTab] = useOutfitTabs(context, categories);
|
||||
const [tab, setTab] = useOutfitTabs(categories);
|
||||
return (
|
||||
<Tabs textAlign="center">
|
||||
{categories.map(category => (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { multiline } from '../../common/string';
|
||||
import { multiline } from '../../tgui-core/string';
|
||||
import { useBackend } from '../backend';
|
||||
import { Button, Icon, LabeledControls, NoticeBox, Section, Slider, Stack, Tooltip } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useBackend } from '../backend';
|
||||
import { Box, Button, Flex, LabeledList, ProgressBar, Section, Slider } from 'tgui-core/components';
|
||||
import { formatPower } from '../format';
|
||||
import { formatPower } from 'tgui-core/format';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
// Common power multiplier
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { multiline } from 'common/string';
|
||||
import { multiline } from 'tgui-core/string';
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
import { Blink, Box, Button, Dimmer, Divider, Icon, Modal, NoticeBox, ProgressBar, Section, Stack } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
@@ -362,14 +362,14 @@ export const Spellbook = (props) => {
|
||||
tabIndex,
|
||||
setTabIndex,
|
||||
] = useLocalState('tab-index', 1);
|
||||
const ScrollableCheck = TAB2NAME[tabIndex-1].noScrollable ? false : true;
|
||||
const ScrollableNextCheck = TAB2NAME[tabIndex-1].noScrollable !== 2;
|
||||
const TabComponent = TAB2NAME[tabIndex-1].component
|
||||
? TAB2NAME[tabIndex-1].component() : null;
|
||||
const ScrollableCheck = TAB2NAME[tabIndex - 1].noScrollable ? false : true;
|
||||
const ScrollableNextCheck = TAB2NAME[tabIndex - 1].noScrollable !== 2;
|
||||
const TabComponent = TAB2NAME[tabIndex - 1].component
|
||||
? TAB2NAME[tabIndex - 1].component() : null;
|
||||
const TabNextComponent = TAB2NAME[tabIndex].component
|
||||
? TAB2NAME[tabIndex].component() : null;
|
||||
const TabSpells = entries ? entries.filter(
|
||||
entry => entry.cat === TAB2NAME[tabIndex-1].title) : null;
|
||||
entry => entry.cat === TAB2NAME[tabIndex - 1].title) : null;
|
||||
const TabNextSpells = entries ? entries.filter(
|
||||
entry => entry.cat === TAB2NAME[tabIndex].title) : null;
|
||||
return (
|
||||
@@ -389,7 +389,7 @@ export const Spellbook = (props) => {
|
||||
width={widthSection}
|
||||
height={heightSection}
|
||||
fill
|
||||
title={TAB2NAME[tabIndex-1].title}
|
||||
title={TAB2NAME[tabIndex - 1].title}
|
||||
buttons={
|
||||
<>
|
||||
<Button
|
||||
@@ -397,118 +397,118 @@ export const Spellbook = (props) => {
|
||||
disabled={tabIndex === 1}
|
||||
icon="arrow-left"
|
||||
content="Previous Page"
|
||||
onClick={() => setTabIndex(tabIndex-2)} />
|
||||
onClick={() => setTabIndex(tabIndex - 2)} />
|
||||
<Box textAlign="right" bold mt={-3.3} mr={1}>
|
||||
{tabIndex}
|
||||
</Box>
|
||||
</>
|
||||
}>
|
||||
{!!TAB2NAME[tabIndex-1].locked && (
|
||||
{!!TAB2NAME[tabIndex - 1].locked && (
|
||||
<LockedPage />
|
||||
)}
|
||||
<Stack vertical>
|
||||
{TAB2NAME[tabIndex-1].blurb !== null && (
|
||||
{TAB2NAME[tabIndex - 1].blurb !== null && (
|
||||
<Stack.Item>
|
||||
<Box
|
||||
textAlign="center"
|
||||
bold
|
||||
height="30px">
|
||||
{TAB2NAME[tabIndex-1].blurb}
|
||||
{TAB2NAME[tabIndex - 1].blurb}
|
||||
</Box>
|
||||
</Stack.Item>
|
||||
)}
|
||||
{!!TAB2NAME[tabIndex-1].component && (
|
||||
{!!TAB2NAME[tabIndex - 1].component && (
|
||||
<Stack.Item>
|
||||
<TabComponent />
|
||||
</Stack.Item>
|
||||
) || (
|
||||
<Stack.Item>
|
||||
<Stack vertical>
|
||||
{TabSpells?.map(entry => (
|
||||
<Stack.Item key={entry}>
|
||||
<Divider />
|
||||
<Section
|
||||
title={entry.name}
|
||||
buttons={
|
||||
<>
|
||||
<Box mr={entry.buyword === "Learn" ? 6.5 : 2}>
|
||||
{entry.cost} Points
|
||||
</Box>
|
||||
{entry.cat === 'Rituals' && (
|
||||
!!entry.times && (
|
||||
<Box ml={-104} mt={-2.2}>
|
||||
Cast {entry.times} Times.
|
||||
</Box>
|
||||
) || (
|
||||
<Box ml={-110} mt={-2.2}>
|
||||
Not Casted Yet.
|
||||
</Box>
|
||||
)
|
||||
) || (
|
||||
entry.cooldown && (
|
||||
<Box ml={-115} mt={-2.2}>
|
||||
{entry.cooldown}s Cooldown
|
||||
</Box>
|
||||
) || (
|
||||
<Box ml={-120} mt={-2.2}>
|
||||
No Cooldown!
|
||||
</Box>)
|
||||
)}
|
||||
{entry.buyword === "Learn" && (
|
||||
<Box mr={-9.5} mt={-3}>
|
||||
<Button
|
||||
icon="tshirt"
|
||||
color={entry.clothes_req ? "bad" : "green"}
|
||||
tooltipPosition="bottom-left"
|
||||
tooltip={entry.clothes_req
|
||||
? "Requires wizard garb."
|
||||
:"Can be cast without wizard garb."} />
|
||||
<Stack.Item>
|
||||
<Stack vertical>
|
||||
{TabSpells?.map(entry => (
|
||||
<Stack.Item key={entry}>
|
||||
<Divider />
|
||||
<Section
|
||||
title={entry.name}
|
||||
buttons={
|
||||
<>
|
||||
<Box mr={entry.buyword === "Learn" ? 6.5 : 2}>
|
||||
{entry.cost} Points
|
||||
</Box>
|
||||
)}
|
||||
</>
|
||||
}>
|
||||
<Stack>
|
||||
<Stack.Item grow>
|
||||
{entry.desc}
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
<Divider vertical />
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
<Button
|
||||
fluid
|
||||
textAlign="center"
|
||||
color={points >= entry.cost ? "green" : "bad"}
|
||||
disabled={points < entry.cost}
|
||||
width={7}
|
||||
icon={BUYWORD2ICON[entry.buyword]}
|
||||
content={entry.buyword}
|
||||
onClick={() => act("purchase", {
|
||||
spellref: entry.ref,
|
||||
})} />
|
||||
<br />
|
||||
{!entry.refundable && (
|
||||
<NoticeBox>
|
||||
No refunds.
|
||||
</NoticeBox>
|
||||
) || (
|
||||
{entry.cat === 'Rituals' && (
|
||||
!!entry.times && (
|
||||
<Box ml={-104} mt={-2.2}>
|
||||
Cast {entry.times} Times.
|
||||
</Box>
|
||||
) || (
|
||||
<Box ml={-110} mt={-2.2}>
|
||||
Not Casted Yet.
|
||||
</Box>
|
||||
)
|
||||
) || (
|
||||
entry.cooldown && (
|
||||
<Box ml={-115} mt={-2.2}>
|
||||
{entry.cooldown}s Cooldown
|
||||
</Box>
|
||||
) || (
|
||||
<Box ml={-120} mt={-2.2}>
|
||||
No Cooldown!
|
||||
</Box>)
|
||||
)}
|
||||
{entry.buyword === "Learn" && (
|
||||
<Box mr={-9.5} mt={-3}>
|
||||
<Button
|
||||
icon="tshirt"
|
||||
color={entry.clothes_req ? "bad" : "green"}
|
||||
tooltipPosition="bottom-left"
|
||||
tooltip={entry.clothes_req
|
||||
? "Requires wizard garb."
|
||||
: "Can be cast without wizard garb."} />
|
||||
</Box>
|
||||
)}
|
||||
</>
|
||||
}>
|
||||
<Stack>
|
||||
<Stack.Item grow>
|
||||
{entry.desc}
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
<Divider vertical />
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
<Button
|
||||
fluid
|
||||
textAlign="center"
|
||||
color={points >= entry.cost ? "green" : "bad"}
|
||||
disabled={points < entry.cost}
|
||||
width={7}
|
||||
icon="arrow-left"
|
||||
content="Refund"
|
||||
onClick={() => act("refund", {
|
||||
icon={BUYWORD2ICON[entry.buyword]}
|
||||
content={entry.buyword}
|
||||
onClick={() => act("purchase", {
|
||||
spellref: entry.ref,
|
||||
})} />
|
||||
)}
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
</Section>
|
||||
</Stack.Item>
|
||||
))}
|
||||
</Stack>
|
||||
</Stack.Item>
|
||||
)}
|
||||
<br />
|
||||
{!entry.refundable && (
|
||||
<NoticeBox>
|
||||
No refunds.
|
||||
</NoticeBox>
|
||||
) || (
|
||||
<Button
|
||||
textAlign="center"
|
||||
width={7}
|
||||
icon="arrow-left"
|
||||
content="Refund"
|
||||
onClick={() => act("refund", {
|
||||
spellref: entry.ref,
|
||||
})} />
|
||||
)}
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
</Section>
|
||||
</Stack.Item>
|
||||
))}
|
||||
</Stack>
|
||||
</Stack.Item>
|
||||
)}
|
||||
</Stack>
|
||||
</Section>
|
||||
</Stack.Item>
|
||||
@@ -527,9 +527,9 @@ export const Spellbook = (props) => {
|
||||
icon="arrow-right"
|
||||
disabled={tabIndex === 9}
|
||||
content="Next Page"
|
||||
onClick={() => setTabIndex(tabIndex+2)} />
|
||||
onClick={() => setTabIndex(tabIndex + 2)} />
|
||||
<Box textAlign="left" bold mt={-3.3} ml={-59.8} >
|
||||
{tabIndex+1}
|
||||
{tabIndex + 1}
|
||||
</Box>
|
||||
</>
|
||||
}>
|
||||
@@ -552,94 +552,94 @@ export const Spellbook = (props) => {
|
||||
<TabNextComponent />
|
||||
</Stack.Item>
|
||||
) || (
|
||||
<Stack.Item>
|
||||
<Stack vertical>
|
||||
{TabNextSpells?.map(entry => (
|
||||
<Stack.Item key={entry}>
|
||||
<Divider />
|
||||
<Section
|
||||
title={entry.name}
|
||||
buttons={
|
||||
<>
|
||||
<Box mr={entry.buyword === "Learn" ? 6.5 : 2}>
|
||||
{entry.cost} Points
|
||||
</Box>
|
||||
{entry.cat === 'Rituals' && (
|
||||
!!entry.times && (
|
||||
<Box ml={-118} mt={-2.2}>
|
||||
Cast {entry.times} Time(s).
|
||||
</Box>
|
||||
) || (
|
||||
<Box ml={-118} mt={-2.2}>
|
||||
Not Casted Yet.
|
||||
</Box>
|
||||
)
|
||||
) || (
|
||||
entry.cooldown && (
|
||||
<Box ml={-115} mt={-2.2}>
|
||||
{entry.cooldown}s Cooldown
|
||||
</Box>
|
||||
) || (
|
||||
<Box ml={-120} mt={-2.2}>
|
||||
No Cooldown!
|
||||
</Box>
|
||||
)
|
||||
)}
|
||||
{entry.buyword === "Learn" && (
|
||||
<Box mr={-9.5} mt={-3}>
|
||||
<Button
|
||||
icon="tshirt"
|
||||
color={entry.clothes_req ? "bad" : "green"}
|
||||
tooltipPosition="bottom-left"
|
||||
tooltip={entry.clothes_req
|
||||
? "Requires wizard garb."
|
||||
:"Can be cast without wizard garb."} />
|
||||
<Stack.Item>
|
||||
<Stack vertical>
|
||||
{TabNextSpells?.map(entry => (
|
||||
<Stack.Item key={entry}>
|
||||
<Divider />
|
||||
<Section
|
||||
title={entry.name}
|
||||
buttons={
|
||||
<>
|
||||
<Box mr={entry.buyword === "Learn" ? 6.5 : 2}>
|
||||
{entry.cost} Points
|
||||
</Box>
|
||||
)}
|
||||
</>
|
||||
}>
|
||||
<Stack>
|
||||
<Stack.Item grow>
|
||||
{entry.desc}
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
<Divider vertical />
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
<Button
|
||||
fluid
|
||||
textAlign="center"
|
||||
color={points >= entry.cost ? "green" : "bad"}
|
||||
disabled={points < entry.cost}
|
||||
width={7}
|
||||
icon={BUYWORD2ICON[entry.buyword]}
|
||||
content={entry.buyword}
|
||||
onClick={() => act("purchase", {
|
||||
spellref: entry.ref,
|
||||
})} />
|
||||
<br />
|
||||
{!entry.refundable && (
|
||||
<NoticeBox>
|
||||
No refunds.
|
||||
</NoticeBox>
|
||||
) || (
|
||||
{entry.cat === 'Rituals' && (
|
||||
!!entry.times && (
|
||||
<Box ml={-118} mt={-2.2}>
|
||||
Cast {entry.times} Time(s).
|
||||
</Box>
|
||||
) || (
|
||||
<Box ml={-118} mt={-2.2}>
|
||||
Not Casted Yet.
|
||||
</Box>
|
||||
)
|
||||
) || (
|
||||
entry.cooldown && (
|
||||
<Box ml={-115} mt={-2.2}>
|
||||
{entry.cooldown}s Cooldown
|
||||
</Box>
|
||||
) || (
|
||||
<Box ml={-120} mt={-2.2}>
|
||||
No Cooldown!
|
||||
</Box>
|
||||
)
|
||||
)}
|
||||
{entry.buyword === "Learn" && (
|
||||
<Box mr={-9.5} mt={-3}>
|
||||
<Button
|
||||
icon="tshirt"
|
||||
color={entry.clothes_req ? "bad" : "green"}
|
||||
tooltipPosition="bottom-left"
|
||||
tooltip={entry.clothes_req
|
||||
? "Requires wizard garb."
|
||||
: "Can be cast without wizard garb."} />
|
||||
</Box>
|
||||
)}
|
||||
</>
|
||||
}>
|
||||
<Stack>
|
||||
<Stack.Item grow>
|
||||
{entry.desc}
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
<Divider vertical />
|
||||
</Stack.Item>
|
||||
<Stack.Item>
|
||||
<Button
|
||||
fluid
|
||||
textAlign="center"
|
||||
color={points >= entry.cost ? "green" : "bad"}
|
||||
disabled={points < entry.cost}
|
||||
width={7}
|
||||
icon="arrow-left"
|
||||
content="Refund"
|
||||
onClick={() => act("refund", {
|
||||
icon={BUYWORD2ICON[entry.buyword]}
|
||||
content={entry.buyword}
|
||||
onClick={() => act("purchase", {
|
||||
spellref: entry.ref,
|
||||
})} />
|
||||
)}
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
</Section>
|
||||
</Stack.Item>
|
||||
))}
|
||||
</Stack>
|
||||
</Stack.Item>
|
||||
)}
|
||||
<br />
|
||||
{!entry.refundable && (
|
||||
<NoticeBox>
|
||||
No refunds.
|
||||
</NoticeBox>
|
||||
) || (
|
||||
<Button
|
||||
textAlign="center"
|
||||
width={7}
|
||||
icon="arrow-left"
|
||||
content="Refund"
|
||||
onClick={() => act("refund", {
|
||||
spellref: entry.ref,
|
||||
})} />
|
||||
)}
|
||||
</Stack.Item>
|
||||
</Stack>
|
||||
</Section>
|
||||
</Stack.Item>
|
||||
))}
|
||||
</Stack>
|
||||
</Stack.Item>
|
||||
)}
|
||||
</Stack>
|
||||
</Section>
|
||||
</Stack.Item>
|
||||
@@ -648,7 +648,7 @@ export const Spellbook = (props) => {
|
||||
<Stack.Item>
|
||||
<Section>
|
||||
<ProgressBar
|
||||
value={points/10}>
|
||||
value={points / 10}>
|
||||
{points + ' points left to spend.'}
|
||||
</ProgressBar>
|
||||
</Section>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createSearch } from 'common/string';
|
||||
import { createSearch } from 'tgui-core/string';
|
||||
import { sortBy } from 'common/collections';
|
||||
import { useBackend, useLocalState } from "../backend";
|
||||
import { Box, Button, Input, NoticeBox, Section, Collapsible, Table } from "tgui-core/components";
|
||||
@@ -22,12 +22,12 @@ export const Stack = (props) => {
|
||||
});
|
||||
|
||||
const items = searchText.length > 0
|
||||
&& Object.keys(recipes)
|
||||
.filter(testSearch)
|
||||
.reduce((obj, key) => {
|
||||
obj[key] = recipes[key];
|
||||
return obj;
|
||||
}, {})
|
||||
&& Object.keys(recipes)
|
||||
.filter(testSearch)
|
||||
.reduce((obj, key) => {
|
||||
obj[key] = recipes[key];
|
||||
return obj;
|
||||
}, {})
|
||||
|| recipes;
|
||||
|
||||
const height = Math.max(94 + Object.keys(recipes).length * 26, 250);
|
||||
@@ -54,8 +54,8 @@ export const Stack = (props) => {
|
||||
No recipes found.
|
||||
</NoticeBox>
|
||||
) || (
|
||||
<RecipeList recipes={items} />
|
||||
)}
|
||||
<RecipeList recipes={items} />
|
||||
)}
|
||||
</Section>
|
||||
</Window.Content>
|
||||
</Window>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { toFixed } from 'common/math';
|
||||
import { useBackend } from '../backend';
|
||||
import { Button, LabeledControls, NumberInput, RoundGauge, Section } from 'tgui-core/components';
|
||||
import { formatSiUnit } from '../format';
|
||||
import { formatSiUnit } from 'tgui-core/format';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
const formatPressure = value => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createSearch, decodeHtmlEntities } from 'common/string';
|
||||
import { createSearch, decodeHtmlEntities } from 'tgui-core/string';
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
import { Box, Button, Flex, Input, Section, Table, Tabs, NoticeBox } from 'tgui-core/components';
|
||||
import { formatMoney } from '../format';
|
||||
import { formatMoney } from 'tgui-core/format';
|
||||
import { Window } from '../layouts';
|
||||
|
||||
const MAX_SEARCH_RESULTS = 25;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { filter } from 'common/collections';
|
||||
import { flow } from 'common/fp';
|
||||
import { classes } from 'common/react';
|
||||
import { createSearch } from 'common/string';
|
||||
import { createSearch } from 'tgui-core/string';
|
||||
import { useBackend, useLocalState } from '../backend';
|
||||
import { Box, Button, Icon, Input, Section, Table } from 'tgui-core/components';
|
||||
import { Window } from '../layouts';
|
||||
@@ -97,16 +97,16 @@ const VendingRow = (props) => {
|
||||
'horizontal-align': 'middle',
|
||||
}} />
|
||||
) || (
|
||||
<span
|
||||
className={classes([
|
||||
'vending32x32',
|
||||
product.path,
|
||||
])}
|
||||
style={{
|
||||
'vertical-align': 'middle',
|
||||
'horizontal-align': 'middle',
|
||||
}} />
|
||||
)}
|
||||
<span
|
||||
className={classes([
|
||||
'vending32x32',
|
||||
product.path,
|
||||
])}
|
||||
style={{
|
||||
'vertical-align': 'middle',
|
||||
'horizontal-align': 'middle',
|
||||
}} />
|
||||
)}
|
||||
</Table.Cell>
|
||||
<Table.Cell bold>
|
||||
{product.name}
|
||||
@@ -131,21 +131,21 @@ const VendingRow = (props) => {
|
||||
'item': product.name,
|
||||
})} />
|
||||
) || (
|
||||
<Button
|
||||
fluid
|
||||
disabled={(
|
||||
productStock.amount === 0
|
||||
|| !free && (
|
||||
!user
|
||||
|| product.price > user.cash
|
||||
)
|
||||
)}
|
||||
content={free
|
||||
? 'FREE' : `${product.price} cr`}
|
||||
onClick={() => act('vend', {
|
||||
'ref': product.ref,
|
||||
})} />
|
||||
)}
|
||||
<Button
|
||||
fluid
|
||||
disabled={(
|
||||
productStock.amount === 0
|
||||
|| !free && (
|
||||
!user
|
||||
|| product.price > user.cash
|
||||
)
|
||||
)}
|
||||
content={free
|
||||
? 'FREE' : `${product.price} cr`}
|
||||
onClick={() => act('vend', {
|
||||
'ref': product.ref,
|
||||
})} />
|
||||
)}
|
||||
</Table.Cell>
|
||||
<Table.Cell>
|
||||
{
|
||||
@@ -221,11 +221,11 @@ export const Vending = (props) => {
|
||||
Your balance is <b>{user.cash} credits</b>.
|
||||
</Box>
|
||||
) || (
|
||||
<Box color="light-grey">
|
||||
No registered ID card!<br />
|
||||
Please contact your local HoP!
|
||||
</Box>
|
||||
)}
|
||||
<Box color="light-grey">
|
||||
No registered ID card!<br />
|
||||
Please contact your local HoP!
|
||||
</Box>
|
||||
)}
|
||||
</Section>
|
||||
)}
|
||||
<Section title="Products">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { decodeHtmlEntities } from 'common/string';
|
||||
import { decodeHtmlEntities } from 'tgui-core/string';
|
||||
import { useBackend } from '../../backend';
|
||||
import { Button, LabeledList, NumberInput, Section } from 'tgui-core/components';
|
||||
import { getGasLabel } from '../../constants';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BooleanLike } from 'common/react';
|
||||
import { Box, Button, NumberInput, Flex } from 'tgui-core/components';
|
||||
import { classes } from 'common/react';
|
||||
import { formatMoney, formatSiUnit } from '../../format';
|
||||
import { formatMoney, formatSiUnit } from 'tgui-core/format';
|
||||
import { useSharedState } from '../../backend';
|
||||
import { BoxProps } from 'tgui-core/components/Box';
|
||||
|
||||
@@ -52,7 +52,7 @@ const EjectMaterial = (props: {
|
||||
sheets,
|
||||
} = props.material;
|
||||
const [removeMaterials, setRemoveMaterials] = useSharedState(
|
||||
context, 'remove_mats_' + name, 1);
|
||||
'remove_mats_' + name, 1);
|
||||
if (removeMaterials > 1 && sheets < removeMaterials) {
|
||||
setRemoveMaterials(sheets || 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user