diff --git a/tgui/packages/common/redux.js b/tgui/packages/common/redux.js
index 0c2dd6b670cb..782b5f319aaa 100644
--- a/tgui/packages/common/redux.js
+++ b/tgui/packages/common/redux.js
@@ -139,14 +139,3 @@ export const createAction = (type, prepare = null) => {
actionCreator.match = (action) => action.type === type;
return actionCreator;
};
-
-// Implementation specific
-// --------------------------------------------------------
-
-export const useDispatch = (context) => {
- return context.store.dispatch;
-};
-
-export const useSelector = (context, selector) => {
- return selector(context.store.getState());
-};
diff --git a/tgui/packages/tgui-panel/Panel.js b/tgui/packages/tgui-panel/Panel.js
index 18976735de9e..4d2b873cf604 100644
--- a/tgui/packages/tgui-panel/Panel.js
+++ b/tgui/packages/tgui-panel/Panel.js
@@ -14,17 +14,17 @@ import { PingIndicator } from './ping';
import { ReconnectButton } from './reconnect';
import { SettingsPanel, useSettings } from './settings';
-export const Panel = (props, context) => {
+export const Panel = (props) => {
// IE8-10: Needs special treatment due to missing Flex support
if (Byond.IS_LTE_IE10) {
return ;
}
- const audio = useAudio(context);
- const settings = useSettings(context);
- const game = useGame(context);
+ const audio = useAudio();
+ const settings = useSettings();
+ const game = useGame();
if (process.env.NODE_ENV !== 'production') {
const { useDebug, KitchenSink } = require('tgui/debug');
- const debug = useDebug(context);
+ const debug = useDebug();
if (debug.kitchenSink) {
return ;
}
@@ -103,8 +103,8 @@ export const Panel = (props, context) => {
);
};
-const HoboPanel = (props, context) => {
- const settings = useSettings(context);
+const HoboPanel = (props) => {
+ const settings = useSettings();
return (
diff --git a/tgui/packages/tgui-panel/audio/NowPlayingWidget.js b/tgui/packages/tgui-panel/audio/NowPlayingWidget.js
index cbf7ad9482f8..abe9191fad4f 100644
--- a/tgui/packages/tgui-panel/audio/NowPlayingWidget.js
+++ b/tgui/packages/tgui-panel/audio/NowPlayingWidget.js
@@ -5,15 +5,15 @@
*/
import { toFixed } from 'common/math';
-import { useDispatch, useSelector } from 'common/redux';
+import { useDispatch, useSelector } from 'tgui/backend';
import { Button, Flex, Knob } from 'tgui/components';
import { useSettings } from '../settings';
import { selectAudio } from './selectors';
-export const NowPlayingWidget = (props, context) => {
- const audio = useSelector(context, selectAudio);
- const dispatch = useDispatch(context);
- const settings = useSettings(context);
+export const NowPlayingWidget = (props) => {
+ const audio = useSelector(selectAudio);
+ const dispatch = useDispatch();
+ const settings = useSettings();
const title = audio.meta?.title;
return (
diff --git a/tgui/packages/tgui-panel/audio/hooks.js b/tgui/packages/tgui-panel/audio/hooks.js
index 504b4f5c6e79..b828c1fa950a 100644
--- a/tgui/packages/tgui-panel/audio/hooks.js
+++ b/tgui/packages/tgui-panel/audio/hooks.js
@@ -4,12 +4,12 @@
* @license MIT
*/
-import { useSelector, useDispatch } from 'common/redux';
+import { useDispatch, useSelector } from 'tgui/backend';
import { selectAudio } from './selectors';
-export const useAudio = (context) => {
- const state = useSelector(context, selectAudio);
- const dispatch = useDispatch(context);
+export const useAudio = () => {
+ const state = useSelector(selectAudio);
+ const dispatch = useDispatch();
return {
...state,
toggle: () => dispatch({ type: 'audio/toggle' }),
diff --git a/tgui/packages/tgui-panel/chat/ChatPageSettings.js b/tgui/packages/tgui-panel/chat/ChatPageSettings.js
index dff19b2041c9..d380979dbd31 100644
--- a/tgui/packages/tgui-panel/chat/ChatPageSettings.js
+++ b/tgui/packages/tgui-panel/chat/ChatPageSettings.js
@@ -4,7 +4,7 @@
* @license MIT
*/
-import { useDispatch, useSelector } from 'common/redux';
+import { useDispatch, useSelector } from 'tgui/backend';
import {
Button,
Collapsible,
@@ -17,9 +17,9 @@ import { removeChatPage, toggleAcceptedType, updateChatPage } from './actions';
import { MESSAGE_TYPES } from './constants';
import { selectCurrentChatPage } from './selectors';
-export const ChatPageSettings = (props, context) => {
- const page = useSelector(context, selectCurrentChatPage);
- const dispatch = useDispatch(context);
+export const ChatPageSettings = (props) => {
+ const page = useSelector(selectCurrentChatPage);
+ const dispatch = useDispatch();
return (
diff --git a/tgui/packages/tgui-panel/chat/ChatTabs.js b/tgui/packages/tgui-panel/chat/ChatTabs.js
index 601cd111589e..9ef736bd554a 100644
--- a/tgui/packages/tgui-panel/chat/ChatTabs.js
+++ b/tgui/packages/tgui-panel/chat/ChatTabs.js
@@ -4,7 +4,7 @@
* @license MIT
*/
-import { useDispatch, useSelector } from 'common/redux';
+import { useDispatch, useSelector } from 'tgui/backend';
import { Box, Tabs, Flex, Button } from 'tgui/components';
import { changeChatPage, addChatPage } from './actions';
import { selectChatPages, selectCurrentChatPage } from './selectors';
@@ -25,10 +25,10 @@ const UnreadCountWidget = ({ value }) => (
);
-export const ChatTabs = (props, context) => {
- const pages = useSelector(context, selectChatPages);
- const currentPage = useSelector(context, selectCurrentChatPage);
- const dispatch = useDispatch(context);
+export const ChatTabs = (props) => {
+ const pages = useSelector(selectChatPages);
+ const currentPage = useSelector(selectCurrentChatPage);
+ const dispatch = useDispatch();
return (
diff --git a/tgui/packages/tgui-panel/game/hooks.js b/tgui/packages/tgui-panel/game/hooks.js
index 859aaa09a407..c3e7c062847e 100644
--- a/tgui/packages/tgui-panel/game/hooks.js
+++ b/tgui/packages/tgui-panel/game/hooks.js
@@ -4,9 +4,9 @@
* @license MIT
*/
-import { useSelector } from 'common/redux';
+import { useSelector } from 'tgui/backend';
import { selectGame } from './selectors';
-export const useGame = (context) => {
- return useSelector(context, selectGame);
+export const useGame = () => {
+ return useSelector(selectGame);
};
diff --git a/tgui/packages/tgui-panel/index.js b/tgui/packages/tgui-panel/index.js
index fed102d5fa34..40bb85984414 100644
--- a/tgui/packages/tgui-panel/index.js
+++ b/tgui/packages/tgui-panel/index.js
@@ -22,6 +22,7 @@ import { setupPanelFocusHacks } from './panelFocus';
import { pingMiddleware, pingReducer } from './ping';
import { settingsMiddleware, settingsReducer } from './settings';
import { telemetryMiddleware } from './telemetry';
+import { setGlobalStore } from 'tgui/backend';
perf.mark('inception', window.performance?.timing?.navigationStart);
perf.mark('init');
@@ -47,6 +48,8 @@ const store = configureStore({
});
const renderApp = createRenderer(() => {
+ setGlobalStore(store);
+
const { Panel } = require('./Panel');
return (
diff --git a/tgui/packages/tgui-panel/ping/PingIndicator.js b/tgui/packages/tgui-panel/ping/PingIndicator.js
index aadbd1c134b5..b2355820e58a 100644
--- a/tgui/packages/tgui-panel/ping/PingIndicator.js
+++ b/tgui/packages/tgui-panel/ping/PingIndicator.js
@@ -6,12 +6,12 @@
import { Color } from 'common/color';
import { toFixed } from 'common/math';
-import { useSelector } from 'common/redux';
+import { useSelector } from 'tgui/backend';
import { Box } from 'tgui/components';
import { selectPing } from './selectors';
-export const PingIndicator = (props, context) => {
- const ping = useSelector(context, selectPing);
+export const PingIndicator = (props) => {
+ const ping = useSelector(selectPing);
const color = Color.lookup(ping.networkQuality, [
new Color(220, 40, 40),
new Color(220, 200, 40),
diff --git a/tgui/packages/tgui-panel/reconnect.tsx b/tgui/packages/tgui-panel/reconnect.tsx
index b3ee9777731e..c170726a3463 100644
--- a/tgui/packages/tgui-panel/reconnect.tsx
+++ b/tgui/packages/tgui-panel/reconnect.tsx
@@ -11,7 +11,7 @@ setInterval(() => {
});
}, 5000);
-export const ReconnectButton = (props, context) => {
+export const ReconnectButton = (props) => {
return (
url && (
<>
diff --git a/tgui/packages/tgui-panel/settings/SettingsPanel.js b/tgui/packages/tgui-panel/settings/SettingsPanel.js
index b746a6c4f613..f98aacadb130 100644
--- a/tgui/packages/tgui-panel/settings/SettingsPanel.js
+++ b/tgui/packages/tgui-panel/settings/SettingsPanel.js
@@ -6,7 +6,7 @@
import { toFixed } from 'common/math';
import { useLocalState } from 'tgui/backend';
-import { useDispatch, useSelector } from 'common/redux';
+import { useDispatch, useSelector } from 'tgui/backend';
import {
Box,
Button,
@@ -28,9 +28,9 @@ import { changeSettingsTab, updateSettings } from './actions';
import { FONTS, SETTINGS_TABS, THEMES } from './constants';
import { selectActiveTab, selectSettings } from './selectors';
-export const SettingsPanel = (props, context) => {
- const activeTab = useSelector(context, selectActiveTab);
- const dispatch = useDispatch(context);
+export const SettingsPanel = (props) => {
+ const activeTab = useSelector(selectActiveTab);
+ const dispatch = useDispatch();
return (
@@ -62,7 +62,7 @@ export const SettingsPanel = (props, context) => {
);
};
-export const SettingsGeneral = (props, context) => {
+export const SettingsGeneral = (props) => {
const {
theme,
fontFamily,
@@ -72,8 +72,8 @@ export const SettingsGeneral = (props, context) => {
highlightColor,
matchWord,
matchCase,
- } = useSelector(context, selectSettings);
- const dispatch = useDispatch(context);
+ } = useSelector(selectSettings);
+ const dispatch = useDispatch();
const [freeFont, setFreeFont] = useLocalState(context, 'freeFont', false);
return (
diff --git a/tgui/packages/tgui-panel/settings/hooks.js b/tgui/packages/tgui-panel/settings/hooks.js
index da46322f9a94..5ea91c860674 100644
--- a/tgui/packages/tgui-panel/settings/hooks.js
+++ b/tgui/packages/tgui-panel/settings/hooks.js
@@ -4,13 +4,13 @@
* @license MIT
*/
-import { useDispatch, useSelector } from 'common/redux';
+import { useDispatch, useSelector } from 'tgui/backend';
import { updateSettings, toggleSettings } from './actions';
import { selectSettings } from './selectors';
-export const useSettings = (context) => {
- const settings = useSelector(context, selectSettings);
- const dispatch = useDispatch(context);
+export const useSettings = () => {
+ const settings = useSelector(selectSettings);
+ const dispatch = useDispatch();
return {
...settings,
visible: settings.view.visible,
diff --git a/tgui/packages/tgui/backend.ts b/tgui/packages/tgui/backend.ts
index b78afeae4428..290f48ac74f1 100644
--- a/tgui/packages/tgui/backend.ts
+++ b/tgui/packages/tgui/backend.ts
@@ -20,6 +20,12 @@ import { resumeRenderer, suspendRenderer } from './renderer';
const logger = createLogger('backend');
+export let globalStore;
+
+export const setGlobalStore = (store) => {
+ globalStore = store;
+};
+
export const backendUpdate = createAction('backend/update');
export const backendSetSharedState = createAction('backend/setSharedState');
export const backendSuspendStart = createAction('backend/suspendStart');
@@ -264,9 +270,9 @@ export const selectBackend = (state: any): BackendState =>
*
* You can make
*/
-export const useBackend = (context: any) => {
- const { store } = context;
- const state = selectBackend(store.getState());
+export const useBackend = () => {
+ const state: BackendState = globalStore?.getState()?.backend;
+
return {
...state,
act: sendAct,
@@ -292,18 +298,16 @@ type StateWithSetter = [T, (nextState: T) => void];
* @param initialState Initializes your global variable with this value.
*/
export const useLocalState = (
- context: any,
key: string,
initialState: T,
): StateWithSetter => {
- const { store } = context;
- const state = selectBackend(store.getState());
- const sharedStates = state.shared ?? {};
+ const state = globalStore?.getState()?.backend;
+ const sharedStates = state?.shared ?? {};
const sharedState = key in sharedStates ? sharedStates[key] : initialState;
return [
sharedState,
(nextState) => {
- store.dispatch(
+ globalStore.dispatch(
backendSetSharedState({
key,
nextState:
@@ -331,13 +335,11 @@ export const useLocalState = (
* @param initialState Initializes your global variable with this value.
*/
export const useSharedState = (
- context: any,
key: string,
initialState: T,
): StateWithSetter => {
- const { store } = context;
- const state = selectBackend(store.getState());
- const sharedStates = state.shared ?? {};
+ const state = globalStore?.getState()?.backend;
+ const sharedStates = state?.shared ?? {};
const sharedState = key in sharedStates ? sharedStates[key] : initialState;
return [
sharedState,
@@ -355,3 +357,14 @@ export const useSharedState = (
},
];
};
+
+// Implementation specific
+// --------------------------------------------------------
+
+export const useDispatch = () => {
+ return globalStore?.dispatch;
+};
+
+export const useSelector = (selector) => {
+ return selector(globalStore?.getState());
+};
diff --git a/tgui/packages/tgui/components/Popper.tsx b/tgui/packages/tgui/components/Popper.tsx
index 18331157ed04..95a0c9490a43 100644
--- a/tgui/packages/tgui/components/Popper.tsx
+++ b/tgui/packages/tgui/components/Popper.tsx
@@ -70,12 +70,7 @@ export class Popper extends Component {
renderPopperContent(callback: () => void) {
// `render` errors when given false, so we convert it to `null`,
// which is supported.
- render(
- this.props.popperContent || null,
- this.renderedContent,
- callback,
- this.context,
- );
+ render(this.props.popperContent || null, this.renderedContent, callback);
}
render() {
diff --git a/tgui/packages/tgui/components/TextArea.js b/tgui/packages/tgui/components/TextArea.js
index fb3c2c1b5fc9..b516e0517f16 100644
--- a/tgui/packages/tgui/components/TextArea.js
+++ b/tgui/packages/tgui/components/TextArea.js
@@ -12,8 +12,8 @@ import { toInputValue } from './Input';
import { KEY_ESCAPE } from 'common/keycodes';
export class TextArea extends Component {
- constructor(props, context) {
- super(props, context);
+ constructor(props) {
+ super(props);
this.textareaRef = createRef();
this.fillerRef = createRef();
this.state = {
diff --git a/tgui/packages/tgui/components/Tooltip.tsx b/tgui/packages/tgui/components/Tooltip.tsx
index 314253e08d31..2d8d10a26633 100644
--- a/tgui/packages/tgui/components/Tooltip.tsx
+++ b/tgui/packages/tgui/components/Tooltip.tsx
@@ -97,33 +97,28 @@ export class Tooltip extends Component {
return;
}
- render(
- {this.props.content},
- renderedTooltip,
- () => {
- let singletonPopper = Tooltip.singletonPopper;
- if (singletonPopper === undefined) {
- singletonPopper = createPopper(
- Tooltip.virtualElement,
- renderedTooltip!,
- {
- ...DEFAULT_OPTIONS,
- placement: this.props.position || 'auto',
- },
- );
-
- Tooltip.singletonPopper = singletonPopper;
- } else {
- singletonPopper.setOptions({
+ render({this.props.content}, renderedTooltip, () => {
+ let singletonPopper = Tooltip.singletonPopper;
+ if (singletonPopper === undefined) {
+ singletonPopper = createPopper(
+ Tooltip.virtualElement,
+ renderedTooltip!,
+ {
...DEFAULT_OPTIONS,
placement: this.props.position || 'auto',
- });
+ },
+ );
- singletonPopper.update();
- }
- },
- this.context,
- );
+ Tooltip.singletonPopper = singletonPopper;
+ } else {
+ singletonPopper.setOptions({
+ ...DEFAULT_OPTIONS,
+ placement: this.props.position || 'auto',
+ });
+
+ singletonPopper.update();
+ }
+ });
}
componentDidUpdate() {
diff --git a/tgui/packages/tgui/debug/KitchenSink.js b/tgui/packages/tgui/debug/KitchenSink.js
index bede561946dd..d215ab777d80 100644
--- a/tgui/packages/tgui/debug/KitchenSink.js
+++ b/tgui/packages/tgui/debug/KitchenSink.js
@@ -20,10 +20,10 @@ const r = require.context('../stories', false, /\.stories\.js$/);
*/
const getStories = () => r.keys().map((path) => r(path));
-export const KitchenSink = (props, context) => {
+export const KitchenSink = (props) => {
const { panel } = props;
- const [theme] = useLocalState(context, 'kitchenSinkTheme');
- const [pageIndex, setPageIndex] = useLocalState(context, 'pageIndex', 0);
+ const [theme] = useLocalState('kitchenSinkTheme');
+ const [pageIndex, setPageIndex] = useLocalState('pageIndex', 0);
const stories = getStories();
const story = stories[pageIndex];
const Layout = panel ? Pane : Window;
diff --git a/tgui/packages/tgui/debug/hooks.js b/tgui/packages/tgui/debug/hooks.js
index d324dd68d88f..2ef8664fd480 100644
--- a/tgui/packages/tgui/debug/hooks.js
+++ b/tgui/packages/tgui/debug/hooks.js
@@ -4,7 +4,7 @@
* @license MIT
*/
-import { useSelector } from 'common/redux';
+import { useSelector } from 'tgui/backend';
import { selectDebug } from './selectors';
-export const useDebug = (context) => useSelector(context, selectDebug);
+export const useDebug = () => useSelector(selectDebug);
diff --git a/tgui/packages/tgui/index.js b/tgui/packages/tgui/index.js
index e0e14417ce32..6686f2424acf 100644
--- a/tgui/packages/tgui/index.js
+++ b/tgui/packages/tgui/index.js
@@ -30,6 +30,7 @@ import { captureExternalLinks } from './links';
import { createRenderer } from './renderer';
import { configureStore, StoreProvider } from './store';
import { setupGlobalEvents } from './events';
+import { setGlobalStore } from './backend';
perf.mark('inception', window.performance?.timing?.navigationStart);
perf.mark('init');
@@ -37,6 +38,8 @@ perf.mark('init');
const store = configureStore();
const renderApp = createRenderer(() => {
+ setGlobalStore(store);
+
const { getRoutedComponent } = require('./routes');
const Component = getRoutedComponent(store);
return (
diff --git a/tgui/packages/tgui/interfaces/AbductorConsole.js b/tgui/packages/tgui/interfaces/AbductorConsole.js
index 3344dfccfe45..4ba7b4488eb0 100644
--- a/tgui/packages/tgui/interfaces/AbductorConsole.js
+++ b/tgui/packages/tgui/interfaces/AbductorConsole.js
@@ -3,8 +3,8 @@ import { Button, LabeledList, NoticeBox, Section, Tabs } from '../components';
import { Window } from '../layouts';
import { GenericUplink } from './Uplink/GenericUplink';
-export const AbductorConsole = (props, context) => {
- const [tab, setTab] = useSharedState(context, 'tab', 1);
+export const AbductorConsole = (props) => {
+ const [tab, setTab] = useSharedState('tab', 1);
return (
@@ -38,8 +38,8 @@ export const AbductorConsole = (props, context) => {
);
};
-const Abductsoft = (props, context) => {
- const { act, data } = useBackend(context);
+const Abductsoft = (props) => {
+ const { act, data } = useBackend();
const { experiment, points, credits, categories } = data;
if (!experiment) {
@@ -83,8 +83,8 @@ const Abductsoft = (props, context) => {
);
};
-const EmergencyTeleporter = (props, context) => {
- const { act, data } = useBackend(context);
+const EmergencyTeleporter = (props) => {
+ const { act, data } = useBackend();
const { pad, gizmo } = data;
if (!pad) {
@@ -117,8 +117,8 @@ const EmergencyTeleporter = (props, context) => {
);
};
-const VestSettings = (props, context) => {
- const { act, data } = useBackend(context);
+const VestSettings = (props) => {
+ const { act, data } = useBackend();
const { vest, vest_mode, vest_lock } = data;
if (!vest) {
diff --git a/tgui/packages/tgui/interfaces/AccountingConsole.js b/tgui/packages/tgui/interfaces/AccountingConsole.js
index 34e43af8d21f..88886d5497c3 100644
--- a/tgui/packages/tgui/interfaces/AccountingConsole.js
+++ b/tgui/packages/tgui/interfaces/AccountingConsole.js
@@ -10,16 +10,12 @@ import { useBackend } from '../backend';
import { useLocalState } from '../backend';
import { Window } from '../layouts';
-export const AccountingConsole = (props, context) => {
- const { act, data } = useBackend(context);
+export const AccountingConsole = (props) => {
+ const { act, data } = useBackend();
const { PlayerAccounts, AuditLog } = data;
const USER_SCREEN = 1;
const AUDIT_SCREEN = 2;
- const [screenmode, setScreenmode] = useLocalState(
- context,
- 'tab_main',
- USER_SCREEN,
- );
+ const [screenmode, setScreenmode] = useLocalState('tab_main', USER_SCREEN);
return (
@@ -73,9 +69,9 @@ export const AccountingConsole = (props, context) => {
};
/** The modal menu that contains the prompts to making new channels. */
-const MarketCrashing = (props, context) => {
- const { act, data } = useBackend(context);
- const [lockedmode, setLockedmode] = useLocalState(context, 'lockedmode', 1);
+const MarketCrashing = (props) => {
+ const { act, data } = useBackend();
+ const [lockedmode, setLockedmode] = useLocalState('lockedmode', 1);
const { Crashing } = data;
if (!Crashing) {
return null;
diff --git a/tgui/packages/tgui/interfaces/Achievements.js b/tgui/packages/tgui/interfaces/Achievements.js
index 934062ad4287..7a5d4235c660 100644
--- a/tgui/packages/tgui/interfaces/Achievements.js
+++ b/tgui/packages/tgui/interfaces/Achievements.js
@@ -2,11 +2,10 @@ import { useBackend, useLocalState } from '../backend';
import { Box, Flex, Icon, Table, Tabs } from '../components';
import { Window } from '../layouts';
-export const Achievements = (props, context) => {
- const { data } = useBackend(context);
+export const Achievements = (props) => {
+ const { data } = useBackend();
const { categories } = data;
const [selectedCategory, setSelectedCategory] = useLocalState(
- context,
'category',
categories[0],
);
@@ -41,7 +40,7 @@ export const Achievements = (props, context) => {
);
};
-const AchievementTable = (props, context) => {
+const AchievementTable = (props) => {
const { achievements } = props;
return (
@@ -77,14 +76,10 @@ const Achievement = (props) => {
);
};
-const HighScoreTable = (props, context) => {
- const { data } = useBackend(context);
+const HighScoreTable = (props) => {
+ const { data } = useBackend();
const { highscore: highscores, user_ckey } = data;
- const [highScoreIndex, setHighScoreIndex] = useLocalState(
- context,
- 'highscore',
- 0,
- );
+ const [highScoreIndex, setHighScoreIndex] = useLocalState('highscore', 0);
const highscore = highscores[highScoreIndex];
if (!highscore) {
return null;
diff --git a/tgui/packages/tgui/interfaces/Adminhelp.tsx b/tgui/packages/tgui/interfaces/Adminhelp.tsx
index c0371ca24f6c..597c8c535a0e 100644
--- a/tgui/packages/tgui/interfaces/Adminhelp.tsx
+++ b/tgui/packages/tgui/interfaces/Adminhelp.tsx
@@ -10,8 +10,8 @@ type AdminhelpData = {
urgentAhelpPromptMessage: string;
};
-export const Adminhelp = (props, context) => {
- const { act, data } = useBackend(context);
+export const Adminhelp = (props) => {
+ const { act, data } = useBackend();
const {
adminCount,
urgentAhelpEnabled,
@@ -19,20 +19,14 @@ export const Adminhelp = (props, context) => {
urgentAhelpPromptMessage,
} = data;
const [requestForAdmin, setRequestForAdmin] = useLocalState(
- context,
'request_for_admin',
false,
);
const [currentlyInputting, setCurrentlyInputting] = useLocalState(
- context,
'confirm_request',
false,
);
- const [ahelpMessage, setAhelpMessage] = useLocalState(
- context,
- 'ahelp_message',
- '',
- );
+ const [ahelpMessage, setAhelpMessage] = useLocalState('ahelp_message', '');
const confirmationText = 'alert admins';
return (
diff --git a/tgui/packages/tgui/interfaces/AdventureBrowser.tsx b/tgui/packages/tgui/interfaces/AdventureBrowser.tsx
index fe99d72add16..49fe86ee090e 100644
--- a/tgui/packages/tgui/interfaces/AdventureBrowser.tsx
+++ b/tgui/packages/tgui/interfaces/AdventureBrowser.tsx
@@ -31,8 +31,8 @@ type AdventureBrowserData = AdventureDataProvider & {
delay_message: string;
};
-const AdventureEntry = (props, context) => {
- const { data, act } = useBackend(context);
+const AdventureEntry = (props) => {
+ const { data, act } = useBackend();
const { entry_ref, close }: { entry_ref: string; close: () => void } = props;
const entry = data.adventures.find((x) => x.ref === entry_ref);
@@ -91,10 +91,9 @@ const AdventureEntry = (props, context) => {
);
};
-const AdventureList = (props, context) => {
- const { data, act } = useBackend(context);
+const AdventureList = (props) => {
+ const { data, act } = useBackend();
const [openAdventure, setOpenAdventure] = useLocalState(
- context,
'openAdventure',
null,
);
@@ -135,8 +134,8 @@ const AdventureList = (props, context) => {
);
};
-const DebugPlayer = (props, context) => {
- const { data, act } = useBackend(context);
+const DebugPlayer = (props) => {
+ const { data, act } = useBackend();
return (
{
);
};
-export const AdventureBrowser = (props, context) => {
- const { data } = useBackend(context);
+export const AdventureBrowser = (props) => {
+ const { data } = useBackend();
return (
diff --git a/tgui/packages/tgui/interfaces/AiAirlock.js b/tgui/packages/tgui/interfaces/AiAirlock.js
index 2992985fb5fe..b74735d8e6a1 100644
--- a/tgui/packages/tgui/interfaces/AiAirlock.js
+++ b/tgui/packages/tgui/interfaces/AiAirlock.js
@@ -17,8 +17,8 @@ const dangerMap = {
},
};
-export const AiAirlock = (props, context) => {
- const { act, data } = useBackend(context);
+export const AiAirlock = (props) => {
+ const { act, data } = useBackend();
const statusMain = dangerMap[data.power.main] || dangerMap[0];
const statusBackup = dangerMap[data.power.backup] || dangerMap[0];
const statusElectrify = dangerMap[data.shock] || dangerMap[0];
diff --git a/tgui/packages/tgui/interfaces/AiRestorer.js b/tgui/packages/tgui/interfaces/AiRestorer.js
index ba292a182125..2b5c5979c72b 100644
--- a/tgui/packages/tgui/interfaces/AiRestorer.js
+++ b/tgui/packages/tgui/interfaces/AiRestorer.js
@@ -19,8 +19,8 @@ export const AiRestorer = () => {
);
};
-export const AiRestorerContent = (props, context) => {
- const { act, data } = useBackend(context);
+export const AiRestorerContent = (props) => {
+ const { act, data } = useBackend();
const {
AI_present,
error,
diff --git a/tgui/packages/tgui/interfaces/AiVoiceChanger.js b/tgui/packages/tgui/interfaces/AiVoiceChanger.js
index 0c1e5d621c1f..c16973cb4d76 100644
--- a/tgui/packages/tgui/interfaces/AiVoiceChanger.js
+++ b/tgui/packages/tgui/interfaces/AiVoiceChanger.js
@@ -2,8 +2,8 @@ import { useBackend } from '../backend';
import { Button, Section, Input, Dropdown, LabeledList } from '../components';
import { Window } from '../layouts';
-export const AiVoiceChanger = (props, context) => {
- const { act, data } = useBackend(context);
+export const AiVoiceChanger = (props) => {
+ const { act, data } = useBackend();
return (
diff --git a/tgui/packages/tgui/interfaces/AirAlarm.js b/tgui/packages/tgui/interfaces/AirAlarm.js
index 92ce766f4c04..86d26f78213b 100644
--- a/tgui/packages/tgui/interfaces/AirAlarm.js
+++ b/tgui/packages/tgui/interfaces/AirAlarm.js
@@ -15,8 +15,8 @@ import { Window } from '../layouts';
import { Scrubber, Vent } from './common/AtmosControls';
import { InterfaceLockNoticeBox } from './common/InterfaceLockNoticeBox';
-export const AirAlarm = (props, context) => {
- const { act, data } = useBackend(context);
+export const AirAlarm = (props) => {
+ const { act, data } = useBackend();
const locked = data.locked && !data.siliconUser;
return (
@@ -30,8 +30,8 @@ export const AirAlarm = (props, context) => {
);
};
-const AirAlarmStatus = (props, context) => {
- const { data } = useBackend(context);
+const AirAlarmStatus = (props) => {
+ const { data } = useBackend();
const entries = (data.environment_data || []).filter(
(entry) => entry.value >= 0.01,
);
@@ -95,8 +95,8 @@ const AirAlarmStatus = (props, context) => {
);
};
-const ThermostatControl = (props, context) => {
- const { act, data } = useBackend(context);
+const ThermostatControl = (props) => {
+ const { act, data } = useBackend();
const entries = (data.environment_data || []).filter(
(entry) => entry.value >= 0.01,
);
@@ -184,8 +184,8 @@ const AIR_ALARM_ROUTES = {
},
};
-const AirAlarmControl = (props, context) => {
- const [screen, setScreen] = useLocalState(context, 'screen');
+const AirAlarmControl = (props) => {
+ const [screen, setScreen] = useLocalState('screen');
const route = AIR_ALARM_ROUTES[screen] || AIR_ALARM_ROUTES.home;
const Component = route.component();
return (
@@ -209,9 +209,9 @@ const AirAlarmControl = (props, context) => {
// Home screen
// --------------------------------------------------------
-const AirAlarmControlHome = (props, context) => {
- const { act, data } = useBackend(context);
- const [screen, setScreen] = useLocalState(context, 'screen');
+const AirAlarmControlHome = (props) => {
+ const { act, data } = useBackend();
+ const [screen, setScreen] = useLocalState('screen');
const { mode, atmos_alarm, fire_alarm } = data;
return (
<>
@@ -274,8 +274,8 @@ const AirAlarmControlHome = (props, context) => {
// Vents
// --------------------------------------------------------
-const AirAlarmControlVents = (props, context) => {
- const { data } = useBackend(context);
+const AirAlarmControlVents = (props) => {
+ const { data } = useBackend();
const { vents } = data;
if (!vents || vents.length === 0) {
return 'Nothing to show';
@@ -286,8 +286,8 @@ const AirAlarmControlVents = (props, context) => {
// Scrubbers
// --------------------------------------------------------
-const AirAlarmControlScrubbers = (props, context) => {
- const { data } = useBackend(context);
+const AirAlarmControlScrubbers = (props) => {
+ const { data } = useBackend();
const { scrubbers } = data;
if (!scrubbers || scrubbers.length === 0) {
return 'Nothing to show';
@@ -300,8 +300,8 @@ const AirAlarmControlScrubbers = (props, context) => {
// Modes
// --------------------------------------------------------
-const AirAlarmControlModes = (props, context) => {
- const { act, data } = useBackend(context);
+const AirAlarmControlModes = (props) => {
+ const { act, data } = useBackend();
const { modes } = data;
if (!modes || modes.length === 0) {
return 'Nothing to show';
@@ -323,8 +323,8 @@ const AirAlarmControlModes = (props, context) => {
// Thresholds
// --------------------------------------------------------
-const AirAlarmControlThresholds = (props, context) => {
- const { act, data } = useBackend(context);
+const AirAlarmControlThresholds = (props) => {
+ const { act, data } = useBackend();
const { thresholds } = data;
return (
diff --git a/tgui/packages/tgui/interfaces/AirlockController.js b/tgui/packages/tgui/interfaces/AirlockController.js
index 602bf280a472..b484443ed370 100644
--- a/tgui/packages/tgui/interfaces/AirlockController.js
+++ b/tgui/packages/tgui/interfaces/AirlockController.js
@@ -2,8 +2,8 @@ import { useBackend } from '../backend';
import { Box, Button, LabeledList, Section } from '../components';
import { Window } from '../layouts';
-export const AirlockController = (props, context) => {
- const { act, data } = useBackend(context);
+export const AirlockController = (props) => {
+ const { act, data } = useBackend();
const {
airlockState,
sensorPressure,
diff --git a/tgui/packages/tgui/interfaces/AirlockElectronics.js b/tgui/packages/tgui/interfaces/AirlockElectronics.js
index 37392dadeba2..eeec95e33114 100644
--- a/tgui/packages/tgui/interfaces/AirlockElectronics.js
+++ b/tgui/packages/tgui/interfaces/AirlockElectronics.js
@@ -3,8 +3,8 @@ import { Button, Input, LabeledList, Section } from '../components';
import { Window } from '../layouts';
import { AccessConfig } from './common/AccessConfig';
-export const AirlockElectronics = (props, context) => {
- const { act, data } = useBackend(context);
+export const AirlockElectronics = (props) => {
+ const { act, data } = useBackend();
const { oneAccess, unres_direction, passedName, passedCycleId } = data;
const regions = data.regions || [];
const accesses = data.accesses || [];
diff --git a/tgui/packages/tgui/interfaces/AlertModal.tsx b/tgui/packages/tgui/interfaces/AlertModal.tsx
index e32ab80697a1..c8238c029aaa 100644
--- a/tgui/packages/tgui/interfaces/AlertModal.tsx
+++ b/tgui/packages/tgui/interfaces/AlertModal.tsx
@@ -24,8 +24,8 @@ type AlertModalData = {
const KEY_DECREMENT = -1;
const KEY_INCREMENT = 1;
-export const AlertModal = (_, context) => {
- const { act, data } = useBackend(context);
+export const AlertModal = (_) => {
+ const { act, data } = useBackend();
const {
autofocus,
buttons = [],
@@ -34,7 +34,7 @@ export const AlertModal = (_, context) => {
timeout,
title,
} = data;
- const [selected, setSelected] = useLocalState(context, 'selected', 0);
+ const [selected, setSelected] = useLocalState('selected', 0);
// Dynamically sets window dimensions
const windowHeight =
115 +
@@ -97,8 +97,8 @@ export const AlertModal = (_, context) => {
* Technically this handles more than 2 buttons, but you
* should just be using a list input in that case.
*/
-const ButtonDisplay = (props, context) => {
- const { data } = useBackend(context);
+const ButtonDisplay = (props) => {
+ const { data } = useBackend();
const { buttons = [], large_buttons, swapped_buttons } = data;
const { selected } = props;
@@ -136,8 +136,8 @@ const ButtonDisplay = (props, context) => {
/**
* Displays a button with variable sizing.
*/
-const AlertButton = (props, context) => {
- const { act, data } = useBackend(context);
+const AlertButton = (props) => {
+ const { act, data } = useBackend();
const { large_buttons } = data;
const { button, selected } = props;
const buttonWidth = button.length > 7 ? button.length : 7;
diff --git a/tgui/packages/tgui/interfaces/AnomalyRefinery.js b/tgui/packages/tgui/interfaces/AnomalyRefinery.js
index 39daa8be88f9..577cbbe18389 100644
--- a/tgui/packages/tgui/interfaces/AnomalyRefinery.js
+++ b/tgui/packages/tgui/interfaces/AnomalyRefinery.js
@@ -11,8 +11,8 @@ import {
import { Window } from '../layouts';
import { GasmixParser } from './common/GasmixParser';
-export const AnomalyRefinery = (props, context) => {
- const { act, data } = useBackend(context);
+export const AnomalyRefinery = (props) => {
+ const { act, data } = useBackend();
return (
@@ -22,9 +22,9 @@ export const AnomalyRefinery = (props, context) => {
);
};
-const AnomalyRefineryContent = (props, context) => {
- const { act, data } = useBackend(context);
- const [currentTab, changeTab] = useSharedState(context, 'exploderTab', 1);
+const AnomalyRefineryContent = (props) => {
+ const { act, data } = useBackend();
+ const [currentTab, changeTab] = useSharedState('exploderTab', 1);
const { core, valvePresent, active } = data;
return (
@@ -70,8 +70,8 @@ const AnomalyRefineryContent = (props, context) => {
);
};
-const CoreCompressorContent = (props, context) => {
- const { act, data } = useBackend(context);
+const CoreCompressorContent = (props) => {
+ const { act, data } = useBackend();
const { core, requiredRadius, gasList, valveReady, active, valvePresent } =
data;
return (
@@ -175,8 +175,8 @@ const CoreCompressorContent = (props, context) => {
>
);
};
-const BombProcessorContent = (props, context) => {
- const { act, data } = useBackend(context);
+const BombProcessorContent = (props) => {
+ const { act, data } = useBackend();
const { gasList, reactionIncrement } = data;
return (
<>
diff --git a/tgui/packages/tgui/interfaces/AntagInfoBrainwashed.tsx b/tgui/packages/tgui/interfaces/AntagInfoBrainwashed.tsx
index fcb02578c217..b7afd878110c 100644
--- a/tgui/packages/tgui/interfaces/AntagInfoBrainwashed.tsx
+++ b/tgui/packages/tgui/interfaces/AntagInfoBrainwashed.tsx
@@ -55,8 +55,8 @@ export const AntagInfoBrainwashed = () => {
);
};
-const ObjectivePrintout = (_, context) => {
- const { data } = useBackend(context);
+const ObjectivePrintout = (_) => {
+ const { data } = useBackend();
const { objectives } = data;
return (
diff --git a/tgui/packages/tgui/interfaces/AntagInfoBrother.tsx b/tgui/packages/tgui/interfaces/AntagInfoBrother.tsx
index 2a2305a67db9..dd3879fe7912 100644
--- a/tgui/packages/tgui/interfaces/AntagInfoBrother.tsx
+++ b/tgui/packages/tgui/interfaces/AntagInfoBrother.tsx
@@ -18,8 +18,8 @@ type Info = {
brothers: string;
};
-export const AntagInfoBrother = (props, context) => {
- const { data } = useBackend(context);
+export const AntagInfoBrother = (props) => {
+ const { data } = useBackend();
const { antag_name, brothers } = data;
return (
@@ -39,8 +39,8 @@ export const AntagInfoBrother = (props, context) => {
);
};
-const ObjectivePrintout = (props, context) => {
- const { data } = useBackend(context);
+const ObjectivePrintout = (props) => {
+ const { data } = useBackend();
const { objectives } = data;
return (
diff --git a/tgui/packages/tgui/interfaces/AntagInfoChangeling.tsx b/tgui/packages/tgui/interfaces/AntagInfoChangeling.tsx
index 9d4eb17063bf..0fc08ae3a122 100644
--- a/tgui/packages/tgui/interfaces/AntagInfoChangeling.tsx
+++ b/tgui/packages/tgui/interfaces/AntagInfoChangeling.tsx
@@ -46,8 +46,8 @@ type Info = {
objectives: Objective[];
};
-const ObjectivePrintout = (props, context) => {
- const { data } = useBackend(context);
+const ObjectivePrintout = (props) => {
+ const { data } = useBackend();
const { objectives } = data;
return (
@@ -64,8 +64,8 @@ const ObjectivePrintout = (props, context) => {
);
};
-const IntroductionSection = (props, context) => {
- const { act, data } = useBackend(context);
+const IntroductionSection = (props) => {
+ const { act, data } = useBackend();
const { hive_name, objectives } = data;
return (
{
);
};
-const AbilitiesSection = (props, context) => {
- const { data } = useBackend(context);
+const AbilitiesSection = (props) => {
+ const { data } = useBackend();
return (
@@ -136,11 +136,10 @@ const AbilitiesSection = (props, context) => {
);
};
-const MemoriesSection = (props, context) => {
- const { act, data } = useBackend(context);
+const MemoriesSection = (props) => {
+ const { act, data } = useBackend();
const { memories, stolen_antag_info } = data;
const [selectedMemory, setSelectedMemory] = useSharedState(
- context,
'memory',
(!!memories && memories[0]) || null,
);
@@ -193,8 +192,8 @@ const MemoriesSection = (props, context) => {
);
};
-const VictimPatternsSection = (props, context) => {
- const { data } = useBackend(context);
+const VictimPatternsSection = (props) => {
+ const { data } = useBackend();
const { stolen_antag_info } = data;
return (
{
);
};
-export const AntagInfoChangeling = (props, context) => {
- const { data } = useBackend(context);
+export const AntagInfoChangeling = (props) => {
+ const { data } = useBackend();
return (
{
- const { data } = useBackend(context);
+export const AntagInfoDemon = (props) => {
+ const { data } = useBackend();
const { fluff, objectives, explain_attack } = data;
return (
@@ -89,8 +89,8 @@ export const AntagInfoDemon = (props, context) => {
);
};
-const ObjectivePrintout = (props, context) => {
- const { data } = useBackend(context);
+const ObjectivePrintout = (props) => {
+ const { data } = useBackend();
const { objectives } = data;
return (
@@ -109,7 +109,7 @@ const ObjectivePrintout = (props, context) => {
);
};
-const DemonRunes = (props, context) => {
+const DemonRunes = (props) => {
return (
{/*
diff --git a/tgui/packages/tgui/interfaces/AntagInfoGangmember.tsx b/tgui/packages/tgui/interfaces/AntagInfoGangmember.tsx
index f27e8e3fddd8..82850130fbe9 100644
--- a/tgui/packages/tgui/interfaces/AntagInfoGangmember.tsx
+++ b/tgui/packages/tgui/interfaces/AntagInfoGangmember.tsx
@@ -9,8 +9,8 @@ type Info = {
gang_clothes: string[];
};
-export const AntagInfoGangmember = (props, context) => {
- const { data } = useBackend(context);
+export const AntagInfoGangmember = (props) => {
+ const { data } = useBackend();
const { gang_name, antag_name } = data;
return (
@@ -51,8 +51,8 @@ export const AntagInfoGangmember = (props, context) => {
);
};
-const GangClothesPrintout = (props, context) => {
- const { data } = useBackend(context);
+const GangClothesPrintout = (props) => {
+ const { data } = useBackend();
const { gang_name, gang_clothes } = data;
return (
@@ -100,8 +100,8 @@ const GangPhonePrintout = () => {
);
};
-const GangObjectivePrintout = (props, context) => {
- const { data } = useBackend(context);
+const GangObjectivePrintout = (props) => {
+ const { data } = useBackend();
const { gang_objective } = data;
return (
diff --git a/tgui/packages/tgui/interfaces/AntagInfoGeneric.tsx b/tgui/packages/tgui/interfaces/AntagInfoGeneric.tsx
index a4941f8aa04a..428250eea4f7 100644
--- a/tgui/packages/tgui/interfaces/AntagInfoGeneric.tsx
+++ b/tgui/packages/tgui/interfaces/AntagInfoGeneric.tsx
@@ -17,8 +17,8 @@ type Info = {
objectives: Objective[];
};
-export const AntagInfoGeneric = (props, context) => {
- const { data } = useBackend(context);
+export const AntagInfoGeneric = (props) => {
+ const { data } = useBackend();
const { antag_name } = data;
return (
@@ -38,8 +38,8 @@ export const AntagInfoGeneric = (props, context) => {
);
};
-const ObjectivePrintout = (props, context) => {
- const { data } = useBackend(context);
+const ObjectivePrintout = (props) => {
+ const { data } = useBackend();
const { objectives } = data;
return (
diff --git a/tgui/packages/tgui/interfaces/AntagInfoHeretic.tsx b/tgui/packages/tgui/interfaces/AntagInfoHeretic.tsx
index c102752f97c0..01dd1b6587b3 100644
--- a/tgui/packages/tgui/interfaces/AntagInfoHeretic.tsx
+++ b/tgui/packages/tgui/interfaces/AntagInfoHeretic.tsx
@@ -152,8 +152,8 @@ const GuideSection = () => {
);
};
-const InformationSection = (props, context) => {
- const { data } = useBackend(context);
+const InformationSection = (props) => {
+ const { data } = useBackend();
const { charges, total_sacrifices, ascended } = data;
return (
@@ -188,8 +188,8 @@ const InformationSection = (props, context) => {
);
};
-const ObjectivePrintout = (props, context) => {
- const { data } = useBackend(context);
+const ObjectivePrintout = (props) => {
+ const { data } = useBackend();
const { objectives } = data;
return (
@@ -210,8 +210,8 @@ const ObjectivePrintout = (props, context) => {
);
};
-const ResearchedKnowledge = (props, context) => {
- const { data } = useBackend(context);
+const ResearchedKnowledge = (props) => {
+ const { data } = useBackend();
const { learnedKnowledge } = data;
return (
@@ -235,8 +235,8 @@ const ResearchedKnowledge = (props, context) => {
);
};
-const KnowledgeShop = (props, context) => {
- const { data, act } = useBackend(context);
+const KnowledgeShop = (props) => {
+ const { data, act } = useBackend();
const { learnableKnowledge } = data;
return (
@@ -270,8 +270,8 @@ const KnowledgeShop = (props, context) => {
);
};
-const ResearchInfo = (props, context) => {
- const { data } = useBackend(context);
+const ResearchInfo = (props) => {
+ const { data } = useBackend();
const { charges } = data;
return (
@@ -297,11 +297,11 @@ const ResearchInfo = (props, context) => {
);
};
-export const AntagInfoHeretic = (props, context) => {
- const { data } = useBackend(context);
+export const AntagInfoHeretic = (props) => {
+ const { data } = useBackend();
const { ascended } = data;
- const [currentTab, setTab] = useLocalState(context, 'currentTab', 0);
+ const [currentTab, setTab] = useLocalState('currentTab', 0);
return (
diff --git a/tgui/packages/tgui/interfaces/AntagInfoMalf.tsx b/tgui/packages/tgui/interfaces/AntagInfoMalf.tsx
index 7d1a96234e0b..ea6c9a231980 100644
--- a/tgui/packages/tgui/interfaces/AntagInfoMalf.tsx
+++ b/tgui/packages/tgui/interfaces/AntagInfoMalf.tsx
@@ -39,8 +39,8 @@ type Info = {
categories: any[];
};
-const ObjectivePrintout = (props, context) => {
- const { data } = useBackend(context);
+const ObjectivePrintout = (props) => {
+ const { data } = useBackend();
const { objectives } = data;
return (
@@ -57,8 +57,8 @@ const ObjectivePrintout = (props, context) => {
);
};
-const IntroductionSection = (props, context) => {
- const { act, data } = useBackend(context);
+const IntroductionSection = (props) => {
+ const { act, data } = useBackend();
const { intro } = data;
return (
@@ -72,8 +72,8 @@ const IntroductionSection = (props, context) => {
);
};
-const FlavorSection = (props, context) => {
- const { data } = useBackend(context);
+const FlavorSection = (props) => {
+ const { data } = useBackend();
const { allies, goal } = data;
return (
{
);
};
-const CodewordsSection = (props, context) => {
- const { data } = useBackend(context);
+const CodewordsSection = (props) => {
+ const { data } = useBackend();
const { has_codewords, phrases, responses } = data;
return (
@@ -175,14 +175,10 @@ const CodewordsSection = (props, context) => {
);
};
-export const AntagInfoMalf = (props, context) => {
- const { act, data } = useBackend(context);
+export const AntagInfoMalf = (props) => {
+ const { act, data } = useBackend();
const { processingTime, categories } = data;
- const [antagInfoTab, setAntagInfoTab] = useLocalState(
- context,
- 'antagInfoTab',
- 0,
- );
+ const [antagInfoTab, setAntagInfoTab] = useLocalState('antagInfoTab', 0);
const categoriesList: string[] = [];
const items: Item[] = [];
for (let i = 0; i < categories.length; i++) {
diff --git a/tgui/packages/tgui/interfaces/AntagInfoMorph.tsx b/tgui/packages/tgui/interfaces/AntagInfoMorph.tsx
index eb594cf03606..703ee448b347 100644
--- a/tgui/packages/tgui/interfaces/AntagInfoMorph.tsx
+++ b/tgui/packages/tgui/interfaces/AntagInfoMorph.tsx
@@ -13,7 +13,7 @@ const noticestyle = {
color: 'lightblue',
};
-export const AntagInfoMorph = (props, context) => {
+export const AntagInfoMorph = (props) => {
return (
diff --git a/tgui/packages/tgui/interfaces/AntagInfoNightmare.tsx b/tgui/packages/tgui/interfaces/AntagInfoNightmare.tsx
index 327e114e2fd5..dd3729477d8e 100644
--- a/tgui/packages/tgui/interfaces/AntagInfoNightmare.tsx
+++ b/tgui/packages/tgui/interfaces/AntagInfoNightmare.tsx
@@ -9,7 +9,7 @@ const noticestyle = {
color: 'lightblue',
};
-export const AntagInfoNightmare = (props, context) => {
+export const AntagInfoNightmare = (props) => {
return (
diff --git a/tgui/packages/tgui/interfaces/AntagInfoSeparatist.tsx b/tgui/packages/tgui/interfaces/AntagInfoSeparatist.tsx
index d7f3843c318f..3444e5c5dc14 100644
--- a/tgui/packages/tgui/interfaces/AntagInfoSeparatist.tsx
+++ b/tgui/packages/tgui/interfaces/AntagInfoSeparatist.tsx
@@ -14,8 +14,8 @@ type Info = {
nationColor: string;
};
-export const AntagInfoSeparatist = (props, context) => {
- const { data } = useBackend(context);
+export const AntagInfoSeparatist = (props) => {
+ const { data } = useBackend();
const { nationColor } = data;
return (
@@ -33,8 +33,8 @@ export const AntagInfoSeparatist = (props, context) => {
);
};
-const IntroductionObjectives = (props, context) => {
- const { data } = useBackend(context);
+const IntroductionObjectives = (props) => {
+ const { data } = useBackend();
const { nation } = data;
return (
@@ -50,8 +50,8 @@ const IntroductionObjectives = (props, context) => {
);
};
-const FrequentlyAskedQuestions = (props, context) => {
- const { data } = useBackend(context);
+const FrequentlyAskedQuestions = (props) => {
+ const { data } = useBackend();
const { nation } = data;
return (
@@ -89,8 +89,8 @@ const FrequentlyAskedQuestions = (props, context) => {
);
};
-const ObjectivePrintout = (props, context) => {
- const { data } = useBackend(context);
+const ObjectivePrintout = (props) => {
+ const { data } = useBackend();
const { nation, objectives } = data;
return (
diff --git a/tgui/packages/tgui/interfaces/AntagInfoThief.tsx b/tgui/packages/tgui/interfaces/AntagInfoThief.tsx
index 905adb66d072..6c7b3bcc68e2 100644
--- a/tgui/packages/tgui/interfaces/AntagInfoThief.tsx
+++ b/tgui/packages/tgui/interfaces/AntagInfoThief.tsx
@@ -18,8 +18,8 @@ type Info = {
policy: string;
};
-export const AntagInfoThief = (props, context) => {
- const { data } = useBackend(context);
+export const AntagInfoThief = (props) => {
+ const { data } = useBackend();
const { intro, goal, hideout, policy } = data;
return (
@@ -61,8 +61,8 @@ export const AntagInfoThief = (props, context) => {
);
};
-const ObjectivePrintout = (props, context) => {
- const { data } = useBackend(context);
+const ObjectivePrintout = (props) => {
+ const { data } = useBackend();
const { objectives } = data;
return (
diff --git a/tgui/packages/tgui/interfaces/AntagInfoTraitor.tsx b/tgui/packages/tgui/interfaces/AntagInfoTraitor.tsx
index caa8650fe106..4dfc79cebba7 100644
--- a/tgui/packages/tgui/interfaces/AntagInfoTraitor.tsx
+++ b/tgui/packages/tgui/interfaces/AntagInfoTraitor.tsx
@@ -41,8 +41,8 @@ type Info = {
objectives: Objective[];
};
-const ObjectivePrintout = (props, context) => {
- const { data } = useBackend(context);
+const ObjectivePrintout = (props) => {
+ const { data } = useBackend();
const { objectives } = data;
return (
@@ -59,8 +59,8 @@ const ObjectivePrintout = (props, context) => {
);
};
-const IntroductionSection = (props, context) => {
- const { act, data } = useBackend(context);
+const IntroductionSection = (props) => {
+ const { act, data } = useBackend();
const { intro } = data;
return (
@@ -74,8 +74,8 @@ const IntroductionSection = (props, context) => {
);
};
-const EmployerSection = (props, context) => {
- const { data } = useBackend(context);
+const EmployerSection = (props) => {
+ const { data } = useBackend();
const { allies, goal } = data;
return (
{
);
};
-const UplinkSection = (props, context) => {
- const { data } = useBackend(context);
+const UplinkSection = (props) => {
+ const { data } = useBackend();
const { has_uplink, uplink_intro, uplink_unlock_info, code, failsafe_code } =
data;
return (
@@ -153,8 +153,8 @@ const UplinkSection = (props, context) => {
);
};
-const CodewordsSection = (props, context) => {
- const { data } = useBackend(context);
+const CodewordsSection = (props) => {
+ const { data } = useBackend();
const { has_codewords, phrases, responses } = data;
return (
@@ -199,8 +199,8 @@ const CodewordsSection = (props, context) => {
);
};
-export const AntagInfoTraitor = (props, context) => {
- const { data } = useBackend(context);
+export const AntagInfoTraitor = (props) => {
+ const { data } = useBackend();
const { theme } = data;
return (
diff --git a/tgui/packages/tgui/interfaces/AntagInfoWizard.tsx b/tgui/packages/tgui/interfaces/AntagInfoWizard.tsx
index eb4a23509643..c88d0dfbe032 100644
--- a/tgui/packages/tgui/interfaces/AntagInfoWizard.tsx
+++ b/tgui/packages/tgui/interfaces/AntagInfoWizard.tsx
@@ -44,7 +44,7 @@ type Info = {
objectives: Objective[];
};
-export const AntagInfoWizard = (props, context) => {
+export const AntagInfoWizard = (props) => {
return (
@@ -132,8 +132,8 @@ export const AntagInfoWizard = (props, context) => {
);
};
-const ObjectivePrintout = (props, context) => {
- const { data } = useBackend(context);
+const ObjectivePrintout = (props) => {
+ const { data } = useBackend();
const { objectives } = data;
return (
diff --git a/tgui/packages/tgui/interfaces/Apc.js b/tgui/packages/tgui/interfaces/Apc.js
index 468d3411f1e7..ea125ec7e981 100644
--- a/tgui/packages/tgui/interfaces/Apc.js
+++ b/tgui/packages/tgui/interfaces/Apc.js
@@ -10,7 +10,7 @@ import {
import { Window } from '../layouts';
import { InterfaceLockNoticeBox } from './common/InterfaceLockNoticeBox';
-export const Apc = (props, context) => {
+export const Apc = (props) => {
return (
@@ -61,8 +61,8 @@ const malfMap = {
},
};
-const ApcContent = (props, context) => {
- const { act, data } = useBackend(context);
+const ApcContent = (props) => {
+ const { act, data } = useBackend();
const locked = data.locked && !data.siliconUser;
const externalPowerStatus =
powerStatusMap[data.externalPower] || powerStatusMap[0];
diff --git a/tgui/packages/tgui/interfaces/ApcControl.js b/tgui/packages/tgui/interfaces/ApcControl.js
index 68e466875de1..6c2b634d830c 100644
--- a/tgui/packages/tgui/interfaces/ApcControl.js
+++ b/tgui/packages/tgui/interfaces/ApcControl.js
@@ -6,8 +6,8 @@ import { Box, Button, Dimmer, Flex, Icon, Table, Tabs } from '../components';
import { Window } from '../layouts';
import { AreaCharge, powerRank } from './PowerMonitor';
-export const ApcControl = (props, context) => {
- const { data } = useBackend(context);
+export const ApcControl = (props) => {
+ const { data } = useBackend();
return (
{data.authenticated === 1 && }
@@ -16,8 +16,8 @@ export const ApcControl = (props, context) => {
);
};
-const ApcLoggedOut = (props, context) => {
- const { act, data } = useBackend(context);
+const ApcLoggedOut = (props) => {
+ const { act, data } = useBackend();
const { emagged } = data;
const text = emagged === 1 ? 'Open' : 'Log In';
return (
@@ -32,10 +32,10 @@ const ApcLoggedOut = (props, context) => {
);
};
-const ApcLoggedIn = (props, context) => {
- const { act, data } = useBackend(context);
+const ApcLoggedIn = (props) => {
+ const { act, data } = useBackend();
const { restoring } = data;
- const [tabIndex, setTabIndex] = useLocalState(context, 'tab-index', 1);
+ const [tabIndex, setTabIndex] = useLocalState('tab-index', 1);
return (
<>
@@ -85,14 +85,10 @@ const ApcLoggedIn = (props, context) => {
);
};
-const ControlPanel = (props, context) => {
- const { act, data } = useBackend(context);
+const ControlPanel = (props) => {
+ const { act, data } = useBackend();
const { emagged, logging } = data;
- const [sortByField, setSortByField] = useLocalState(
- context,
- 'sortByField',
- null,
- );
+ const [sortByField, setSortByField] = useLocalState('sortByField', null);
return (
@@ -136,10 +132,10 @@ const ControlPanel = (props, context) => {
);
};
-const ApcControlScene = (props, context) => {
- const { data, act } = useBackend(context);
+const ApcControlScene = (props) => {
+ const { data, act } = useBackend();
- const [sortByField] = useLocalState(context, 'sortByField', null);
+ const [sortByField] = useLocalState('sortByField', null);
const apcs = flow([
map((apc, i) => ({
@@ -232,8 +228,8 @@ const ApcControlScene = (props, context) => {
);
};
-const LogPanel = (props, context) => {
- const { data } = useBackend(context);
+const LogPanel = (props) => {
+ const { data } = useBackend();
const logs = flow([
map((line, i) => ({
diff --git a/tgui/packages/tgui/interfaces/ApprenticeContract.tsx b/tgui/packages/tgui/interfaces/ApprenticeContract.tsx
index 99e2140b711a..62813b9afbff 100644
--- a/tgui/packages/tgui/interfaces/ApprenticeContract.tsx
+++ b/tgui/packages/tgui/interfaces/ApprenticeContract.tsx
@@ -4,7 +4,7 @@ import { useBackend } from '../backend';
import { BlockQuote, Box, Button, Icon, Section, Stack } from '../components';
import { Window } from '../layouts';
-export const ApprenticeContract = (props, context) => {
+export const ApprenticeContract = (props) => {
return (
@@ -65,8 +65,8 @@ export const ApprenticeContract = (props, context) => {
);
};
-const ApprenticeSelection = (props, context) => {
- const { act } = useBackend(context);
+const ApprenticeSelection = (props) => {
+ const { act } = useBackend();
const { iconName, fluffName, schoolTitle, assetName, blurb } = props;
return (
diff --git a/tgui/packages/tgui/interfaces/Aquarium.js b/tgui/packages/tgui/interfaces/Aquarium.js
index 074ae750fd9f..3a5bb6f885af 100644
--- a/tgui/packages/tgui/interfaces/Aquarium.js
+++ b/tgui/packages/tgui/interfaces/Aquarium.js
@@ -2,8 +2,8 @@ import { useBackend } from '../backend';
import { Button, Flex, Knob, LabeledControls, Section } from '../components';
import { Window } from '../layouts';
-export const Aquarium = (props, context) => {
- const { act, data } = useBackend(context);
+export const Aquarium = (props) => {
+ const { act, data } = useBackend();
const {
temperature,
fluid_type,
diff --git a/tgui/packages/tgui/interfaces/AtmosAlertConsole.js b/tgui/packages/tgui/interfaces/AtmosAlertConsole.js
index e1b79fa644bb..83d6bd6d2eec 100644
--- a/tgui/packages/tgui/interfaces/AtmosAlertConsole.js
+++ b/tgui/packages/tgui/interfaces/AtmosAlertConsole.js
@@ -2,8 +2,8 @@ import { useBackend } from '../backend';
import { Button, Section } from '../components';
import { Window } from '../layouts';
-export const AtmosAlertConsole = (props, context) => {
- const { act, data } = useBackend(context);
+export const AtmosAlertConsole = (props) => {
+ const { act, data } = useBackend();
const priorityAlerts = data.priority || [];
const minorAlerts = data.minor || [];
return (
diff --git a/tgui/packages/tgui/interfaces/AtmosControlConsole.tsx b/tgui/packages/tgui/interfaces/AtmosControlConsole.tsx
index 90c39bacbd4b..bb343017e1e0 100644
--- a/tgui/packages/tgui/interfaces/AtmosControlConsole.tsx
+++ b/tgui/packages/tgui/interfaces/AtmosControlConsole.tsx
@@ -19,20 +19,16 @@ type Chamber = {
output_info?: { active: boolean; amount: number };
};
-export const AtmosControlConsole = (props, context) => {
+export const AtmosControlConsole = (props) => {
const { act, data } = useBackend<{
chambers: Chamber[];
maxInput: number;
maxOutput: number;
reconnecting: boolean;
control: boolean;
- }>(context);
+ }>();
const chambers = data.chambers || [];
- const [chamberId, setChamberId] = useLocalState(
- context,
- 'chamberId',
- chambers[0]?.id,
- );
+ const [chamberId, setChamberId] = useLocalState('chamberId', chambers[0]?.id);
const selectedChamber =
chambers.length === 1
? chambers[0]
diff --git a/tgui/packages/tgui/interfaces/AtmosControlPanel.js b/tgui/packages/tgui/interfaces/AtmosControlPanel.js
index 952c04dc15a8..491aec5a5607 100644
--- a/tgui/packages/tgui/interfaces/AtmosControlPanel.js
+++ b/tgui/packages/tgui/interfaces/AtmosControlPanel.js
@@ -4,8 +4,8 @@ import { useBackend } from '../backend';
import { Box, Button, Flex, Section, Table } from '../components';
import { Window } from '../layouts';
-export const AtmosControlPanel = (props, context) => {
- const { act, data } = useBackend(context);
+export const AtmosControlPanel = (props) => {
+ const { act, data } = useBackend();
const groups = flow([
map((group, i) => ({
...group,
diff --git a/tgui/packages/tgui/interfaces/AtmosFilter.js b/tgui/packages/tgui/interfaces/AtmosFilter.js
index 9900dedd2dc0..5c110e3e77f2 100644
--- a/tgui/packages/tgui/interfaces/AtmosFilter.js
+++ b/tgui/packages/tgui/interfaces/AtmosFilter.js
@@ -10,8 +10,8 @@ import {
import { getGasLabel } from '../constants';
import { Window } from '../layouts';
-export const AtmosFilter = (props, context) => {
- const { act, data } = useBackend(context);
+export const AtmosFilter = (props) => {
+ const { act, data } = useBackend();
const filter_types = data.filter_types || [];
return (
diff --git a/tgui/packages/tgui/interfaces/AtmosMixer.js b/tgui/packages/tgui/interfaces/AtmosMixer.js
index a0c1a2046756..dde3325ec2b3 100644
--- a/tgui/packages/tgui/interfaces/AtmosMixer.js
+++ b/tgui/packages/tgui/interfaces/AtmosMixer.js
@@ -9,8 +9,8 @@ import {
} from '../components';
import { Window } from '../layouts';
-export const AtmosMixer = (props, context) => {
- const { act, data } = useBackend(context);
+export const AtmosMixer = (props) => {
+ const { act, data } = useBackend();
return (
diff --git a/tgui/packages/tgui/interfaces/AtmosPump.js b/tgui/packages/tgui/interfaces/AtmosPump.js
index d53f95484c99..f8ed42bb59ae 100644
--- a/tgui/packages/tgui/interfaces/AtmosPump.js
+++ b/tgui/packages/tgui/interfaces/AtmosPump.js
@@ -9,8 +9,8 @@ import {
} from '../components';
import { Window } from '../layouts';
-export const AtmosPump = (props, context) => {
- const { act, data } = useBackend(context);
+export const AtmosPump = (props) => {
+ const { act, data } = useBackend();
return (
diff --git a/tgui/packages/tgui/interfaces/AtmosTempGate.js b/tgui/packages/tgui/interfaces/AtmosTempGate.js
index cb4b62d2b376..f6efa83b4a52 100644
--- a/tgui/packages/tgui/interfaces/AtmosTempGate.js
+++ b/tgui/packages/tgui/interfaces/AtmosTempGate.js
@@ -2,8 +2,8 @@ import { useBackend } from '../backend';
import { Button, LabeledList, NumberInput, Section } from '../components';
import { Window } from '../layouts';
-export const AtmosTempGate = (props, context) => {
- const { act, data } = useBackend(context);
+export const AtmosTempGate = (props) => {
+ const { act, data } = useBackend();
return (
diff --git a/tgui/packages/tgui/interfaces/AtmosTempPump.js b/tgui/packages/tgui/interfaces/AtmosTempPump.js
index 8483af505ff1..c358445d1202 100644
--- a/tgui/packages/tgui/interfaces/AtmosTempPump.js
+++ b/tgui/packages/tgui/interfaces/AtmosTempPump.js
@@ -2,8 +2,8 @@ import { useBackend } from '../backend';
import { Button, LabeledList, NumberInput, Section } from '../components';
import { Window } from '../layouts';
-export const AtmosTempPump = (props, context) => {
- const { act, data } = useBackend(context);
+export const AtmosTempPump = (props) => {
+ const { act, data } = useBackend();
return (
diff --git a/tgui/packages/tgui/interfaces/Autolathe.js b/tgui/packages/tgui/interfaces/Autolathe.js
index c77078cedab4..2c8690070093 100644
--- a/tgui/packages/tgui/interfaces/Autolathe.js
+++ b/tgui/packages/tgui/interfaces/Autolathe.js
@@ -15,8 +15,8 @@ import {
import { Window } from '../layouts';
import { capitalize } from 'common/string';
-export const Autolathe = (props, context) => {
- const { act, data } = useBackend(context);
+export const Autolathe = (props) => {
+ const { act, data } = useBackend();
// Extract `health` and `color` variables from the `data` object.
const {
materialtotal,
@@ -27,7 +27,6 @@ export const Autolathe = (props, context) => {
active,
} = data;
const [current_category, setCategory] = useLocalState(
- context,
'current_category',
'None',
);
diff --git a/tgui/packages/tgui/interfaces/AutomatedAnnouncement.js b/tgui/packages/tgui/interfaces/AutomatedAnnouncement.js
index 652dc4a62cf6..cc2039e37ae4 100644
--- a/tgui/packages/tgui/interfaces/AutomatedAnnouncement.js
+++ b/tgui/packages/tgui/interfaces/AutomatedAnnouncement.js
@@ -8,8 +8,8 @@ const TOOLTIP_TEXT = multiline`
%RANK with their job.
`;
-export const AutomatedAnnouncement = (props, context) => {
- const { act, data } = useBackend(context);
+export const AutomatedAnnouncement = (props) => {
+ const { act, data } = useBackend();
const { arrivalToggle, arrival, newheadToggle, newhead } = data;
return (
diff --git a/tgui/packages/tgui/interfaces/BankMachine.js b/tgui/packages/tgui/interfaces/BankMachine.js
index 5ce10b60e126..22035fc04e08 100644
--- a/tgui/packages/tgui/interfaces/BankMachine.js
+++ b/tgui/packages/tgui/interfaces/BankMachine.js
@@ -9,8 +9,8 @@ import {
import { formatMoney } from '../format';
import { Window } from '../layouts';
-export const BankMachine = (props, context) => {
- const { act, data } = useBackend(context);
+export const BankMachine = (props) => {
+ const { act, data } = useBackend();
const { current_balance, siphoning, station_name } = data;
return (
diff --git a/tgui/packages/tgui/interfaces/Bepis.js b/tgui/packages/tgui/interfaces/Bepis.js
index 15d42fed1838..fbd07b9dcf55 100644
--- a/tgui/packages/tgui/interfaces/Bepis.js
+++ b/tgui/packages/tgui/interfaces/Bepis.js
@@ -9,8 +9,8 @@ import {
} from '../components';
import { Window } from '../layouts';
-export const Bepis = (props, context) => {
- const { act, data } = useBackend(context);
+export const Bepis = (props) => {
+ const { act, data } = useBackend();
const { amount } = data;
return (
diff --git a/tgui/packages/tgui/interfaces/Biogenerator.js b/tgui/packages/tgui/interfaces/Biogenerator.js
index 5014079504a8..8331913008f7 100644
--- a/tgui/packages/tgui/interfaces/Biogenerator.js
+++ b/tgui/packages/tgui/interfaces/Biogenerator.js
@@ -19,8 +19,8 @@ import { Window } from '../layouts';
const MAX_SEARCH_RESULTS = 25;
-export const Biogenerator = (props, context) => {
- const { data } = useBackend(context);
+export const Biogenerator = (props) => {
+ const { data } = useBackend();
const { beaker, processing } = data;
return (
@@ -38,12 +38,11 @@ export const Biogenerator = (props, context) => {
);
};
-export const BiogeneratorContent = (props, context) => {
- const { act, data } = useBackend(context);
+export const BiogeneratorContent = (props) => {
+ const { act, data } = useBackend();
const { biomass, can_process, categories = [] } = data;
- const [searchText, setSearchText] = useLocalState(context, 'searchText', '');
+ const [searchText, setSearchText] = useLocalState('searchText', '');
const [selectedCategory, setSelectedCategory] = useLocalState(
- context,
'category',
categories[0]?.name,
);
@@ -120,17 +119,13 @@ export const BiogeneratorContent = (props, context) => {
);
};
-const ItemList = (props, context) => {
- const { act } = useBackend(context);
- const [hoveredItem, setHoveredItem] = useLocalState(
- context,
- 'hoveredItem',
- {},
- );
+const ItemList = (props) => {
+ const { act } = useBackend();
+ const [hoveredItem, setHoveredItem] = useLocalState('hoveredItem', {});
const hoveredCost = hoveredItem.cost || 0;
// Append extra hover data to items
const items = props.items.map((item) => {
- const [amount, setAmount] = useLocalState(context, 'amount' + item.name, 1);
+ const [amount, setAmount] = useLocalState('amount' + item.name, 1);
const notSameItem = hoveredItem.name !== item.name;
const notEnoughHovered =
props.biomass - hoveredCost * hoveredItem.amount < item.cost * amount;
diff --git a/tgui/packages/tgui/interfaces/BlackMarketUplink.js b/tgui/packages/tgui/interfaces/BlackMarketUplink.js
index b88bb26e61e6..403d6422bc3e 100644
--- a/tgui/packages/tgui/interfaces/BlackMarketUplink.js
+++ b/tgui/packages/tgui/interfaces/BlackMarketUplink.js
@@ -11,8 +11,8 @@ import {
import { formatMoney } from '../format';
import { Window } from '../layouts';
-export const BlackMarketUplink = (props, context) => {
- const { act, data } = useBackend(context);
+export const BlackMarketUplink = (props) => {
+ const { act, data } = useBackend();
const {
categories = [],
markets = [],
@@ -103,8 +103,8 @@ export const BlackMarketUplink = (props, context) => {
);
};
-const ShipmentSelector = (props, context) => {
- const { act, data } = useBackend(context);
+const ShipmentSelector = (props) => {
+ const { act, data } = useBackend();
const { buying, ltsrbt_built, money } = data;
if (!buying) {
return null;
diff --git a/tgui/packages/tgui/interfaces/BloodFilter.js b/tgui/packages/tgui/interfaces/BloodFilter.js
index 4bad5769524b..dddc1d29a1b4 100644
--- a/tgui/packages/tgui/interfaces/BloodFilter.js
+++ b/tgui/packages/tgui/interfaces/BloodFilter.js
@@ -3,10 +3,10 @@ import { Stack } from '../components';
import { Window } from '../layouts';
import { ChemFilterPane } from './ChemFilter';
-export const BloodFilter = (props, context) => {
- const { act, data } = useBackend(context);
+export const BloodFilter = (props) => {
+ const { act, data } = useBackend();
const { whitelist = [] } = data;
- const [chemName, setChemName] = useLocalState(context, 'chemName', '');
+ const [chemName, setChemName] = useLocalState('chemName', '');
return (
diff --git a/tgui/packages/tgui/interfaces/BluespaceArtillery.js b/tgui/packages/tgui/interfaces/BluespaceArtillery.js
index a837a10855c9..e8b019bfe6ed 100644
--- a/tgui/packages/tgui/interfaces/BluespaceArtillery.js
+++ b/tgui/packages/tgui/interfaces/BluespaceArtillery.js
@@ -2,8 +2,8 @@ import { useBackend } from '../backend';
import { Box, Button, LabeledList, NoticeBox, Section } from '../components';
import { Window } from '../layouts';
-export const BluespaceArtillery = (props, context) => {
- const { act, data } = useBackend(context);
+export const BluespaceArtillery = (props) => {
+ const { act, data } = useBackend();
const { notice, connected, unlocked, target } = data;
return (
diff --git a/tgui/packages/tgui/interfaces/BluespaceLocator.js b/tgui/packages/tgui/interfaces/BluespaceLocator.js
index d0ea241f2eb0..9f39a74d4301 100644
--- a/tgui/packages/tgui/interfaces/BluespaceLocator.js
+++ b/tgui/packages/tgui/interfaces/BluespaceLocator.js
@@ -13,8 +13,8 @@ const directionToIcon = {
northwest: 315,
};
-export const BluespaceLocator = (props, context) => {
- const [tab, setTab] = useSharedState(context, 'tab', 'implant');
+export const BluespaceLocator = (props) => {
+ const [tab, setTab] = useSharedState('tab', 'implant');
return (
@@ -39,8 +39,8 @@ export const BluespaceLocator = (props, context) => {
);
};
-const TeleporterBeacons = (props, context) => {
- const { data } = useBackend(context);
+const TeleporterBeacons = (props) => {
+ const { data } = useBackend();
const { telebeacons } = data;
return telebeacons.map((beacon) => (
{
));
};
-const TrackingImplants = (props, context) => {
- const { data } = useBackend(context);
+const TrackingImplants = (props) => {
+ const { data } = useBackend();
const { trackimplants } = data;
return trackimplants.map((implant) => (
{
));
};
-const SignalLocator = (props, context) => {
- const { data } = useBackend(context);
+const SignalLocator = (props) => {
+ const { data } = useBackend();
const { trackingrange } = data;
const { name, direction, distance } = props;
return (
diff --git a/tgui/packages/tgui/interfaces/BluespaceSender.js b/tgui/packages/tgui/interfaces/BluespaceSender.js
index 41d2e697a46a..9b2b4af376c8 100644
--- a/tgui/packages/tgui/interfaces/BluespaceSender.js
+++ b/tgui/packages/tgui/interfaces/BluespaceSender.js
@@ -17,8 +17,8 @@ import { Window } from '../layouts';
const mappedTopMargin = '2%';
-export const BluespaceSender = (props, context) => {
- const { act, data } = useBackend(context);
+export const BluespaceSender = (props) => {
+ const { act, data } = useBackend();
const { on, gas_transfer_rate, price_multiplier } = data;
const bluespace_network_gases = flow([
filter((gas) => gas.amount >= 0.01),
diff --git a/tgui/packages/tgui/interfaces/BluespaceVendor.js b/tgui/packages/tgui/interfaces/BluespaceVendor.js
index 6591e2745fd9..f55f63371901 100644
--- a/tgui/packages/tgui/interfaces/BluespaceVendor.js
+++ b/tgui/packages/tgui/interfaces/BluespaceVendor.js
@@ -15,8 +15,8 @@ import {
import { getGasColor, getGasLabel } from '../constants';
import { Window } from '../layouts';
-export const BluespaceVendor = (props, context) => {
- const { act, data } = useBackend(context);
+export const BluespaceVendor = (props) => {
+ const { act, data } = useBackend();
const { on, tank_filling_amount, price_multiplier, pumping, selected_gas } =
data;
const bluespace_network_gases = flow([
diff --git a/tgui/packages/tgui/interfaces/BorgPanel.js b/tgui/packages/tgui/interfaces/BorgPanel.js
index 627090477bef..299d4e9643df 100644
--- a/tgui/packages/tgui/interfaces/BorgPanel.js
+++ b/tgui/packages/tgui/interfaces/BorgPanel.js
@@ -2,8 +2,8 @@ import { useBackend } from '../backend';
import { Box, Button, LabeledList, ProgressBar, Section } from '../components';
import { Window } from '../layouts';
-export const BorgPanel = (props, context) => {
- const { act, data } = useBackend(context);
+export const BorgPanel = (props) => {
+ const { act, data } = useBackend();
const borg = data.borg || {};
const cell = data.cell || {};
const cellPercent = cell.charge / cell.maxcharge;
diff --git a/tgui/packages/tgui/interfaces/BountyBoard.js b/tgui/packages/tgui/interfaces/BountyBoard.js
index 8e9146defdd5..6f93a5af3a58 100644
--- a/tgui/packages/tgui/interfaces/BountyBoard.js
+++ b/tgui/packages/tgui/interfaces/BountyBoard.js
@@ -14,7 +14,7 @@ import {
import { formatMoney } from '../format';
import { Window } from '../layouts';
-export const BountyBoard = (props, context) => {
+export const BountyBoard = (props) => {
return (
@@ -24,8 +24,8 @@ export const BountyBoard = (props, context) => {
);
};
-export const BountyBoardContent = (props, context) => {
- const { act, data } = useBackend(context);
+export const BountyBoardContent = (props) => {
+ const { act, data } = useBackend();
const {
accountName,
requests = [],
diff --git a/tgui/packages/tgui/interfaces/BrigTimer.js b/tgui/packages/tgui/interfaces/BrigTimer.js
index b7a26077be61..96e4e849f063 100644
--- a/tgui/packages/tgui/interfaces/BrigTimer.js
+++ b/tgui/packages/tgui/interfaces/BrigTimer.js
@@ -2,8 +2,8 @@ import { useBackend } from '../backend';
import { Button, Section } from '../components';
import { Window } from '../layouts';
-export const BrigTimer = (props, context) => {
- const { act, data } = useBackend(context);
+export const BrigTimer = (props) => {
+ const { act, data } = useBackend();
return (
diff --git a/tgui/packages/tgui/interfaces/CTFPanel.js b/tgui/packages/tgui/interfaces/CTFPanel.js
index 3adbcac1b6c1..ea11ca2ecfb8 100644
--- a/tgui/packages/tgui/interfaces/CTFPanel.js
+++ b/tgui/packages/tgui/interfaces/CTFPanel.js
@@ -2,8 +2,8 @@ import { useBackend } from '../backend';
import { Box, Button, Section, Flex, Stack, Divider } from '../components';
import { Window } from '../layouts';
-export const CTFPanel = (props, context) => {
- const { act, data } = useBackend(context);
+export const CTFPanel = (props) => {
+ const { act, data } = useBackend();
const teams = data.teams || [];
const enabled = data.enabled || [];
return (
diff --git a/tgui/packages/tgui/interfaces/CameraConsole.js b/tgui/packages/tgui/interfaces/CameraConsole.js
index cd73d5f60036..89b469941362 100644
--- a/tgui/packages/tgui/interfaces/CameraConsole.js
+++ b/tgui/packages/tgui/interfaces/CameraConsole.js
@@ -37,8 +37,8 @@ export const selectCameras = (cameras, searchText = '') => {
])(cameras);
};
-export const CameraConsole = (props, context) => {
- const { act, data } = useBackend(context);
+export const CameraConsole = (props) => {
+ const { act, data } = useBackend();
const { mapRef, activeCamera } = data;
const cameras = selectCameras(data.cameras);
const [prevCameraName, nextCameraName] = prevNextCamera(
@@ -89,9 +89,9 @@ export const CameraConsole = (props, context) => {
);
};
-export const CameraConsoleContent = (props, context) => {
- const { act, data } = useBackend(context);
- const [searchText, setSearchText] = useLocalState(context, 'searchText', '');
+export const CameraConsoleContent = (props) => {
+ const { act, data } = useBackend();
+ const [searchText, setSearchText] = useLocalState('searchText', '');
const { activeCamera } = data;
const cameras = selectCameras(data.cameras, searchText);
return (
diff --git a/tgui/packages/tgui/interfaces/Canister.js b/tgui/packages/tgui/interfaces/Canister.js
index a70728a32f5f..a06997f7ad91 100644
--- a/tgui/packages/tgui/interfaces/Canister.js
+++ b/tgui/packages/tgui/interfaces/Canister.js
@@ -22,8 +22,8 @@ const formatPressure = (value) => {
return formatSiUnit(value * 1000, 1, 'Pa');
};
-export const Canister = (props, context) => {
- const { act, data } = useBackend(context);
+export const Canister = (props) => {
+ const { act, data } = useBackend();
const {
portConnected,
tankPressure,
diff --git a/tgui/packages/tgui/interfaces/Canvas.tsx b/tgui/packages/tgui/interfaces/Canvas.tsx
index c53bf0661294..2ce217cad9f8 100644
--- a/tgui/packages/tgui/interfaces/Canvas.tsx
+++ b/tgui/packages/tgui/interfaces/Canvas.tsx
@@ -207,8 +207,8 @@ type CanvasData = {
show_plaque: boolean;
};
-export const Canvas = (props, context) => {
- const { act, data } = useBackend(context);
+export const Canvas = (props) => {
+ const { act, data } = useBackend();
const [width, height] = getImageSize(data.grid);
const scaled_width = width * data.px_per_unit;
const scaled_height = height * data.px_per_unit;
diff --git a/tgui/packages/tgui/interfaces/Cargo.js b/tgui/packages/tgui/interfaces/Cargo.js
index c2e90938ba4e..cf4b9c9dd9e7 100644
--- a/tgui/packages/tgui/interfaces/Cargo.js
+++ b/tgui/packages/tgui/interfaces/Cargo.js
@@ -18,7 +18,7 @@ import {
import { formatMoney } from '../format';
import { Window } from '../layouts';
-export const Cargo = (props, context) => {
+export const Cargo = (props) => {
return (
@@ -28,9 +28,9 @@ export const Cargo = (props, context) => {
);
};
-export const CargoContent = (props, context) => {
- const { act, data } = useBackend(context);
- const [tab, setTab] = useSharedState(context, 'tab', 'catalog');
+export const CargoContent = (props) => {
+ const { act, data } = useBackend();
+ const [tab, setTab] = useSharedState('tab', 'catalog');
const { requestonly } = data;
const cart = data.cart || [];
const requests = data.requests || [];
@@ -83,8 +83,8 @@ export const CargoContent = (props, context) => {
);
};
-const CargoStatus = (props, context) => {
- const { act, data } = useBackend(context);
+const CargoStatus = (props) => {
+ const { act, data } = useBackend();
const {
grocery,
away,
@@ -166,25 +166,20 @@ const searchForSupplies = (supplies, search) => {
])(supplies);
};
-export const CargoCatalog = (props, context) => {
+export const CargoCatalog = (props) => {
const { express } = props;
- const { act, data } = useBackend(context);
+ const { act, data } = useBackend();
const { self_paid, app_cost } = data;
const supplies = Object.values(data.supplies);
const [activeSupplyName, setActiveSupplyName] = useSharedState(
- context,
'supply',
supplies[0]?.name,
);
- const [searchText, setSearchText] = useSharedState(
- context,
- 'search_text',
- '',
- );
+ const [searchText, setSearchText] = useSharedState('search_text', '');
const activeSupply =
activeSupplyName === 'search_results'
@@ -308,8 +303,8 @@ export const CargoCatalog = (props, context) => {
);
};
-const CargoRequests = (props, context) => {
- const { act, data } = useBackend(context);
+const CargoRequests = (props) => {
+ const { act, data } = useBackend();
const { requestonly, can_send, can_approve_requests } = data;
const requests = data.requests || [];
// Labeled list reimplementation to squeeze extra columns out of it
@@ -375,8 +370,8 @@ const CargoRequests = (props, context) => {
);
};
-const CargoCartButtons = (props, context) => {
- const { act, data } = useBackend(context);
+const CargoCartButtons = (props) => {
+ const { act, data } = useBackend();
const { requestonly, can_send, can_approve_requests } = data;
const cart = data.cart || [];
const total = cart.reduce((total, entry) => total + entry.cost, 0);
@@ -401,8 +396,8 @@ const CargoCartButtons = (props, context) => {
);
};
-const CargoCart = (props, context) => {
- const { act, data } = useBackend(context);
+const CargoCart = (props) => {
+ const { act, data } = useBackend();
const { requestonly, away, docked, location, can_send } = data;
const cart = data.cart || [];
return (
@@ -465,7 +460,7 @@ const CargoCart = (props, context) => {
);
};
-const CargoHelp = (props, context) => {
+const CargoHelp = (props) => {
return (
<>
diff --git a/tgui/packages/tgui/interfaces/CargoExpress.js b/tgui/packages/tgui/interfaces/CargoExpress.js
index fcc031934ea7..df24b4e66245 100644
--- a/tgui/packages/tgui/interfaces/CargoExpress.js
+++ b/tgui/packages/tgui/interfaces/CargoExpress.js
@@ -10,8 +10,8 @@ import { Window } from '../layouts';
import { CargoCatalog } from './Cargo';
import { InterfaceLockNoticeBox } from './common/InterfaceLockNoticeBox';
-export const CargoExpress = (props, context) => {
- const { act, data } = useBackend(context);
+export const CargoExpress = (props) => {
+ const { act, data } = useBackend();
return (
@@ -22,8 +22,8 @@ export const CargoExpress = (props, context) => {
);
};
-const CargoExpressContent = (props, context) => {
- const { act, data } = useBackend(context);
+const CargoExpressContent = (props) => {
+ const { act, data } = useBackend();
return (
<>
{
- const { act, data } = useBackend(context);
+export const CargoHoldTerminal = (props) => {
+ const { act, data } = useBackend();
const { points, pad, sending, status_report } = data;
return (
diff --git a/tgui/packages/tgui/interfaces/CellularEmporium.tsx b/tgui/packages/tgui/interfaces/CellularEmporium.tsx
index 2191ed6a15ca..eddba57b3b33 100644
--- a/tgui/packages/tgui/interfaces/CellularEmporium.tsx
+++ b/tgui/packages/tgui/interfaces/CellularEmporium.tsx
@@ -26,8 +26,8 @@ type Ability = {
can_purchase: boolean;
};
-export const CellularEmporium = (props, context) => {
- const { act, data } = useBackend(context);
+export const CellularEmporium = (props) => {
+ const { act, data } = useBackend();
const { can_readapt, genetic_points_remaining } = data;
return (
@@ -60,8 +60,8 @@ export const CellularEmporium = (props, context) => {
);
};
-const AbilityList = (props, context) => {
- const { act, data } = useBackend(context);
+const AbilityList = (props) => {
+ const { act, data } = useBackend();
const { abilities, genetic_points_remaining } = data;
if (!abilities) {
diff --git a/tgui/packages/tgui/interfaces/CentcomPodLauncher.js b/tgui/packages/tgui/interfaces/CentcomPodLauncher.js
index 1354619d2e47..7b4a461fc407 100644
--- a/tgui/packages/tgui/interfaces/CentcomPodLauncher.js
+++ b/tgui/packages/tgui/interfaces/CentcomPodLauncher.js
@@ -23,14 +23,14 @@ const pod_grey = {
color: 'grey',
};
-const useCompact = (context) => {
- const [compact, setCompact] = useLocalState(context, 'compact', false);
+const useCompact = () => {
+ const [compact, setCompact] = useLocalState('compact', false);
const toggleCompact = () => setCompact(!compact);
return [compact, toggleCompact];
};
-export const CentcomPodLauncher = (props, context) => {
- const [compact] = useCompact(context);
+export const CentcomPodLauncher = (props) => {
+ const [compact] = useCompact();
return (
{
);
};
-const CentcomPodLauncherContent = (props, context) => {
- const [compact] = useCompact(context);
+const CentcomPodLauncherContent = (props) => {
+ const [compact] = useCompact();
return (
@@ -422,13 +422,9 @@ const EFFECTS_ALL = [
},
];
-const ViewTabHolder = (props, context) => {
- const { act, data } = useBackend(context);
- const [tabPageIndex, setTabPageIndex] = useLocalState(
- context,
- 'tabPageIndex',
- 1,
- );
+const ViewTabHolder = (props) => {
+ const { act, data } = useBackend();
+ const [tabPageIndex, setTabPageIndex] = useLocalState('tabPageIndex', 1);
const { mapRef } = data;
const TabPageComponent = TABPAGES[tabPageIndex].component();
return (
@@ -518,7 +514,7 @@ const ViewTabHolder = (props, context) => {
);
};
-const TabPod = (props, context) => {
+const TabPod = (props) => {
return (
Note: You can right click on this
@@ -528,8 +524,8 @@ const TabPod = (props, context) => {
);
};
-const TabBay = (props, context) => {
- const { act, data } = useBackend(context);
+const TabBay = (props) => {
+ const { act, data } = useBackend();
return (
<>