mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13.git
synced 2026-08-23 19:07:13 +01:00
fix
This commit is contained in:
@@ -14,12 +14,12 @@ export const AIAnnouncement = (props) => {
|
||||
const [
|
||||
current_page,
|
||||
set_page,
|
||||
] = useLocalState( 'current_page', 0);
|
||||
] = useLocalState('current_page', 0);
|
||||
|
||||
const [
|
||||
announcement_input,
|
||||
set_announcement_input,
|
||||
] = useLocalState( 'announcement_input', last_announcement);
|
||||
] = useLocalState('announcement_input', last_announcement);
|
||||
|
||||
// I love `Object`s!!
|
||||
const words_filtered = Object.keys(vox_types[Object.keys(vox_types)[current_page]]);
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Window } from '../layouts';
|
||||
import { GenericUplink } from './Uplink';
|
||||
|
||||
export const AbductorConsole = (props) => {
|
||||
const [tab, setTab] = useSharedState(context, 'tab', 1);
|
||||
const [tab, setTab] = useSharedState('tab', 1);
|
||||
return (
|
||||
<Window
|
||||
theme="abductor"
|
||||
|
||||
@@ -8,7 +8,7 @@ export const Achievements = (props) => {
|
||||
const [
|
||||
selectedCategory,
|
||||
setSelectedCategory,
|
||||
] = useLocalState( 'category', categories[0]);
|
||||
] = useLocalState('category', categories[0]);
|
||||
const achievements = data.achievements
|
||||
.filter(x => x.category === selectedCategory);
|
||||
return (
|
||||
@@ -95,7 +95,7 @@ const HighScoreTable = (props) => {
|
||||
const [
|
||||
highScoreIndex,
|
||||
setHighScoreIndex,
|
||||
] = useLocalState( 'highscore', 0);
|
||||
] = useLocalState('highscore', 0);
|
||||
const highscore = highscores[highScoreIndex];
|
||||
if (!highscore) {
|
||||
return null;
|
||||
|
||||
@@ -25,7 +25,7 @@ type AdventureBrowserData = AdventureDataProvider & {
|
||||
};
|
||||
|
||||
const AdventureEntry = (props) => {
|
||||
const { data, act } = useBackend<AdventureBrowserData>(context);
|
||||
const { data, act } = useBackend<AdventureBrowserData>();
|
||||
const { entry_ref, close }: { entry_ref: string, close: () => void } = props;
|
||||
const entry = data.adventures.find(x => x.ref === entry_ref);
|
||||
return (
|
||||
@@ -58,11 +58,11 @@ const AdventureEntry = (props) => {
|
||||
};
|
||||
|
||||
const AdventureList = (props) => {
|
||||
const { data, act } = useBackend<AdventureBrowserData>(context);
|
||||
const { data, act } = useBackend<AdventureBrowserData>();
|
||||
const [
|
||||
openAdventure,
|
||||
setOpenAdventure,
|
||||
] = useLocalState( 'openAdventure', null);
|
||||
] = useLocalState('openAdventure', null);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -97,7 +97,7 @@ const AdventureList = (props) => {
|
||||
};
|
||||
|
||||
const DebugPlayer = (props) => {
|
||||
const { data, act } = useBackend<AdventureBrowserData>(context);
|
||||
const { data, act } = useBackend<AdventureBrowserData>();
|
||||
return (
|
||||
<Section
|
||||
title="Playtest"
|
||||
@@ -109,7 +109,7 @@ const DebugPlayer = (props) => {
|
||||
};
|
||||
|
||||
export const AdventureBrowser = (props) => {
|
||||
const { data } = useBackend<AdventureBrowserData>(context);
|
||||
const { data } = useBackend<AdventureBrowserData>();
|
||||
|
||||
return (
|
||||
<Window width={650} height={500} title="Adventure Manager">
|
||||
|
||||
@@ -115,7 +115,7 @@ const AIR_ALARM_ROUTES = {
|
||||
};
|
||||
|
||||
const AirAlarmControl = (props) => {
|
||||
const [screen, setScreen] = useLocalState( 'screen');
|
||||
const [screen, setScreen] = useLocalState('screen');
|
||||
const route = AIR_ALARM_ROUTES[screen] || AIR_ALARM_ROUTES.home;
|
||||
const Component = route.component();
|
||||
return (
|
||||
@@ -138,7 +138,7 @@ const AirAlarmControl = (props) => {
|
||||
|
||||
const AirAlarmControlHome = (props) => {
|
||||
const { act, data } = useBackend<any>();
|
||||
const [screen, setScreen] = useLocalState( 'screen');
|
||||
const [screen, setScreen] = useLocalState('screen');
|
||||
const {
|
||||
mode,
|
||||
atmos_alarm,
|
||||
|
||||
@@ -13,12 +13,12 @@ export const AnnouncementHelp = (props) => {
|
||||
const [
|
||||
current_page,
|
||||
set_page,
|
||||
] = useLocalState( 'current_page', 0);
|
||||
] = useLocalState('current_page', 0);
|
||||
|
||||
const [
|
||||
search_text,
|
||||
set_search_text,
|
||||
] = useLocalState( 'search_text', '');
|
||||
] = useLocalState('search_text', '');
|
||||
|
||||
// I love `Object`s!!
|
||||
const words_filtered = prepare_search(Object.keys(vox_types[Object.keys(vox_types)[current_page]]), search_text);
|
||||
|
||||
@@ -59,7 +59,7 @@ export const AntagInfoBrainwashed = (props) => {
|
||||
};
|
||||
|
||||
const ObjectivePrintout = (props) => {
|
||||
const { data } = useBackend<Info>(context);
|
||||
const { data } = useBackend<Info>();
|
||||
const {
|
||||
objectives,
|
||||
} = data;
|
||||
|
||||
@@ -15,7 +15,7 @@ for (let index = 0; index < Math.min(Math.random()*100); index++) {
|
||||
}
|
||||
|
||||
export const AntagInfoClockwork = (props) => {
|
||||
const { data } = useBackend<Info>(context);
|
||||
const { data } = useBackend<Info>();
|
||||
const {
|
||||
HONOR_RATVAR = false,
|
||||
} = data;
|
||||
|
||||
@@ -10,7 +10,7 @@ type Info = {
|
||||
};
|
||||
|
||||
export const AntagInfoGangmember = (props) => {
|
||||
const { data } = useBackend<Info>(context);
|
||||
const { data } = useBackend<Info>();
|
||||
const {
|
||||
gang_name,
|
||||
antag_name,
|
||||
@@ -57,7 +57,7 @@ export const AntagInfoGangmember = (props) => {
|
||||
};
|
||||
|
||||
const GangClothesPrintout = (props) => {
|
||||
const { data } = useBackend<Info>(context);
|
||||
const { data } = useBackend<Info>();
|
||||
const {
|
||||
gang_name,
|
||||
gang_clothes,
|
||||
@@ -118,7 +118,7 @@ const GangPhonePrintout = () => {
|
||||
|
||||
|
||||
const GangObjectivePrintout = (props) => {
|
||||
const { data } = useBackend<Info>(context);
|
||||
const { data } = useBackend<Info>();
|
||||
const {
|
||||
gang_objective,
|
||||
} = data;
|
||||
|
||||
@@ -40,7 +40,7 @@ type Info = {
|
||||
};
|
||||
|
||||
const ObjectivePrintout = (props) => {
|
||||
const { data } = useBackend<Info>(context);
|
||||
const { data } = useBackend<Info>();
|
||||
const {
|
||||
objectives,
|
||||
} = data;
|
||||
@@ -62,7 +62,7 @@ const ObjectivePrintout = (props) => {
|
||||
};
|
||||
|
||||
const IntroductionSection = (props) => {
|
||||
const { act, data } = useBackend<Info>(context);
|
||||
const { act, data } = useBackend<Info>();
|
||||
const {
|
||||
intro,
|
||||
} = data;
|
||||
@@ -81,7 +81,7 @@ const IntroductionSection = (props) => {
|
||||
};
|
||||
|
||||
const EmployerSection = (props) => {
|
||||
const { data } = useBackend<Info>(context);
|
||||
const { data } = useBackend<Info>();
|
||||
const {
|
||||
allies,
|
||||
goal,
|
||||
@@ -129,7 +129,7 @@ const EmployerSection = (props) => {
|
||||
};
|
||||
|
||||
const UplinkSection = (props) => {
|
||||
const { data } = useBackend<Info>(context);
|
||||
const { data } = useBackend<Info>();
|
||||
const {
|
||||
has_uplink,
|
||||
uplink_intro,
|
||||
@@ -168,7 +168,7 @@ const UplinkSection = (props) => {
|
||||
};
|
||||
|
||||
const CodewordsSection = (props) => {
|
||||
const { data } = useBackend<Info>(context);
|
||||
const { data } = useBackend<Info>();
|
||||
const {
|
||||
phrases,
|
||||
responses,
|
||||
@@ -212,7 +212,7 @@ const CodewordsSection = (props) => {
|
||||
};
|
||||
|
||||
export const AntagInfoTraitor = (props) => {
|
||||
const { data } = useBackend<Info>(context);
|
||||
const { data } = useBackend<Info>();
|
||||
const {
|
||||
theme,
|
||||
} = data;
|
||||
|
||||
@@ -130,7 +130,7 @@ export const AntagInfoWizard = (props) => {
|
||||
};
|
||||
|
||||
const ObjectivePrintout = (props) => {
|
||||
const { data } = useBackend<Info>(context);
|
||||
const { data } = useBackend<Info>();
|
||||
const {
|
||||
objectives,
|
||||
} = data;
|
||||
|
||||
@@ -44,7 +44,7 @@ const ApcLoggedIn = (props) => {
|
||||
const [
|
||||
tabIndex,
|
||||
setTabIndex,
|
||||
] = useLocalState( 'tab-index', 1);
|
||||
] = useLocalState('tab-index', 1);
|
||||
return (
|
||||
<>
|
||||
<Tabs>
|
||||
@@ -101,7 +101,7 @@ const ControlPanel = (props) => {
|
||||
const [
|
||||
sortByField,
|
||||
setSortByField,
|
||||
] = useLocalState( 'sortByField', null);
|
||||
] = useLocalState('sortByField', null);
|
||||
return (
|
||||
<Flex>
|
||||
<Flex.Item>
|
||||
@@ -153,7 +153,7 @@ const ApcControlScene = (props) => {
|
||||
|
||||
const [
|
||||
sortByField,
|
||||
] = useLocalState( 'sortByField', null);
|
||||
] = useLocalState('sortByField', null);
|
||||
|
||||
const apcs = flow([
|
||||
map((apc, i) => ({
|
||||
|
||||
@@ -17,7 +17,7 @@ export const Autolathe = (props) => {
|
||||
const [
|
||||
current_category,
|
||||
setCategory,
|
||||
] = useLocalState( 'current_category', "None");
|
||||
] = useLocalState('current_category', "None");
|
||||
const filteredmaterials = materials.filter(material =>
|
||||
material.mineral_amount > 0);
|
||||
return (
|
||||
|
||||
@@ -5,7 +5,7 @@ import { ShuttleConsoleContent } from './ShuttleConsole';
|
||||
|
||||
export const AuxBaseConsole = (props) => {
|
||||
const { data } = useBackend<any>();
|
||||
const [tab, setTab] = useSharedState(context, 'tab', 1);
|
||||
const [tab, setTab] = useSharedState('tab', 1);
|
||||
const {
|
||||
type,
|
||||
blind_drop,
|
||||
|
||||
@@ -45,11 +45,11 @@ export const BiogeneratorContent = (props) => {
|
||||
const [
|
||||
searchText,
|
||||
setSearchText,
|
||||
] = useLocalState( 'searchText', '');
|
||||
] = useLocalState('searchText', '');
|
||||
const [
|
||||
selectedCategory,
|
||||
setSelectedCategory,
|
||||
] = useLocalState( 'category', categories[0]?.name);
|
||||
] = useLocalState('category', categories[0]?.name);
|
||||
const testSearch = createSearch(searchText, item => {
|
||||
return item.name;
|
||||
});
|
||||
@@ -132,14 +132,14 @@ const ItemList = (props) => {
|
||||
const [
|
||||
hoveredItem,
|
||||
setHoveredItem,
|
||||
] = useLocalState( 'hoveredItem', {});
|
||||
] = useLocalState('hoveredItem', {});
|
||||
const hoveredCost = hoveredItem.cost || 0;
|
||||
// Append extra hover data to items
|
||||
const items = props.items.map(item => {
|
||||
const [
|
||||
amount,
|
||||
setAmount,
|
||||
] = useLocalState( "amount" + item.name, 1);
|
||||
] = useLocalState("amount" + item.name, 1);
|
||||
const notSameItem = hoveredItem.name !== item.name;
|
||||
const notEnoughHovered = props.biomass - hoveredCost
|
||||
* hoveredItem.amount < item.cost * amount;
|
||||
|
||||
@@ -14,7 +14,7 @@ const directionToIcon = {
|
||||
};
|
||||
|
||||
export const BluespaceLocator = (props) => {
|
||||
const [tab, setTab] = useSharedState(context, "tab", "implant");
|
||||
const [tab, setTab] = useSharedState("tab", "implant");
|
||||
return (
|
||||
<Window
|
||||
width={300}
|
||||
|
||||
@@ -94,7 +94,7 @@ export const CameraConsoleContent = (props) => {
|
||||
const [
|
||||
searchText,
|
||||
setSearchText,
|
||||
] = useLocalState( 'searchText', '');
|
||||
] = useLocalState('searchText', '');
|
||||
const { activeCamera } = data;
|
||||
const cameras = selectCameras(data.cameras, searchText);
|
||||
return (
|
||||
|
||||
@@ -20,7 +20,7 @@ export const Cargo = (props) => {
|
||||
|
||||
export const CargoContent = (props) => {
|
||||
const { act, data } = useBackend<any>();
|
||||
const [tab, setTab] = useSharedState(context, 'tab', 'catalog');
|
||||
const [tab, setTab] = useSharedState('tab', 'catalog');
|
||||
const {
|
||||
requestonly,
|
||||
} = data;
|
||||
@@ -137,7 +137,7 @@ export const CargoCatalog = (props) => {
|
||||
const [
|
||||
activeSupplyName,
|
||||
setActiveSupplyName,
|
||||
] = useSharedState(context, 'supply', supplies[0]?.name);
|
||||
] = useSharedState('supply', supplies[0]?.name);
|
||||
const activeSupply = supplies.find(supply => {
|
||||
return supply.name === activeSupplyName;
|
||||
});
|
||||
|
||||
@@ -13,7 +13,7 @@ const pod_grey = {
|
||||
};
|
||||
|
||||
const useCompact = context => {
|
||||
const [compact, setCompact] = useLocalState( 'compact', false);
|
||||
const [compact, setCompact] = useLocalState('compact', false);
|
||||
const toggleCompact = () => setCompact(!compact);
|
||||
return [compact, toggleCompact];
|
||||
};
|
||||
@@ -415,7 +415,7 @@ const ViewTabHolder = (props) => {
|
||||
const [
|
||||
tabPageIndex,
|
||||
setTabPageIndex,
|
||||
] = useLocalState( 'tabPageIndex', 1);
|
||||
] = useLocalState('tabPageIndex', 1);
|
||||
const { mapRef } = data;
|
||||
const TabPageComponent = TABPAGES[tabPageIndex].component();
|
||||
return (
|
||||
@@ -655,7 +655,7 @@ const ReverseMenu = (props) => {
|
||||
const [
|
||||
tabPageIndex,
|
||||
setTabPageIndex,
|
||||
] = useLocalState( 'tabPageIndex', 1);
|
||||
] = useLocalState('tabPageIndex', 1);
|
||||
return (
|
||||
<Section
|
||||
fill
|
||||
|
||||
@@ -48,8 +48,8 @@ export const ChemFilter = (props) => {
|
||||
left = [],
|
||||
right = [],
|
||||
} = data;
|
||||
const [leftName, setLeftName] = useLocalState( 'leftName', '');
|
||||
const [rightName, setRightName] = useLocalState( 'rightName', '');
|
||||
const [leftName, setLeftName] = useLocalState('leftName', '');
|
||||
const [rightName, setRightName] = useLocalState('rightName', '');
|
||||
return (
|
||||
<Window
|
||||
width={500}
|
||||
|
||||
@@ -223,27 +223,27 @@ const PackagingControls = (props) => {
|
||||
const [
|
||||
pillAmount,
|
||||
setPillAmount,
|
||||
] = useSharedState(context, 'pillAmount', 1);
|
||||
] = useSharedState('pillAmount', 1);
|
||||
const [
|
||||
patchAmount,
|
||||
setPatchAmount,
|
||||
] = useSharedState(context, 'patchAmount', 1);
|
||||
] = useSharedState('patchAmount', 1);
|
||||
const [
|
||||
bottleAmount,
|
||||
setBottleAmount,
|
||||
] = useSharedState(context, 'bottleAmount', 1);
|
||||
] = useSharedState('bottleAmount', 1);
|
||||
const [
|
||||
packAmount,
|
||||
setPackAmount,
|
||||
] = useSharedState(context, 'packAmount', 1);
|
||||
] = useSharedState('packAmount', 1);
|
||||
const [
|
||||
vialAmount,
|
||||
setvialAmount,
|
||||
] = useSharedState(context, 'setvialAmount', 1);
|
||||
] = useSharedState('setvialAmount', 1);
|
||||
const [
|
||||
dartAmount,
|
||||
setdartAmount,
|
||||
] = useSharedState(context, 'setdartAmount', 1);
|
||||
] = useSharedState('setdartAmount', 1);
|
||||
const {
|
||||
condi,
|
||||
chosenPillStyle,
|
||||
|
||||
@@ -9,11 +9,11 @@ export const ChemReactionChamber = (props) => {
|
||||
const [
|
||||
reagentName,
|
||||
setReagentName,
|
||||
] = useLocalState( 'reagentName', '');
|
||||
] = useLocalState('reagentName', '');
|
||||
const [
|
||||
reagentQuantity,
|
||||
setReagentQuantity,
|
||||
] = useLocalState( 'reagentQuantity', 1);
|
||||
] = useLocalState('reagentQuantity', 1);
|
||||
const emptying = data.emptying;
|
||||
const reagents = data.reagents || [];
|
||||
return (
|
||||
|
||||
@@ -13,7 +13,7 @@ type CircuitAdminPanelData = {
|
||||
}
|
||||
|
||||
export const CircuitAdminPanel = (props) => {
|
||||
const { act, data } = useBackend<CircuitAdminPanelData>(context);
|
||||
const { act, data } = useBackend<CircuitAdminPanelData>();
|
||||
|
||||
return (
|
||||
<Window title="Circuit Admin Panel" width={1200} height={500} >
|
||||
|
||||
@@ -32,7 +32,7 @@ export const ClockworkSlab = (props) => {
|
||||
const [
|
||||
tab,
|
||||
setTab,
|
||||
] = useSharedState(context, 'tab', 'Application');
|
||||
] = useSharedState('tab', 'Application');
|
||||
|
||||
const tierInfo = tier_infos
|
||||
&& tier_infos[tab]
|
||||
@@ -41,7 +41,7 @@ export const ClockworkSlab = (props) => {
|
||||
const [
|
||||
searchText,
|
||||
setSearchText,
|
||||
] = useLocalState( 'searchText', '');
|
||||
] = useLocalState('searchText', '');
|
||||
|
||||
const testSearch = createSearch(searchText, script => {
|
||||
return script.name + script.descname;
|
||||
|
||||
@@ -48,7 +48,7 @@ const MessageModal = (props) => {
|
||||
const { data } = useBackend<any>();
|
||||
const { maxMessageLength } = data;
|
||||
|
||||
const [input, setInput] = useLocalState( props.label, "");
|
||||
const [input, setInput] = useLocalState(props.label, "");
|
||||
|
||||
const longEnough = props.minLength === undefined
|
||||
|| input.length >= props.minLength;
|
||||
@@ -200,8 +200,8 @@ const PageChangingStatus = (props) => {
|
||||
const { act, data } = useBackend<any>();
|
||||
const { maxStatusLineLength } = data;
|
||||
|
||||
const [lineOne, setLineOne] = useLocalState( "lineOne", data.lineOne);
|
||||
const [lineTwo, setLineTwo] = useLocalState( "lineTwo", data.lineTwo);
|
||||
const [lineOne, setLineOne] = useLocalState("lineOne", data.lineOne);
|
||||
const [lineTwo, setLineTwo] = useLocalState("lineTwo", data.lineTwo);
|
||||
|
||||
return (
|
||||
<Box>
|
||||
@@ -332,7 +332,7 @@ const PageMain = (props) => {
|
||||
const [
|
||||
[showAlertLevelConfirm, confirmingAlertLevelTick],
|
||||
setShowAlertLevelConfirm,
|
||||
] = useLocalState( "showConfirmPrompt", [null, null]);
|
||||
] = useLocalState("showConfirmPrompt", [null, null]);
|
||||
|
||||
return (
|
||||
<Box>
|
||||
|
||||
@@ -67,10 +67,10 @@ const MaterialCost = (props: {
|
||||
};
|
||||
|
||||
export const ComponentPrinter = (props) => {
|
||||
const { act, data } = useBackend<ComponentPrinterData>(context);
|
||||
const { act, data } = useBackend<ComponentPrinterData>();
|
||||
|
||||
const [currentCategory, setCurrentCategory] = useLocalState( "category", CATEGORY_ALL);
|
||||
const [searchText, setSearchText] = useLocalState( "searchText", "");
|
||||
const [currentCategory, setCurrentCategory] = useLocalState("category", CATEGORY_ALL);
|
||||
const [searchText, setSearchText] = useLocalState("searchText", "");
|
||||
|
||||
return (
|
||||
<Window title="Component Printer" width={900} height={700}>
|
||||
|
||||
@@ -40,7 +40,7 @@ const filterBoxColor = (color: string) => {
|
||||
};
|
||||
|
||||
export const DecalPainter = (props) => {
|
||||
const { act, data } = useBackend<DecalPainterData>(context);
|
||||
const { act, data } = useBackend<DecalPainterData>();
|
||||
|
||||
const custom_color_selected = !data.color_list.some(
|
||||
(color) => color.color === data.current_color
|
||||
@@ -137,7 +137,7 @@ type IconButtonParams = {
|
||||
};
|
||||
|
||||
const IconButton = (props: IconButtonParams, context) => {
|
||||
const { act, data } = useBackend<DecalPainterData>(context);
|
||||
const { act, data } = useBackend<DecalPainterData>();
|
||||
|
||||
const generateIconKey = (decal: string, dir: number, color: string) =>
|
||||
`${data.icon_prefix} ${decal}_${dir}_${color.replace('#', '')}`;
|
||||
|
||||
@@ -111,7 +111,7 @@ type ToolData = {
|
||||
}
|
||||
|
||||
export const ExodroneConsole = (props) => {
|
||||
const { data } = useBackend<ExodroneConsoleData>(context);
|
||||
const { data } = useBackend<ExodroneConsoleData>();
|
||||
const {
|
||||
signal_lost,
|
||||
} = data;
|
||||
@@ -119,7 +119,7 @@ export const ExodroneConsole = (props) => {
|
||||
const [
|
||||
choosingTools,
|
||||
setChoosingTools,
|
||||
] = useLocalState( 'choosingTools', false);
|
||||
] = useLocalState('choosingTools', false);
|
||||
|
||||
return (
|
||||
<Window width={650} height={500}>
|
||||
@@ -171,7 +171,7 @@ const SignalLostModal = (props) => {
|
||||
};
|
||||
|
||||
const DroneSelectionSection = (props) => {
|
||||
const { act, data } = useBackend<ExodroneConsoleData>(context);
|
||||
const { act, data } = useBackend<ExodroneConsoleData>();
|
||||
const {
|
||||
all_drones,
|
||||
} = data;
|
||||
@@ -214,7 +214,7 @@ const DroneSelectionSection = (props) => {
|
||||
|
||||
|
||||
const ToolSelectionModal = (props) => {
|
||||
const { act, data } = useBackend<ExodroneConsoleData>(context);
|
||||
const { act, data } = useBackend<ExodroneConsoleData>();
|
||||
const {
|
||||
all_tools = {},
|
||||
} = data;
|
||||
@@ -222,7 +222,7 @@ const ToolSelectionModal = (props) => {
|
||||
const [
|
||||
choosingTools,
|
||||
setChoosingTools,
|
||||
] = useLocalState( 'choosingTools', false);
|
||||
] = useLocalState('choosingTools', false);
|
||||
|
||||
const toolData = Object.keys(all_tools);
|
||||
return (
|
||||
@@ -267,7 +267,7 @@ const ToolSelectionModal = (props) => {
|
||||
};
|
||||
|
||||
const EquipmentBox = (props) => {
|
||||
const { act, data } = useBackend<ExodroneConsoleData>(context);
|
||||
const { act, data } = useBackend<ExodroneConsoleData>();
|
||||
const {
|
||||
configurable,
|
||||
all_tools = {},
|
||||
@@ -350,7 +350,7 @@ const EquipmentBox = (props) => {
|
||||
};
|
||||
|
||||
const EquipmentGrid = (props) => {
|
||||
const { act, data } = useBackend<ExodroneConsoleData>(context);
|
||||
const { act, data } = useBackend<ExodroneConsoleData>();
|
||||
const {
|
||||
cargo,
|
||||
configurable,
|
||||
@@ -358,7 +358,7 @@ const EquipmentGrid = (props) => {
|
||||
const [
|
||||
choosingTools,
|
||||
setChoosingTools,
|
||||
] = useLocalState( 'choosingTools', false);
|
||||
] = useLocalState('choosingTools', false);
|
||||
return (
|
||||
<Stack vertical fill>
|
||||
<Stack.Item grow>
|
||||
@@ -411,7 +411,7 @@ const EquipmentGrid = (props) => {
|
||||
};
|
||||
|
||||
const DroneStatus = (props) => {
|
||||
const { act, data } = useBackend<ExodroneConsoleData>(context);
|
||||
const { act, data } = useBackend<ExodroneConsoleData>();
|
||||
const {
|
||||
drone_integrity,
|
||||
drone_max_integrity,
|
||||
@@ -461,7 +461,7 @@ const NoSiteDimmer = () => {
|
||||
|
||||
const TravelTargetSelectionScreen = (props) => {
|
||||
// List of sites and eta travel times to each
|
||||
const { act, data } = useBackend<ExodroneConsoleData>(context);
|
||||
const { act, data } = useBackend<ExodroneConsoleData>();
|
||||
const {
|
||||
sites,
|
||||
site,
|
||||
@@ -484,11 +484,11 @@ const TravelTargetSelectionScreen = (props) => {
|
||||
const [
|
||||
choosingTools,
|
||||
setChoosingTools,
|
||||
] = useLocalState( 'choosingTools', false);
|
||||
] = useLocalState('choosingTools', false);
|
||||
const [
|
||||
TravelDimmerShown,
|
||||
setTravelDimmerShown,
|
||||
] = useLocalState( 'TravelDimmerShown', false);
|
||||
] = useLocalState('TravelDimmerShown', false);
|
||||
|
||||
const travel_to = ref => {
|
||||
setTravelDimmerShown(false);
|
||||
@@ -582,7 +582,7 @@ const TravelTargetSelectionScreen = (props) => {
|
||||
};
|
||||
|
||||
const TravelDimmer = (props) => {
|
||||
const { act, data } = useBackend<ExodroneConsoleData>(context);
|
||||
const { act, data } = useBackend<ExodroneConsoleData>();
|
||||
const {
|
||||
travel_time,
|
||||
travel_time_left,
|
||||
@@ -608,7 +608,7 @@ const TravelDimmer = (props) => {
|
||||
};
|
||||
|
||||
const TimeoutScreen = (props) => {
|
||||
const { act, data } = useBackend<ExodroneConsoleData>(context);
|
||||
const { act, data } = useBackend<ExodroneConsoleData>();
|
||||
const {
|
||||
wait_time_left,
|
||||
wait_message,
|
||||
@@ -634,7 +634,7 @@ const TimeoutScreen = (props) => {
|
||||
};
|
||||
|
||||
const ExplorationScreen = (props) => {
|
||||
const { act, data } = useBackend<ExodroneConsoleData>(context);
|
||||
const { act, data } = useBackend<ExodroneConsoleData>();
|
||||
const {
|
||||
site,
|
||||
event,
|
||||
@@ -644,7 +644,7 @@ const ExplorationScreen = (props) => {
|
||||
const [
|
||||
TravelDimmerShown,
|
||||
setTravelDimmerShown,
|
||||
] = useLocalState( 'TravelDimmerShown', false);
|
||||
] = useLocalState('TravelDimmerShown', false);
|
||||
|
||||
if (TravelDimmerShown) {
|
||||
return (<TravelTargetSelectionScreen showCancelButton />);
|
||||
@@ -689,7 +689,7 @@ const ExplorationScreen = (props) => {
|
||||
};
|
||||
|
||||
const EventScreen = (props) => {
|
||||
const { act, data } = useBackend<ExodroneConsoleData>(context);
|
||||
const { act, data } = useBackend<ExodroneConsoleData>();
|
||||
const {
|
||||
drone_status,
|
||||
event,
|
||||
@@ -753,7 +753,7 @@ type AdventureScreenProps = {
|
||||
}
|
||||
|
||||
export const AdventureScreen = (props: AdventureScreenProps, context) => {
|
||||
const { act, data } = useBackend<AdventureDataProvider>(context);
|
||||
const { act, data } = useBackend<AdventureDataProvider>();
|
||||
const {
|
||||
adventure_data,
|
||||
} = data;
|
||||
@@ -800,7 +800,7 @@ export const AdventureScreen = (props: AdventureScreenProps, context) => {
|
||||
};
|
||||
|
||||
const DroneScreen = (props) => {
|
||||
const { act, data } = useBackend<ExodroneConsoleData>(context);
|
||||
const { act, data } = useBackend<ExodroneConsoleData>();
|
||||
const {
|
||||
drone_status,
|
||||
event,
|
||||
@@ -824,7 +824,7 @@ const DroneScreen = (props) => {
|
||||
};
|
||||
|
||||
const ExodroneConsoleContent = (props) => {
|
||||
const { act, data } = useBackend<ExodroneConsoleData>(context);
|
||||
const { act, data } = useBackend<ExodroneConsoleData>();
|
||||
const {
|
||||
drone,
|
||||
drone_name,
|
||||
|
||||
@@ -40,7 +40,7 @@ const ScanFailedModal = (props) => {
|
||||
};
|
||||
|
||||
const ScanSelectionSection = (props) => {
|
||||
const { act, data } = useBackend<ScanData>(context);
|
||||
const { act, data } = useBackend<ScanData>();
|
||||
const {
|
||||
scan_power,
|
||||
point_scan_eta,
|
||||
@@ -139,7 +139,7 @@ type ScanInProgressData = {
|
||||
}
|
||||
|
||||
const ScanInProgressModal = (props) => {
|
||||
const { act, data } = useBackend<ScanInProgressData>(context);
|
||||
const { act, data } = useBackend<ScanInProgressData>();
|
||||
const {
|
||||
scan_time,
|
||||
scan_power,
|
||||
@@ -188,7 +188,7 @@ type ExoscannerConsoleData = {
|
||||
}
|
||||
|
||||
export const ExoscannerConsole = (props) => {
|
||||
const { act, data } = useBackend<ExoscannerConsoleData>(context);
|
||||
const { act, data } = useBackend<ExoscannerConsoleData>();
|
||||
const {
|
||||
scan_in_progress,
|
||||
scan_power,
|
||||
|
||||
@@ -237,7 +237,7 @@ const PartLists = (props) => {
|
||||
const [
|
||||
searchText,
|
||||
setSearchText,
|
||||
] = useSharedState(context, "search_text", "");
|
||||
] = useSharedState("search_text", "");
|
||||
|
||||
if (!selectedPartTab || !buildableParts[selectedPartTab]) {
|
||||
const validSet = getFirstValidPartSet(partSets);
|
||||
@@ -325,7 +325,7 @@ const PartCategory = (props) => {
|
||||
} = props;
|
||||
const [
|
||||
displayMatCost,
|
||||
] = useSharedState(context, 'display_mats', false);
|
||||
] = useSharedState('display_mats', false);
|
||||
if (!forceShow && parts.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ const FilterIntegerEntry = (props) => {
|
||||
const FilterFloatEntry = (props) => {
|
||||
const { value, name, filterName } = props;
|
||||
const { act } = useBackend<any>();
|
||||
const [step, setStep] = useLocalState( `${filterName}-${name}`, 0.01);
|
||||
const [step, setStep] = useLocalState(`${filterName}-${name}`, 0.01);
|
||||
return (
|
||||
<>
|
||||
<NumberInput
|
||||
@@ -243,8 +243,8 @@ export const Filteriffic = (props) => {
|
||||
const filters = data.target_filter_data || {};
|
||||
const hasFilters = filters !== {};
|
||||
const filterDefaults = data["filter_info"];
|
||||
const [massApplyPath, setMassApplyPath] = useLocalState( 'massApplyPath', '');
|
||||
const [hiddenSecret, setHiddenSecret] = useLocalState( 'hidden', false);
|
||||
const [massApplyPath, setMassApplyPath] = useLocalState('massApplyPath', '');
|
||||
const [hiddenSecret, setHiddenSecret] = useLocalState('hidden', false);
|
||||
return (
|
||||
<Window
|
||||
title="Filteriffic"
|
||||
|
||||
@@ -18,7 +18,7 @@ export const FishCatalog = (props) => {
|
||||
const [
|
||||
currentFish,
|
||||
setCurrentFish,
|
||||
] = useLocalState( 'currentFish', null);
|
||||
] = useLocalState('currentFish', null);
|
||||
return (
|
||||
<Window
|
||||
width={500}
|
||||
|
||||
@@ -84,7 +84,7 @@ export const PanelOptions = (props) => {
|
||||
''
|
||||
);
|
||||
|
||||
const [announce, setAnnounce] = useLocalState( 'announce', true);
|
||||
const [announce, setAnnounce] = useLocalState('announce', true);
|
||||
|
||||
return (
|
||||
<Stack width="240px">
|
||||
@@ -113,12 +113,12 @@ export const PanelOptions = (props) => {
|
||||
};
|
||||
|
||||
export const EventSection = (props) => {
|
||||
const { data, act } = useBackend<ForceEventData>(context);
|
||||
const { data, act } = useBackend<ForceEventData>();
|
||||
const { categories, events } = data;
|
||||
|
||||
const [category] = useLocalState( 'category', categories[0]);
|
||||
const [searchQuery] = useLocalState( 'searchQuery', '');
|
||||
const [announce] = useLocalState( 'announce', true);
|
||||
const [category] = useLocalState('category', categories[0]);
|
||||
const [searchQuery] = useLocalState('searchQuery', '');
|
||||
const [announce] = useLocalState('announce', true);
|
||||
|
||||
const preparedEvents = paginateEvents(
|
||||
events.filter((event) => {
|
||||
@@ -166,7 +166,7 @@ export const EventSection = (props) => {
|
||||
};
|
||||
|
||||
export const EventTabs = (props) => {
|
||||
const { data } = useBackend<ForceEventData>(context);
|
||||
const { data } = useBackend<ForceEventData>();
|
||||
const { categories } = data;
|
||||
|
||||
const [category, setCategory] = useLocalState(
|
||||
|
||||
@@ -54,7 +54,7 @@ const DirectionAbbreviation : Record<Direction, string> = {
|
||||
};
|
||||
|
||||
const ConfigDisplay = (props) => {
|
||||
const { act, data } = useBackend<GreyscaleMenuData>(context);
|
||||
const { act, data } = useBackend<GreyscaleMenuData>();
|
||||
return (
|
||||
<Section title="Designs">
|
||||
<LabeledList>
|
||||
@@ -74,7 +74,7 @@ const ConfigDisplay = (props) => {
|
||||
};
|
||||
|
||||
const ColorDisplay = (props) => {
|
||||
const { act, data } = useBackend<GreyscaleMenuData>(context);
|
||||
const { act, data } = useBackend<GreyscaleMenuData>();
|
||||
const colors = (data.colors || []);
|
||||
return (
|
||||
<Section title="Colors">
|
||||
@@ -124,7 +124,7 @@ const ColorDisplay = (props) => {
|
||||
};
|
||||
|
||||
const PreviewCompassSelect = (props) => {
|
||||
const { act, data } = useBackend<GreyscaleMenuData>(context);
|
||||
const { act, data } = useBackend<GreyscaleMenuData>();
|
||||
return (
|
||||
<Box>
|
||||
<Stack vertical>
|
||||
@@ -154,7 +154,7 @@ const PreviewCompassSelect = (props) => {
|
||||
|
||||
const SingleDirection = (props) => {
|
||||
const { dir } = props;
|
||||
const { data, act } = useBackend<GreyscaleMenuData>(context);
|
||||
const { data, act } = useBackend<GreyscaleMenuData>();
|
||||
return (
|
||||
<Flex.Item grow={1} basis={0}>
|
||||
<Button
|
||||
@@ -172,7 +172,7 @@ const SingleDirection = (props) => {
|
||||
};
|
||||
|
||||
const IconStatesDisplay = (props) => {
|
||||
const { data, act } = useBackend<GreyscaleMenuData>(context);
|
||||
const { data, act } = useBackend<GreyscaleMenuData>();
|
||||
return (
|
||||
<Section title="Icon States">
|
||||
<Flex>
|
||||
@@ -194,7 +194,7 @@ const IconStatesDisplay = (props) => {
|
||||
};
|
||||
|
||||
const PreviewDisplay = (props) => {
|
||||
const { data } = useBackend<GreyscaleMenuData>(context);
|
||||
const { data } = useBackend<GreyscaleMenuData>();
|
||||
return (
|
||||
<Section title={`Preview (${data.sprites_dir})`}>
|
||||
<Table>
|
||||
@@ -282,7 +282,7 @@ const LoadingAnimation = () => {
|
||||
};
|
||||
|
||||
export const GreyscaleModifyMenu = (props) => {
|
||||
const { act, data } = useBackend<GreyscaleMenuData>(context);
|
||||
const { act, data } = useBackend<GreyscaleMenuData>();
|
||||
return (
|
||||
<Window
|
||||
title="Color Configuration"
|
||||
|
||||
@@ -20,8 +20,8 @@ export const VariableMenu = (props) => {
|
||||
...rest
|
||||
} = props;
|
||||
|
||||
const [name, setName] = useLocalState( "variable_name", null);
|
||||
const [type, setType] = useLocalState( "variable_type", types[1]);
|
||||
const [name, setName] = useLocalState("variable_name", null);
|
||||
const [type, setType] = useLocalState("variable_type", types[1]);
|
||||
|
||||
return (
|
||||
<Section
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Window } from '../layouts';
|
||||
|
||||
export const MedicalKiosk = (props) => {
|
||||
const { act, data } = useBackend<any>();
|
||||
const [scanIndex] = useSharedState(context, 'scanIndex');
|
||||
const [scanIndex] = useSharedState('scanIndex');
|
||||
const {
|
||||
active_status_1,
|
||||
active_status_2,
|
||||
@@ -81,7 +81,7 @@ const MedicalKioskScanButton = (props) => {
|
||||
icon,
|
||||
} = props;
|
||||
const { act, data } = useBackend<any>();
|
||||
const [scanIndex, setScanIndex] = useSharedState(context, 'scanIndex');
|
||||
const [scanIndex, setScanIndex] = useSharedState('scanIndex');
|
||||
const paid = data[`active_status_${index}`];
|
||||
return (
|
||||
<Stack align="baseline">
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Window } from '../layouts';
|
||||
|
||||
export const Microscope = (props) => {
|
||||
const { act, data } = useBackend<any>();
|
||||
const [tab, setTab] = useSharedState(context, 'tab', 1);
|
||||
const [tab, setTab] = useSharedState('tab', 1);
|
||||
const {
|
||||
has_dish,
|
||||
cell_lines = [],
|
||||
|
||||
@@ -16,7 +16,7 @@ export const NaniteProgramHub = (props) => {
|
||||
const [
|
||||
selectedCategory,
|
||||
setSelectedCategory,
|
||||
] = useSharedState(context, 'category');
|
||||
] = useSharedState('category');
|
||||
const programsInCategory = programs
|
||||
&& programs[selectedCategory]
|
||||
|| [];
|
||||
|
||||
@@ -19,7 +19,7 @@ export const NtosCard = (props) => {
|
||||
|
||||
export const NtosCardContent = (props) => {
|
||||
const { act, data } = useBackend<any>();
|
||||
const [tab, setTab] = useLocalState( 'tab', 1);
|
||||
const [tab, setTab] = useLocalState('tab', 1);
|
||||
const {
|
||||
authenticated,
|
||||
regions = [],
|
||||
@@ -35,7 +35,7 @@ export const NtosCardContent = (props) => {
|
||||
const [
|
||||
selectedDepartment,
|
||||
setSelectedDepartment,
|
||||
] = useLocalState( 'department', Object.keys(jobs)[0]);
|
||||
] = useLocalState('department', Object.keys(jobs)[0]);
|
||||
if (!have_id_slot) {
|
||||
return (
|
||||
<NoticeBox>
|
||||
|
||||
@@ -33,7 +33,7 @@ export const ProgressSwitch = param => {
|
||||
|
||||
export const NtosCyborgRemoteMonitorContent = (props) => {
|
||||
const { act, data } = useBackend<any>();
|
||||
const [tab_main, setTab_main] = useSharedState(context, 'tab_main', 1);
|
||||
const [tab_main, setTab_main] = useSharedState('tab_main', 1);
|
||||
const {
|
||||
card,
|
||||
cyborgs = [],
|
||||
|
||||
@@ -27,7 +27,7 @@ export const NtosNetDownloader = (props) => {
|
||||
const [
|
||||
selectedCategory,
|
||||
setSelectedCategory,
|
||||
] = useLocalState( 'category', all_categories[0]);
|
||||
] = useLocalState('category', all_categories[0]);
|
||||
const items = flow([
|
||||
// This filters the list to only contain programs with category
|
||||
selectedCategory !== all_categories[0]
|
||||
|
||||
@@ -5,8 +5,8 @@ import { NtosWindow } from '../layouts';
|
||||
|
||||
export const NtosPortraitPrinter = (props) => {
|
||||
const { act, data } = useBackend<any>();
|
||||
const [tabIndex, setTabIndex] = useLocalState( 'tabIndex', 0);
|
||||
const [listIndex, setListIndex] = useLocalState( 'listIndex', 0);
|
||||
const [tabIndex, setTabIndex] = useLocalState('tabIndex', 0);
|
||||
const [listIndex, setListIndex] = useLocalState('listIndex', 0);
|
||||
const {
|
||||
library,
|
||||
library_secure,
|
||||
|
||||
@@ -19,8 +19,8 @@ export const NtosRobotact = (props) => {
|
||||
|
||||
export const NtosRobotactContent = (props) => {
|
||||
const { act, data } = useBackend<any>();
|
||||
const [tab_main, setTab_main] = useSharedState(context, 'tab_main', 1);
|
||||
const [tab_sub, setTab_sub] = useSharedState(context, 'tab_sub', 1);
|
||||
const [tab_main, setTab_main] = useSharedState('tab_main', 1);
|
||||
const [tab_sub, setTab_sub] = useSharedState('tab_sub', 1);
|
||||
const {
|
||||
charge,
|
||||
maxcharge,
|
||||
|
||||
@@ -27,7 +27,7 @@ const damageTypes = [
|
||||
];
|
||||
|
||||
export const OperatingComputer = (props) => {
|
||||
const [tab, setTab] = useSharedState(context, 'tab', 1);
|
||||
const [tab, setTab] = useSharedState('tab', 1);
|
||||
return (
|
||||
<Window
|
||||
width={350}
|
||||
|
||||
@@ -102,7 +102,7 @@ export const Orbit = (props) => {
|
||||
npcs,
|
||||
} = data;
|
||||
|
||||
const [searchText, setSearchText] = useLocalState( "searchText", "");
|
||||
const [searchText, setSearchText] = useLocalState("searchText", "");
|
||||
|
||||
const collatedAntagonists = {};
|
||||
for (const antagonist of antagonists) {
|
||||
|
||||
@@ -107,7 +107,7 @@ const MaterialRow = (props) => {
|
||||
const [
|
||||
amount,
|
||||
setAmount,
|
||||
] = useLocalState( "amount" + material.name, 1);
|
||||
] = useLocalState("amount" + material.name, 1);
|
||||
|
||||
const amountAvailable = Math.floor(material.amount);
|
||||
return (
|
||||
|
||||
@@ -16,11 +16,11 @@ export const PaintingMachine = (props) => {
|
||||
|
||||
const [
|
||||
selectedPDA,
|
||||
] = useSharedState(context, "pdaSelection", pdaTypes[Object.keys(pdaTypes)[0]]);
|
||||
] = useSharedState("pdaSelection", pdaTypes[Object.keys(pdaTypes)[0]]);
|
||||
|
||||
const [
|
||||
selectedTrim,
|
||||
] = useSharedState(context, "trimSelection", cardTrims[Object.keys(cardTrims)[0]]);
|
||||
] = useSharedState("trimSelection", cardTrims[Object.keys(cardTrims)[0]]);
|
||||
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ export const PainterDropdown = (props) => {
|
||||
const [
|
||||
selectedOption,
|
||||
setSelectedOption,
|
||||
] = useSharedState(context, stateKey, options[Object.keys(options)[0]]);
|
||||
] = useSharedState(stateKey, options[Object.keys(options)[0]]);
|
||||
|
||||
return (
|
||||
<Dropdown
|
||||
|
||||
@@ -5,8 +5,8 @@ import { Window } from '../layouts';
|
||||
|
||||
export const PortraitPicker = (props) => {
|
||||
const { act, data } = useBackend<any>();
|
||||
const [tabIndex, setTabIndex] = useLocalState( 'tabIndex', 0);
|
||||
const [listIndex, setListIndex] = useLocalState( 'listIndex', 0);
|
||||
const [tabIndex, setTabIndex] = useLocalState('tabIndex', 0);
|
||||
const [listIndex, setListIndex] = useLocalState('listIndex', 0);
|
||||
const {
|
||||
library,
|
||||
library_secure,
|
||||
|
||||
@@ -31,7 +31,7 @@ export const PowerMonitorContent = (props) => {
|
||||
const [
|
||||
sortByField,
|
||||
setSortByField,
|
||||
] = useLocalState( 'sortByField', null);
|
||||
] = useLocalState('sortByField', null);
|
||||
const supply = history.supply[history.supply.length - 1] || 0;
|
||||
const demand = history.demand[history.demand.length - 1] || 0;
|
||||
const supplyData = history.supply.map((value, i) => [i, value]);
|
||||
|
||||
@@ -22,7 +22,7 @@ const ShoppingTab = (props) => {
|
||||
const [
|
||||
shopIndex,
|
||||
setShopIndex,
|
||||
] = useLocalState( 'shop-index', 1);
|
||||
] = useLocalState('shop-index', 1);
|
||||
const mapped_food = order_datums.filter(food => (
|
||||
food && food.cat === shopIndex
|
||||
));
|
||||
@@ -224,7 +224,7 @@ export const ProduceConsole = (props) => {
|
||||
const [
|
||||
tabIndex,
|
||||
setTabIndex,
|
||||
] = useLocalState( 'tab-index', 1);
|
||||
] = useLocalState('tab-index', 1);
|
||||
const TabComponent = TAB2NAME[tabIndex-1].component();
|
||||
return (
|
||||
<Window
|
||||
|
||||
@@ -67,7 +67,7 @@ export const RapidPipeDispenser = (props) => {
|
||||
const [
|
||||
categoryName,
|
||||
setCategoryName,
|
||||
] = useLocalState( 'categoryName');
|
||||
] = useLocalState('categoryName');
|
||||
const shownCategory = categories
|
||||
.find(category => category.cat_name === categoryName)
|
||||
|| categories[0];
|
||||
|
||||
@@ -42,7 +42,7 @@ export const Reagents = (props) => {
|
||||
{ flag: bitflags.COMPETITIVE, icon: "recycle" },
|
||||
];
|
||||
|
||||
const [page, setPage] = useLocalState( "page", 1);
|
||||
const [page, setPage] = useLocalState("page", 1);
|
||||
|
||||
return (
|
||||
<Window
|
||||
@@ -129,7 +129,7 @@ export const Reagents = (props) => {
|
||||
|
||||
const TagBox = (props) => {
|
||||
const { act, data } = useBackend<any>();
|
||||
const [page, setPage] = useLocalState( "page", 1);
|
||||
const [page, setPage] = useLocalState("page", 1);
|
||||
const { bitflags } = props;
|
||||
const { selectedBitflags } = data;
|
||||
return (
|
||||
@@ -344,7 +344,7 @@ const TagBox = (props) => {
|
||||
|
||||
const RecipeLibrary = (props) => {
|
||||
const { act, data } = useBackend<any>();
|
||||
const [page, setPage] = useLocalState( "page", 1);
|
||||
const [page, setPage] = useLocalState("page", 1);
|
||||
const { flagIcons } = props;
|
||||
const {
|
||||
selectedBitflags,
|
||||
|
||||
@@ -11,7 +11,7 @@ const ALIGNMENT2COLOR = {
|
||||
|
||||
export const ReligiousTool = (props) => {
|
||||
const { act, data } = useBackend<any>();
|
||||
const [tab, setTab] = useSharedState(context, 'tab', 1);
|
||||
const [tab, setTab] = useSharedState('tab', 1);
|
||||
const {
|
||||
sects,
|
||||
alignment,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Window } from '../layouts';
|
||||
|
||||
export const RoboticsControlConsole = (props) => {
|
||||
const { act, data } = useBackend<any>();
|
||||
const [tab, setTab] = useSharedState(context, 'tab', 1);
|
||||
const [tab, setTab] = useSharedState('tab', 1);
|
||||
const {
|
||||
can_hack,
|
||||
cyborgs = [],
|
||||
|
||||
@@ -160,7 +160,7 @@ export const RouletteBetTable = (props) => {
|
||||
const [
|
||||
customBet,
|
||||
setCustomBet,
|
||||
] = useLocalState( 'customBet', 500);
|
||||
] = useLocalState('customBet', 500);
|
||||
|
||||
let {
|
||||
BetType,
|
||||
|
||||
@@ -550,7 +550,7 @@ export const Secrets = (props) => {
|
||||
const [
|
||||
tabIndex,
|
||||
setTabIndex,
|
||||
] = useLocalState( 'tab-index', 2);
|
||||
] = useLocalState('tab-index', 2);
|
||||
const TabComponent = TAB2NAME[tabIndex-1].component();
|
||||
return (
|
||||
<Window
|
||||
|
||||
@@ -10,7 +10,7 @@ import { Window } from '../layouts';
|
||||
const getOutfitKey = outfit => outfit.path || outfit.ref;
|
||||
|
||||
const useOutfitTabs = (context, categories) => {
|
||||
return useLocalState( 'selected-tab', categories[0]);
|
||||
return useLocalState('selected-tab', categories[0]);
|
||||
};
|
||||
|
||||
export const SelectEquipment = (props) => {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Button, Flex, LabeledList, Section, Table, Tabs } from 'tgui-core/compo
|
||||
import { Window } from '../layouts';
|
||||
|
||||
export const ShuttleManipulator = (props) => {
|
||||
const [tab, setTab] = useLocalState( 'tab', 1);
|
||||
const [tab, setTab] = useLocalState('tab', 1);
|
||||
return (
|
||||
<Window
|
||||
title="Shuttle Manipulator"
|
||||
@@ -106,7 +106,7 @@ export const ShuttleManipulatorTemplates = (props) => {
|
||||
const [
|
||||
selectedTemplateId,
|
||||
setSelectedTemplateId,
|
||||
] = useLocalState( 'templateId', Object.keys(templateObject)[0]);
|
||||
] = useLocalState('templateId', Object.keys(templateObject)[0]);
|
||||
const actualTemplates = templateObject[selectedTemplateId]?.templates || [];
|
||||
return (
|
||||
<Section>
|
||||
|
||||
@@ -29,7 +29,7 @@ type Controls = {
|
||||
};
|
||||
|
||||
export const SimpleBot = (_, context) => {
|
||||
const { data } = useBackend<SimpleBotContext>(context);
|
||||
const { data } = useBackend<SimpleBotContext>();
|
||||
const { can_hack, locked } = data;
|
||||
const access = (!locked || can_hack);
|
||||
|
||||
@@ -59,7 +59,7 @@ export const SimpleBot = (_, context) => {
|
||||
|
||||
/** Creates a lock button at the top of the controls */
|
||||
const TabDisplay = (_, context) => {
|
||||
const { act, data } = useBackend<SimpleBotContext>(context);
|
||||
const { act, data } = useBackend<SimpleBotContext>();
|
||||
const { can_hack, locked, pai } = data;
|
||||
const { allow_pai } = pai;
|
||||
|
||||
@@ -81,7 +81,7 @@ const TabDisplay = (_, context) => {
|
||||
|
||||
/** If user is a bad silicon, they can press this button to hack the bot */
|
||||
const HackButton = (_, context) => {
|
||||
const { act, data } = useBackend<SimpleBotContext>(context);
|
||||
const { act, data } = useBackend<SimpleBotContext>();
|
||||
const { can_hack, emagged } = data;
|
||||
|
||||
return (
|
||||
@@ -103,7 +103,7 @@ const HackButton = (_, context) => {
|
||||
|
||||
/** Creates a button indicating PAI status and offers the eject action */
|
||||
const PaiButton = (_, context) => {
|
||||
const { act, data } = useBackend<SimpleBotContext>(context);
|
||||
const { act, data } = useBackend<SimpleBotContext>();
|
||||
const { card_inserted } = data.pai;
|
||||
|
||||
if (!card_inserted) {
|
||||
@@ -130,7 +130,7 @@ const PaiButton = (_, context) => {
|
||||
|
||||
/** Displays the bot's standard settings: Power, patrol, etc. */
|
||||
const SettingsDisplay = (_, context) => {
|
||||
const { act, data } = useBackend<SimpleBotContext>(context);
|
||||
const { act, data } = useBackend<SimpleBotContext>();
|
||||
const { settings } = data;
|
||||
const { airplane_mode, patrol_station, power, maintenance_lock } = settings;
|
||||
|
||||
@@ -195,7 +195,7 @@ const SettingsDisplay = (_, context) => {
|
||||
* Calls the helper to identify which button to use.
|
||||
*/
|
||||
const ControlsDisplay = (_, context) => {
|
||||
const { data } = useBackend<SimpleBotContext>(context);
|
||||
const { data } = useBackend<SimpleBotContext>();
|
||||
const { custom_controls } = data;
|
||||
|
||||
return (
|
||||
@@ -221,7 +221,7 @@ const ControlsDisplay = (_, context) => {
|
||||
* Might need some fine tuning if you are using more advanced controls.
|
||||
*/
|
||||
const ControlHelper = (props) => {
|
||||
const { act } = useBackend<SimpleBotContext>(context);
|
||||
const { act } = useBackend<SimpleBotContext>();
|
||||
const { control } = props;
|
||||
if (control[0] === 'sync_tech') {
|
||||
/** Control is for sync - this is medbot specific */
|
||||
@@ -251,7 +251,7 @@ const ControlHelper = (props) => {
|
||||
|
||||
/** Small button to sync medbots with research. */
|
||||
const MedbotSync = (_, context) => {
|
||||
const { act } = useBackend<SimpleBotContext>(context);
|
||||
const { act } = useBackend<SimpleBotContext>();
|
||||
|
||||
return (
|
||||
<Tooltip
|
||||
@@ -269,7 +269,7 @@ const MedbotSync = (_, context) => {
|
||||
|
||||
/** Slider button for medbot injection thresholds */
|
||||
const InjectionThreshold = (props) => {
|
||||
const { act } = useBackend<SimpleBotContext>(context);
|
||||
const { act } = useBackend<SimpleBotContext>();
|
||||
const { control } = props;
|
||||
|
||||
return (
|
||||
@@ -293,7 +293,7 @@ const InjectionThreshold = (props) => {
|
||||
|
||||
/** Slider button for medbot healing thresholds */
|
||||
const MedbotThreshold = (props) => {
|
||||
const { act } = useBackend<SimpleBotContext>(context);
|
||||
const { act } = useBackend<SimpleBotContext>();
|
||||
const { control } = props;
|
||||
|
||||
return (
|
||||
@@ -317,7 +317,7 @@ const MedbotThreshold = (props) => {
|
||||
|
||||
/** Tile stacks for floorbots - shows number and eject button */
|
||||
const FloorbotTiles = (props) => {
|
||||
const { act } = useBackend<SimpleBotContext>(context);
|
||||
const { act } = useBackend<SimpleBotContext>();
|
||||
const { control } = props;
|
||||
|
||||
return (
|
||||
@@ -333,7 +333,7 @@ const FloorbotTiles = (props) => {
|
||||
|
||||
/** Direction indicator for floorbot when line mode is chosen. */
|
||||
const FloorbotLine = (props) => {
|
||||
const { act } = useBackend<SimpleBotContext>(context);
|
||||
const { act } = useBackend<SimpleBotContext>();
|
||||
const { control } = props;
|
||||
|
||||
return (
|
||||
|
||||
@@ -86,7 +86,7 @@ const TableOfContents = (props) => {
|
||||
const [
|
||||
tabIndex,
|
||||
setTabIndex,
|
||||
] = useLocalState( 'tab-index', 1);
|
||||
] = useLocalState('tab-index', 1);
|
||||
return (
|
||||
<Box textAlign="center">
|
||||
<Button
|
||||
@@ -361,7 +361,7 @@ export const Spellbook = (props) => {
|
||||
const [
|
||||
tabIndex,
|
||||
setTabIndex,
|
||||
] = useLocalState( 'tab-index', 1);
|
||||
] = 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
|
||||
|
||||
@@ -15,7 +15,7 @@ export const Stack = (props) => {
|
||||
const [
|
||||
searchText,
|
||||
setSearchText,
|
||||
] = useLocalState( 'searchText', '');
|
||||
] = useLocalState('searchText', '');
|
||||
|
||||
const testSearch = createSearch(searchText, item => {
|
||||
return item;
|
||||
|
||||
@@ -29,7 +29,7 @@ enum Tab {
|
||||
}
|
||||
|
||||
const FutureStationTraitsPage = (props) => {
|
||||
const { act, data } = useBackend<StationTraitsData>(context);
|
||||
const { act, data } = useBackend<StationTraitsData>();
|
||||
const { future_station_traits } = data;
|
||||
|
||||
const [selectedTrait, setSelectedTrait] = useLocalState<string | null>(
|
||||
@@ -167,7 +167,7 @@ const FutureStationTraitsPage = (props) => {
|
||||
};
|
||||
|
||||
const ViewStationTraitsPage = (props) => {
|
||||
const { act, data } = useBackend<StationTraitsData>(context);
|
||||
const { act, data } = useBackend<StationTraitsData>();
|
||||
|
||||
return data.current_traits.length > 0 ? (
|
||||
<Stack vertical fill>
|
||||
|
||||
@@ -397,7 +397,7 @@ type StripMenuData = {
|
||||
};
|
||||
|
||||
export const StripMenu = (props) => {
|
||||
const { act, data } = useBackend<StripMenuData>(context);
|
||||
const { act, data } = useBackend<StripMenuData>();
|
||||
|
||||
const gridSpots = new Map<GridSpotKey, string>();
|
||||
if (data.long_strip_menu) {
|
||||
|
||||
@@ -272,7 +272,7 @@ export const StatusPane = (props) => {
|
||||
};
|
||||
|
||||
export const SyndPane = (props) => {
|
||||
const [tab, setTab] = useLocalState( 'tab', 1);
|
||||
const [tab, setTab] = useLocalState('tab', 1);
|
||||
return (
|
||||
<>
|
||||
<StatusPane state={props.state} />
|
||||
|
||||
@@ -47,7 +47,7 @@ export const TachyonArrayContent = (props) => {
|
||||
const [
|
||||
activeRecordName,
|
||||
setActiveRecordName,
|
||||
] = useSharedState(context, 'record', records[0]?.name);
|
||||
] = useSharedState('record', records[0]?.name);
|
||||
const activeRecord = records.find(record => {
|
||||
return record.name === activeRecordName;
|
||||
});
|
||||
|
||||
@@ -148,11 +148,11 @@ export const TechwebContent = (props) => {
|
||||
const [
|
||||
techwebRoute,
|
||||
setTechwebRoute,
|
||||
] = useLocalState( 'techwebRoute', null);
|
||||
] = useLocalState('techwebRoute', null);
|
||||
const [
|
||||
lastPoints,
|
||||
setLastPoints,
|
||||
] = useLocalState( 'lastPoints', {});
|
||||
] = useLocalState('lastPoints', {});
|
||||
|
||||
return (
|
||||
<Flex direction="column" className="Techweb__Viewport" height="100%">
|
||||
@@ -216,7 +216,7 @@ export const TechwebContent = (props) => {
|
||||
const TechwebRouter = (props) => {
|
||||
const [
|
||||
techwebRoute,
|
||||
] = useLocalState( 'techwebRoute', null);
|
||||
] = useLocalState('techwebRoute', null);
|
||||
|
||||
const route = techwebRoute?.route;
|
||||
const RoutedComponent = (
|
||||
@@ -236,11 +236,11 @@ const TechwebOverview = (props) => {
|
||||
const [
|
||||
tabIndex,
|
||||
setTabIndex,
|
||||
] = useLocalState( 'overviewTabIndex', 1);
|
||||
] = useLocalState('overviewTabIndex', 1);
|
||||
const [
|
||||
searchText,
|
||||
setSearchText,
|
||||
] = useLocalState( 'searchText');
|
||||
] = useLocalState('searchText');
|
||||
|
||||
// Only search when 3 or more characters have been input
|
||||
const searching = searchText && searchText.trim().length > 1;
|
||||
@@ -335,7 +335,7 @@ const TechwebDiskMenu = (props) => {
|
||||
const [
|
||||
techwebRoute,
|
||||
setTechwebRoute,
|
||||
] = useLocalState( 'techwebRoute', null);
|
||||
] = useLocalState('techwebRoute', null);
|
||||
|
||||
// Check for the disk actually being inserted
|
||||
if ((diskType === "design" && !d_disk) || (diskType === "tech" && !t_disk)) {
|
||||
@@ -410,11 +410,11 @@ const TechwebDesignDisk = (props) => {
|
||||
const [
|
||||
selectedDesign,
|
||||
setSelectedDesign,
|
||||
] = useLocalState( "designDiskSelect", null);
|
||||
] = useLocalState("designDiskSelect", null);
|
||||
const [
|
||||
showModal,
|
||||
setShowModal,
|
||||
] = useLocalState( 'showDesignModal', -1);
|
||||
] = useLocalState('showDesignModal', -1);
|
||||
|
||||
const designIdByIdx = Object.keys(researched_designs);
|
||||
const designOptions = flow([
|
||||
@@ -523,11 +523,11 @@ const TechNodeDetail = (props) => {
|
||||
const [
|
||||
tabIndex,
|
||||
setTabIndex,
|
||||
] = useLocalState( 'nodeDetailTabIndex', 0);
|
||||
] = useLocalState('nodeDetailTabIndex', 0);
|
||||
const [
|
||||
techwebRoute,
|
||||
setTechwebRoute,
|
||||
] = useLocalState( 'techwebRoute', null);
|
||||
] = useLocalState('techwebRoute', null);
|
||||
|
||||
const prereqNodes = nodes.filter(x => prereq_ids.includes(x.id));
|
||||
const complPrereq = prereq_ids
|
||||
@@ -610,11 +610,11 @@ const TechNode = (props) => {
|
||||
const [
|
||||
techwebRoute,
|
||||
setTechwebRoute,
|
||||
] = useLocalState( 'techwebRoute', null);
|
||||
] = useLocalState('techwebRoute', null);
|
||||
const [
|
||||
tabIndex,
|
||||
setTabIndex,
|
||||
] = useLocalState( 'nodeDetailTabIndex', 0);
|
||||
] = useLocalState('nodeDetailTabIndex', 0);
|
||||
|
||||
const expcompl = required_experiments
|
||||
.filter(x => experiments[x]?.completed)
|
||||
|
||||
@@ -20,7 +20,7 @@ export const TelecommsLogBrowser = (props) => {
|
||||
const [
|
||||
tab,
|
||||
setTab,
|
||||
] = useSharedState(context, 'tab', 'servers');
|
||||
] = useSharedState('tab', 'servers');
|
||||
const operational = (selected && selected.status);
|
||||
return (
|
||||
<Window
|
||||
|
||||
@@ -22,7 +22,7 @@ export const TelecommsMonitor = (props) => {
|
||||
const [
|
||||
tab,
|
||||
setTab,
|
||||
] = useSharedState(context, 'tab', 'network-entity');
|
||||
] = useSharedState('tab', 'network-entity');
|
||||
const operational = (selected && selected.status);
|
||||
|
||||
return (
|
||||
|
||||
@@ -24,7 +24,7 @@ export const TelecommsPDALog = (props) => {
|
||||
const [
|
||||
tab,
|
||||
setTab,
|
||||
] = useSharedState(context, 'tab', 'pdalog-servers');
|
||||
] = useSharedState('tab', 'pdalog-servers');
|
||||
const valid = (selected && selected.status && authenticated);
|
||||
if (hack_status) {
|
||||
return ( // should have used en -> jp unicode -> other encoding method->utf8
|
||||
|
||||
@@ -61,7 +61,7 @@ export const TramControl = (props) => {
|
||||
const [
|
||||
transitIndex,
|
||||
setTransitIndex,
|
||||
] = useLocalState( 'transit-index', 1);
|
||||
] = useLocalState('transit-index', 1);
|
||||
const MovingTramDimmer = () => {
|
||||
return (
|
||||
<Dimmer>
|
||||
|
||||
@@ -37,11 +37,11 @@ export const GenericUplink = (props) => {
|
||||
const [
|
||||
searchText,
|
||||
setSearchText,
|
||||
] = useLocalState( 'searchText', '');
|
||||
] = useLocalState('searchText', '');
|
||||
const [
|
||||
selectedCategory,
|
||||
setSelectedCategory,
|
||||
] = useLocalState( 'category', categories[0]?.name);
|
||||
] = useLocalState('category', categories[0]?.name);
|
||||
const testSearch = createSearch(searchText, item => {
|
||||
return item.name + item.desc;
|
||||
});
|
||||
@@ -130,7 +130,7 @@ const ItemList = (props) => {
|
||||
const [
|
||||
hoveredItem,
|
||||
setHoveredItem,
|
||||
] = useLocalState( 'hoveredItem', {});
|
||||
] = useLocalState('hoveredItem', {});
|
||||
const hoveredCost = hoveredItem && hoveredItem.cost || 0;
|
||||
// Append extra hover data to items
|
||||
const items = props.items.map(item => {
|
||||
|
||||
@@ -67,7 +67,7 @@ type CustomInput = {
|
||||
}
|
||||
|
||||
const VendingRow = (props) => {
|
||||
const { act, data } = useBackend<VendingData>(context);
|
||||
const { act, data } = useBackend<VendingData>();
|
||||
const {
|
||||
product,
|
||||
productStock,
|
||||
@@ -169,7 +169,7 @@ const VendingRow = (props) => {
|
||||
};
|
||||
|
||||
export const Vending = (props) => {
|
||||
const { act, data } = useBackend<VendingData>(context);
|
||||
const { act, data } = useBackend<VendingData>();
|
||||
const {
|
||||
user,
|
||||
onstation,
|
||||
@@ -181,7 +181,7 @@ export const Vending = (props) => {
|
||||
const [
|
||||
searchText,
|
||||
setSearchText,
|
||||
] = useLocalState( 'searchText', '');
|
||||
] = useLocalState('searchText', '');
|
||||
let inventory;
|
||||
let custom = false;
|
||||
if (data.vending_machine_input) {
|
||||
|
||||
@@ -155,7 +155,7 @@ const VoreSelectedBelly = (props) => {
|
||||
contents,
|
||||
} = belly;
|
||||
|
||||
const [tabIndex, setTabIndex] = useLocalState( 'tabIndex', 0);
|
||||
const [tabIndex, setTabIndex] = useLocalState('tabIndex', 0);
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
|
||||
@@ -30,7 +30,7 @@ export const AccessList = (props) => {
|
||||
const [
|
||||
selectedAccessName,
|
||||
setSelectedAccessName,
|
||||
] = useLocalState( 'accessName', accesses[0]?.name);
|
||||
] = useLocalState('accessName', accesses[0]?.name);
|
||||
const selectedAccess = accesses
|
||||
.find(access => access.name === selectedAccessName);
|
||||
const selectedAccessEntries = sortBy(
|
||||
|
||||
Reference in New Issue
Block a user