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 ( <>
@@ -100,8 +100,8 @@ const CrewTable = (props, context) => { ); }; -const CrewTableEntry = (props, context) => { - const { act, data } = useBackend(context); +const CrewTableEntry = (props) => { + const { act, data } = useBackend(); const { link_allowed } = data; const { sensor_data } = props; const { name, assignment, ijob, life_status, area, can_track } = sensor_data; diff --git a/tgui/packages/tgui/interfaces/CrewManifest.js b/tgui/packages/tgui/interfaces/CrewManifest.js index 92ab6a49a698..fdc2a5ec8581 100644 --- a/tgui/packages/tgui/interfaces/CrewManifest.js +++ b/tgui/packages/tgui/interfaces/CrewManifest.js @@ -13,10 +13,10 @@ const commandJobs = [ // PARIAH EDIT // Any instance of crewMember.trim was originally crewMember.rank -export const CrewManifest = (props, context) => { +export const CrewManifest = (props) => { const { data: { manifest, positions }, - } = useBackend(context); + } = useBackend(); return ( diff --git a/tgui/packages/tgui/interfaces/Cryo.js b/tgui/packages/tgui/interfaces/Cryo.js index 6c9958292484..631d585d6ae6 100644 --- a/tgui/packages/tgui/interfaces/Cryo.js +++ b/tgui/packages/tgui/interfaces/Cryo.js @@ -38,8 +38,8 @@ export const Cryo = () => { ); }; -const CryoContent = (props, context) => { - const { act, data } = useBackend(context); +const CryoContent = (props) => { + const { act, data } = useBackend(); return ( <>
diff --git a/tgui/packages/tgui/interfaces/CryopodConsole.js b/tgui/packages/tgui/interfaces/CryopodConsole.js index 5355831c3ab6..dec28327e77c 100644 --- a/tgui/packages/tgui/interfaces/CryopodConsole.js +++ b/tgui/packages/tgui/interfaces/CryopodConsole.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Button, LabeledList, NoticeBox, Section, Stack } from '../components'; import { Window } from '../layouts'; -export const CryopodConsole = (props, context) => { - const { data } = useBackend(context); +export const CryopodConsole = (props) => { + const { data } = useBackend(); const { account_name } = data; const welcomeTitle = `Hello, ${account_name || '[REDACTED]'}!`; @@ -30,8 +30,8 @@ export const CryopodConsole = (props, context) => { ); }; -const CrewList = (props, context) => { - const { data } = useBackend(context); +const CrewList = (props) => { + const { data } = useBackend(); const { frozen_crew } = data; return ( @@ -49,8 +49,8 @@ const CrewList = (props, context) => { ); }; -const ItemList = (props, context) => { - const { act, data } = useBackend(context); +const ItemList = (props) => { + const { act, data } = useBackend(); const { item_ref_list, item_ref_name, item_retrieval_allowed } = data; if (!item_retrieval_allowed) { return You are not authorized for item management.; diff --git a/tgui/packages/tgui/interfaces/Crystallizer.js b/tgui/packages/tgui/interfaces/Crystallizer.js index 8d627fad3b5e..a10a587aaf15 100644 --- a/tgui/packages/tgui/interfaces/Crystallizer.js +++ b/tgui/packages/tgui/interfaces/Crystallizer.js @@ -13,8 +13,8 @@ import { Window } from '../layouts'; const logScale = (value) => Math.log2(16 + Math.max(0, value)) - 4; -export const Crystallizer = (props, context) => { - const { act, data } = useBackend(context); +export const Crystallizer = (props) => { + const { act, data } = useBackend(); const selectedRecipes = data.selected_recipes || []; const gasTypes = data.internal_gas_data || []; const { diff --git a/tgui/packages/tgui/interfaces/CyborgBootDebug.js b/tgui/packages/tgui/interfaces/CyborgBootDebug.js index ba156d5c4125..fdb4970e1e65 100644 --- a/tgui/packages/tgui/interfaces/CyborgBootDebug.js +++ b/tgui/packages/tgui/interfaces/CyborgBootDebug.js @@ -33,8 +33,8 @@ const TOOLTIP_LAWSYNC = multiline` it's laws with it's master AI. `; -export const CyborgBootDebug = (props, context) => { - const { act, data } = useBackend(context); +export const CyborgBootDebug = (props) => { + const { act, data } = useBackend(); const { designation, master, lawsync, aisync, locomotion, panel } = data; return ( 26 ? 537 : 440} height={289}> diff --git a/tgui/packages/tgui/interfaces/DebugHealth.tsx b/tgui/packages/tgui/interfaces/DebugHealth.tsx index 7f3b22be769c..0577324eefd0 100644 --- a/tgui/packages/tgui/interfaces/DebugHealth.tsx +++ b/tgui/packages/tgui/interfaces/DebugHealth.tsx @@ -13,15 +13,11 @@ import { import { toTitleCase } from 'common/string'; import { TableCell, TableRow } from '../components/Table'; -export const DebugHealth = (props, context) => { - const { data } = useBackend>(context); +export const DebugHealth = (props) => { + const { data } = useBackend>(); const tabs = Object.keys(data); - const [currentTab, setCurrentTab] = useLocalState( - context, - 'currentTab', - tabs[0], - ); + const [currentTab, setCurrentTab] = useLocalState('currentTab', tabs[0]); return ( @@ -55,7 +51,7 @@ export const DebugHealth = (props, context) => { ); }; -const InfoSection = (props: { data: Record }, context) => { +const InfoSection = (props: { data: Record }) => { const { data } = props; return ( @@ -73,7 +69,7 @@ const InfoSection = (props: { data: Record }, context) => { ); }; -const ExpandableSection = (props: { data: Record }, context) => { +const ExpandableSection = (props: { data: Record }) => { const { data } = props; return ( @@ -130,7 +126,7 @@ const ObjectDisplay = (props: { items: Record }) => { ); }; -const TooltipButton = (props, context) => { +const TooltipButton = (props) => { const { item } = props; const name = item.name || item.Name || item.NAME || 'Unknown'; @@ -152,7 +148,7 @@ const TooltipButton = (props, context) => { ); }; -const ListItem = (props: { entry: [string, any] }, context) => { +const ListItem = (props: { entry: [string, any] }) => { const { entry: [label, value], } = props; diff --git a/tgui/packages/tgui/interfaces/DecalPainter.tsx b/tgui/packages/tgui/interfaces/DecalPainter.tsx index 2dffb47ce035..bb5d43812fb2 100644 --- a/tgui/packages/tgui/interfaces/DecalPainter.tsx +++ b/tgui/packages/tgui/interfaces/DecalPainter.tsx @@ -30,8 +30,8 @@ type DecalPainterData = { current_custom_color: string; }; -export const DecalPainter = (props, context) => { - const { act, data } = useBackend(context); +export const DecalPainter = (props) => { + const { act, data } = useBackend(); const custom_color_selected = !data.color_list.some( (color) => color.color === data.current_color, @@ -131,8 +131,8 @@ type IconButtonParams = { selected: boolean; }; -const IconButton = (props: IconButtonParams, context) => { - const { act, data } = useBackend(context); +const IconButton = (props: IconButtonParams) => { + const { act, data } = useBackend(); const generateIconKey = (decal: string, dir: number, color: string) => `${data.icon_prefix} ${decal}_${dir}_${color.replace('#', '')}`; diff --git a/tgui/packages/tgui/interfaces/DepartmentOrders.tsx b/tgui/packages/tgui/interfaces/DepartmentOrders.tsx index f52919451d77..90bb3ec62e5e 100644 --- a/tgui/packages/tgui/interfaces/DepartmentOrders.tsx +++ b/tgui/packages/tgui/interfaces/DepartmentOrders.tsx @@ -52,8 +52,8 @@ const CooldownEstimate = (props) => { ); }; -export const DepartmentOrders = (props, context) => { - const { data } = useBackend(context); +export const DepartmentOrders = (props) => { + const { data } = useBackend(); const { time_left } = data; return ( @@ -83,8 +83,8 @@ export const DepartmentOrders = (props, context) => { ); }; -const CooldownDimmer = (props, context) => { - const { act, data } = useBackend(context); +const CooldownDimmer = (props) => { + const { act, data } = useBackend(); const { can_override, time_left } = data; return ( @@ -117,14 +117,10 @@ const CooldownDimmer = (props, context) => { ); }; -const DepartmentCatalog = (props, context) => { - const { act, data } = useBackend(context); +const DepartmentCatalog = (props) => { + const { act, data } = useBackend(); const { supplies } = data; - const [tabCategory, setTabCategory] = useLocalState( - context, - 'tabName', - supplies[0], - ); + const [tabCategory, setTabCategory] = useLocalState('tabName', supplies[0]); return ( diff --git a/tgui/packages/tgui/interfaces/DestinationTagger.tsx b/tgui/packages/tgui/interfaces/DestinationTagger.tsx index e905ce3909ff..04ae61aec018 100644 --- a/tgui/packages/tgui/interfaces/DestinationTagger.tsx +++ b/tgui/packages/tgui/interfaces/DestinationTagger.tsx @@ -33,8 +33,8 @@ const sortDestinations = (locations: string[]): DestinationInfo[] => { ])(locations); }; -export const DestinationTagger = (props, context) => { - const { act, data } = useBackend(context); +export const DestinationTagger = (props) => { + const { act, data } = useBackend(); const { locations, currentTag } = data; return ( diff --git a/tgui/packages/tgui/interfaces/DisposalUnit.js b/tgui/packages/tgui/interfaces/DisposalUnit.js index 3499d914b72d..f163c3c1c2c2 100644 --- a/tgui/packages/tgui/interfaces/DisposalUnit.js +++ b/tgui/packages/tgui/interfaces/DisposalUnit.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Button, LabeledList, ProgressBar, Section } from '../components'; import { Window } from '../layouts'; -export const DisposalUnit = (props, context) => { - const { act, data } = useBackend(context); +export const DisposalUnit = (props) => { + const { act, data } = useBackend(); let stateColor; let stateText; if (data.full_pressure) { diff --git a/tgui/packages/tgui/interfaces/DnaConsole/DnaConsoleEnzymes.js b/tgui/packages/tgui/interfaces/DnaConsole/DnaConsoleEnzymes.js index b2108952b9c9..38baaab8af13 100644 --- a/tgui/packages/tgui/interfaces/DnaConsole/DnaConsoleEnzymes.js +++ b/tgui/packages/tgui/interfaces/DnaConsole/DnaConsoleEnzymes.js @@ -14,9 +14,9 @@ import { import { GeneticMakeupInfo } from './GeneticMakeupInfo'; import { PULSE_DURATION_MAX, PULSE_STRENGTH_MAX } from './constants'; -const GeneticMakeupBufferInfo = (props, context) => { +const GeneticMakeupBufferInfo = (props) => { const { index, makeup } = props; - const { act, data } = useBackend(context); + const { act, data } = useBackend(); const { isViableSubject, hasDisk, diskReadOnly, isInjectorReady } = data; // Type of the action for applying makeup const ACTION_MAKEUP_APPLY = isViableSubject ? 'makeup_apply' : 'makeup_delay'; @@ -148,8 +148,8 @@ const GeneticMakeupBufferInfo = (props, context) => { ); }; -const GeneticMakeupBuffers = (props, context) => { - const { data, act } = useBackend(context); +const GeneticMakeupBuffers = (props) => { + const { data, act } = useBackend(); const { diskHasMakeup, geneticMakeupCooldown, @@ -221,8 +221,8 @@ const GeneticMakeupBuffers = (props, context) => { ); }; -const PulseEmitterProbs = (props, context) => { - const { data } = useBackend(context); +const PulseEmitterProbs = (props) => { + const { data } = useBackend(); const { stdDevAcc, stdDevStr } = data; return (
@@ -241,8 +241,8 @@ const PulseEmitterProbs = (props, context) => { ); }; -const PulseBoard = (props, context) => { - const { act } = useBackend(context); +const PulseBoard = (props) => { + const { act } = useBackend(); const { subjectBlock = [], type, name } = props; // Build blocks of buttons of unique enzymes const blocks = []; @@ -284,8 +284,8 @@ const PulseBoard = (props, context) => { ); }; -const PulseSettings = (props, context) => { - const { data, act } = useBackend(context); +const PulseSettings = (props) => { + const { data, act } = useBackend(); const { pulseStrength, pulseDuration } = data; return (
@@ -325,8 +325,8 @@ const PulseSettings = (props, context) => { ); }; -export const DnaConsoleEnzymes = (props, context) => { - const { data, act } = useBackend(context); +export const DnaConsoleEnzymes = (props) => { + const { data, act } = useBackend(); const { isScannerConnected } = data; const { subjectBlock, type, name } = props; if (!isScannerConnected) { diff --git a/tgui/packages/tgui/interfaces/DnaConsole/DnaConsoleSequencer.js b/tgui/packages/tgui/interfaces/DnaConsole/DnaConsoleSequencer.js index ef3a85486c76..4e9177f47ded 100644 --- a/tgui/packages/tgui/interfaces/DnaConsole/DnaConsoleSequencer.js +++ b/tgui/packages/tgui/interfaces/DnaConsole/DnaConsoleSequencer.js @@ -13,7 +13,7 @@ import { SUBJECT_TRANSFORMING, } from './constants'; -const GenomeImage = (props, context) => { +const GenomeImage = (props) => { const { url, selected, onClick } = props; let outline; if (selected) { @@ -34,8 +34,8 @@ const GenomeImage = (props, context) => { ); }; -const GeneCycler = (props, context) => { - const { act } = useBackend(context); +const GeneCycler = (props) => { + const { act } = useBackend(); const { alias, gene, index, disabled, ...rest } = props; const color = (disabled && GENE_COLORS['X']) || GENE_COLORS[gene]; return ( @@ -76,7 +76,7 @@ const GeneCycler = (props, context) => { ); }; -const GenomeSequencer = (props, context) => { +const GenomeSequencer = (props) => { const { mutation } = props; if (!mutation) { return No genome selected for sequencing.; @@ -156,8 +156,8 @@ const GenomeSequencer = (props, context) => { ); }; -export const DnaConsoleSequencer = (props, context) => { - const { data, act } = useBackend(context); +export const DnaConsoleSequencer = (props) => { + const { data, act } = useBackend(); const mutations = data.storage?.occupant ?? []; const { isJokerReady, isMonkey, jokerSeconds, subjectStatus } = data; const { sequencerMutation, jokerActive } = data.view; diff --git a/tgui/packages/tgui/interfaces/DnaConsole/DnaConsoleStorage.js b/tgui/packages/tgui/interfaces/DnaConsole/DnaConsoleStorage.js index ee66e833e60c..29a493b34394 100644 --- a/tgui/packages/tgui/interfaces/DnaConsole/DnaConsoleStorage.js +++ b/tgui/packages/tgui/interfaces/DnaConsole/DnaConsoleStorage.js @@ -22,8 +22,8 @@ import { STORAGE_MODE_DISK, } from './constants'; -const DnaConsoleAdvancedInjectors = (props, context) => { - const { act, data } = useBackend(context); +const DnaConsoleAdvancedInjectors = (props) => { + const { act, data } = useBackend(); const { maxAdvInjectors, isInjectorReady } = data; const advInjectors = data.storage.injector ?? []; return ( @@ -81,8 +81,8 @@ const DnaConsoleAdvancedInjectors = (props, context) => { ); }; -const StorageButtons = (props, context) => { - const { data, act } = useBackend(context); +const StorageButtons = (props) => { + const { data, act } = useBackend(); const { hasDisk } = data; const { storageMode, storageConsSubMode, storageDiskSubMode } = data.view; return ( @@ -168,8 +168,8 @@ const StorageButtons = (props, context) => { ); }; -const StorageChromosomes = (props, context) => { - const { data, act } = useBackend(context); +const StorageChromosomes = (props) => { + const { data, act } = useBackend(); const chromos = data.chromoStorage ?? []; const uniqueChromos = uniqBy((chromo) => chromo.Name)(chromos); const chromoName = data.view.storageChromoName; @@ -229,9 +229,9 @@ const StorageChromosomes = (props, context) => { ); }; -const StorageMutations = (props, context) => { +const StorageMutations = (props) => { const { customMode = '' } = props; - const { data, act } = useBackend(context); + const { data, act } = useBackend(); const mutations = props.mutations || []; const mode = data.view.storageMode + customMode; @@ -283,8 +283,8 @@ const StorageMutations = (props, context) => { ); }; -export const DnaConsoleStorage = (props, context) => { - const { data, act } = useBackend(context); +export const DnaConsoleStorage = (props) => { + const { data, act } = useBackend(); const { storageMode, storageConsSubMode, storageDiskSubMode } = data.view; const { diskMakeupBuffer, diskHasMakeup } = data; const mutations = data.storage[storageMode]; diff --git a/tgui/packages/tgui/interfaces/DnaConsole/DnaScanner.js b/tgui/packages/tgui/interfaces/DnaConsole/DnaScanner.js index af04cb754b91..22fff93dfdda 100644 --- a/tgui/packages/tgui/interfaces/DnaConsole/DnaScanner.js +++ b/tgui/packages/tgui/interfaces/DnaConsole/DnaScanner.js @@ -15,8 +15,8 @@ import { SUBJECT_UNCONSCIOUS, } from './constants'; -const DnaScannerButtons = (props, context) => { - const { data, act } = useBackend(context); +const DnaScannerButtons = (props) => { + const { data, act } = useBackend(); const { hasDelayedAction, isPulsing, @@ -72,7 +72,7 @@ const DnaScannerButtons = (props, context) => { /** * Displays subject status based on the value of the status prop. */ -const SubjectStatus = (props, context) => { +const SubjectStatus = (props) => { const { status } = props; if (status === SUBJECT_CONCIOUS) { return ( @@ -112,8 +112,8 @@ const SubjectStatus = (props, context) => { return Unknown; }; -const DnaScannerContent = (props, context) => { - const { data, act } = useBackend(context); +const DnaScannerContent = (props) => { + const { data, act } = useBackend(); const { subjectName, isScannerConnected, @@ -169,7 +169,7 @@ const DnaScannerContent = (props, context) => { ); }; -export const DnaScanner = (props, context) => { +export const DnaScanner = (props) => { return (
}> diff --git a/tgui/packages/tgui/interfaces/DnaConsole/GeneticMakeupInfo.js b/tgui/packages/tgui/interfaces/DnaConsole/GeneticMakeupInfo.js index a53706e2211d..4588b0167e0a 100644 --- a/tgui/packages/tgui/interfaces/DnaConsole/GeneticMakeupInfo.js +++ b/tgui/packages/tgui/interfaces/DnaConsole/GeneticMakeupInfo.js @@ -1,6 +1,6 @@ import { LabeledList, Section } from '../../components'; -export const GeneticMakeupInfo = (props, context) => { +export const GeneticMakeupInfo = (props) => { const { makeup } = props; return ( diff --git a/tgui/packages/tgui/interfaces/DnaConsole/MutationInfo.js b/tgui/packages/tgui/interfaces/DnaConsole/MutationInfo.js index 237893433735..fdc656df839e 100644 --- a/tgui/packages/tgui/interfaces/DnaConsole/MutationInfo.js +++ b/tgui/packages/tgui/interfaces/DnaConsole/MutationInfo.js @@ -19,9 +19,9 @@ const isSameMutation = (a, b) => { return a.Alias === b.Alias && a.AppliedChromo === b.AppliedChromo; }; -const ChromosomeInfo = (props, context) => { +const ChromosomeInfo = (props) => { const { mutation, disabled } = props; - const { data, act } = useBackend(context); + const { data, act } = useBackend(); if (mutation.CanChromo === CHROMOSOME_NEVER) { return No compatible chromosomes; } @@ -61,9 +61,9 @@ const ChromosomeInfo = (props, context) => { return null; }; -const MutationCombiner = (props, context) => { +const MutationCombiner = (props) => { const { mutations = [], source } = props; - const { act, data } = useBackend(context); + const { act, data } = useBackend(); const brefFromName = (name) => { return mutations.find((mutation) => mutation.Name === name)?.ByondRef; @@ -86,9 +86,9 @@ const MutationCombiner = (props, context) => { ); }; -export const MutationInfo = (props, context) => { +export const MutationInfo = (props) => { const { mutation } = props; - const { data, act } = useBackend(context); + const { data, act } = useBackend(); const { diskCapacity, diskReadOnly, diff --git a/tgui/packages/tgui/interfaces/DnaConsole/index.js b/tgui/packages/tgui/interfaces/DnaConsole/index.js index 699348b8b602..d8dabc2ad35f 100644 --- a/tgui/packages/tgui/interfaces/DnaConsole/index.js +++ b/tgui/packages/tgui/interfaces/DnaConsole/index.js @@ -20,8 +20,8 @@ import { STORAGE_MODE_CONSOLE, } from './constants'; -const DnaConsoleCommands = (props, context) => { - const { data, act } = useBackend(context); +const DnaConsoleCommands = (props) => { + const { data, act } = useBackend(); const { hasDisk, isInjectorReady, injectorSeconds } = data; const { consoleMode } = data.view; return ( @@ -94,8 +94,8 @@ const DnaConsoleCommands = (props, context) => { ); }; -export const DnaConsole = (props, context) => { - const { data, act } = useBackend(context); +export const DnaConsole = (props) => { + const { data, act } = useBackend(); const { isPulsing, timeToPulse, subjectUNI, subjectUF } = data; const { consoleMode } = data.view; return ( diff --git a/tgui/packages/tgui/interfaces/DnaVault.js b/tgui/packages/tgui/interfaces/DnaVault.js index ddb671e86e0b..5ac7711412d0 100644 --- a/tgui/packages/tgui/interfaces/DnaVault.js +++ b/tgui/packages/tgui/interfaces/DnaVault.js @@ -9,8 +9,8 @@ import { } from '../components'; import { Window } from '../layouts'; -export const DnaVault = (props, context) => { - const { act, data } = useBackend(context); +export const DnaVault = (props) => { + const { act, data } = useBackend(); const { completed, used, diff --git a/tgui/packages/tgui/interfaces/DopplerArray.js b/tgui/packages/tgui/interfaces/DopplerArray.js index 32f9bb803db3..46d10089122e 100644 --- a/tgui/packages/tgui/interfaces/DopplerArray.js +++ b/tgui/packages/tgui/interfaces/DopplerArray.js @@ -11,8 +11,8 @@ import { } from '../components'; import { Window } from '../layouts'; -export const DopplerArray = (props, context) => { - const { act, data } = useBackend(context); +export const DopplerArray = (props) => { + const { act, data } = useBackend(); return ( @@ -22,11 +22,10 @@ export const DopplerArray = (props, context) => { ); }; -const DopplerArrayContent = (props, context) => { - const { act, data } = useBackend(context); +const DopplerArrayContent = (props) => { + const { act, data } = useBackend(); const { records = [], disk, storage } = data; const [activeRecordName, setActiveRecordName] = useSharedState( - context, 'activeRecordrecord', records[0]?.name, ); diff --git a/tgui/packages/tgui/interfaces/EightBallVote.js b/tgui/packages/tgui/interfaces/EightBallVote.js index 5170072c88a5..a96193403828 100644 --- a/tgui/packages/tgui/interfaces/EightBallVote.js +++ b/tgui/packages/tgui/interfaces/EightBallVote.js @@ -3,8 +3,8 @@ import { Box, Button, Grid, Section, NoticeBox } from '../components'; import { toTitleCase } from 'common/string'; import { Window } from '../layouts'; -export const EightBallVote = (props, context) => { - const { act, data } = useBackend(context); +export const EightBallVote = (props) => { + const { act, data } = useBackend(); const { shaking } = data; return ( @@ -17,8 +17,8 @@ export const EightBallVote = (props, context) => { ); }; -const EightBallVoteQuestion = (props, context) => { - const { act, data } = useBackend(context); +const EightBallVoteQuestion = (props) => { + const { act, data } = useBackend(); const { question, answers = [] } = data; return (
diff --git a/tgui/packages/tgui/interfaces/Electrolyzer.js b/tgui/packages/tgui/interfaces/Electrolyzer.js index 742e25dd4907..e3d1150eca3f 100644 --- a/tgui/packages/tgui/interfaces/Electrolyzer.js +++ b/tgui/packages/tgui/interfaces/Electrolyzer.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Button, LabeledList, ProgressBar, Section } from '../components'; import { Window } from '../layouts'; -export const Electrolyzer = (props, context) => { - const { act, data } = useBackend(context); +export const Electrolyzer = (props) => { + const { act, data } = useBackend(); return ( diff --git a/tgui/packages/tgui/interfaces/Electropack.js b/tgui/packages/tgui/interfaces/Electropack.js index d7cfdb15b120..3eb52ab89469 100644 --- a/tgui/packages/tgui/interfaces/Electropack.js +++ b/tgui/packages/tgui/interfaces/Electropack.js @@ -3,8 +3,8 @@ import { useBackend } from '../backend'; import { Button, LabeledList, NumberInput, Section } from '../components'; import { Window } from '../layouts'; -export const Electropack = (props, context) => { - const { act, data } = useBackend(context); +export const Electropack = (props) => { + const { act, data } = useBackend(); const { power, code, frequency, minFrequency, maxFrequency } = data; return ( diff --git a/tgui/packages/tgui/interfaces/EmergencyShuttleConsole.js b/tgui/packages/tgui/interfaces/EmergencyShuttleConsole.js index ac6ac1897bb4..b7b09bdca6a8 100644 --- a/tgui/packages/tgui/interfaces/EmergencyShuttleConsole.js +++ b/tgui/packages/tgui/interfaces/EmergencyShuttleConsole.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Box, Button, Grid, Section } from '../components'; import { Window } from '../layouts'; -export const EmergencyShuttleConsole = (props, context) => { - const { act, data } = useBackend(context); +export const EmergencyShuttleConsole = (props) => { + const { act, data } = useBackend(); const { timer_str, enabled, diff --git a/tgui/packages/tgui/interfaces/EngravedMessage.js b/tgui/packages/tgui/interfaces/EngravedMessage.js index cdfaac644220..d66f33b086b3 100644 --- a/tgui/packages/tgui/interfaces/EngravedMessage.js +++ b/tgui/packages/tgui/interfaces/EngravedMessage.js @@ -3,8 +3,8 @@ import { useBackend } from '../backend'; import { Box, Button, LabeledList, Section, Stack } from '../components'; import { Window } from '../layouts'; -export const EngravedMessage = (props, context) => { - const { act, data } = useBackend(context); +export const EngravedMessage = (props) => { + const { act, data } = useBackend(); const { admin_mode, creator_key, diff --git a/tgui/packages/tgui/interfaces/ExodroneConsole.tsx b/tgui/packages/tgui/interfaces/ExodroneConsole.tsx index e9a8bb722f60..38a2d932818e 100644 --- a/tgui/packages/tgui/interfaces/ExodroneConsole.tsx +++ b/tgui/packages/tgui/interfaces/ExodroneConsole.tsx @@ -158,12 +158,11 @@ type ToolData = { icon: string; }; -export const ExodroneConsole = (props, context) => { - const { data } = useBackend(context); +export const ExodroneConsole = (props) => { + const { data } = useBackend(); const { signal_lost } = data; const [choosingTools, setChoosingTools] = useLocalState( - context, 'choosingTools', false, ); @@ -179,8 +178,8 @@ export const ExodroneConsole = (props, context) => { ); }; -const SignalLostModal = (props, context) => { - const { act } = useBackend(context); +const SignalLostModal = (props) => { + const { act } = useBackend(); return ( { ); }; -const DroneSelectionSection = ( - props: { - all_drones: Array; - }, - context, -) => { - const { act } = useBackend(context); +const DroneSelectionSection = (props: { + all_drones: Array; +}) => { + const { act } = useBackend(); const { all_drones } = props; return ( @@ -263,12 +259,11 @@ const DroneSelectionSection = ( ); }; -const ToolSelectionModal = (props, context) => { - const { act, data } = useBackend(context); +const ToolSelectionModal = (props) => { + const { act, data } = useBackend(); const { all_tools = {} } = data; const [choosingTools, setChoosingTools] = useLocalState( - context, 'choosingTools', false, ); @@ -312,14 +307,8 @@ const ToolSelectionModal = (props, context) => { ); }; -const EquipmentBox = ( - props: { - cargo: CargoData; - drone: DroneData; - }, - context, -) => { - const { act, data } = useBackend(context); +const EquipmentBox = (props: { cargo: CargoData; drone: DroneData }) => { + const { act, data } = useBackend(); const { all_tools = {} } = data; const { configurable } = props.drone; const cargo = props.cargo; @@ -400,16 +389,10 @@ const EquipmentBox = ( ); }; -const EquipmentGrid = ( - props: { - drone: ActiveDrone & DroneData; - }, - context, -) => { - const { act } = useBackend(context); +const EquipmentGrid = (props: { drone: ActiveDrone & DroneData }) => { + const { act } = useBackend(); const { cargo, configurable } = props.drone; const [choosingTools, setChoosingTools] = useLocalState( - context, 'choosingTools', false, ); @@ -471,13 +454,10 @@ const EquipmentGrid = ( ); }; -const DroneStatus = ( - props: { - drone_integrity: number; - drone_max_integrity: number; - }, - context, -) => { +const DroneStatus = (props: { + drone_integrity: number; + drone_max_integrity: number; +}) => { const { drone_integrity, drone_max_integrity } = props; return ( @@ -519,15 +499,12 @@ const NoSiteDimmer = () => { ); }; -const TravelTargetSelectionScreen = ( - props: { - drone: (DroneExploration | DroneIdle | DroneTravel) & DroneData; - showCancelButton?: boolean; - }, - context, -) => { +const TravelTargetSelectionScreen = (props: { + drone: (DroneExploration | DroneIdle | DroneTravel) & DroneData; + showCancelButton?: boolean; +}) => { // List of sites and eta travel times to each - const { act, data } = useBackend(context); + const { act, data } = useBackend(); const { drone } = props; const { all_bands } = data; const { can_travel, travel_error, drone_travel_coefficent } = drone; @@ -546,12 +523,10 @@ const TravelTargetSelectionScreen = ( } }; const [choosingTools, setChoosingTools] = useLocalState( - context, 'choosingTools', false, ); const [TravelDimmerShown, setTravelDimmerShown] = useLocalState( - context, 'TravelDimmerShown', false, ); @@ -652,12 +627,7 @@ const TravelTargetSelectionScreen = ( ); }; -const TravelDimmer = ( - props: { - drone: DroneTravel; - }, - context, -) => { +const TravelDimmer = (props: { drone: DroneTravel }) => { const { travel_time_left } = props.drone; return (
@@ -694,18 +664,12 @@ const TimeoutScreen = (props: { drone: DroneBusy }) => { ); }; -const ExplorationScreen = ( - props: { - drone: DroneExploration & DroneData; - }, - context, -) => { - const { act } = useBackend(context); +const ExplorationScreen = (props: { drone: DroneExploration & DroneData }) => { + const { act } = useBackend(); const { drone } = props; const { site } = drone; const [TravelDimmerShown, setTravelDimmerShown] = useLocalState( - context, 'TravelDimmerShown', false, ); @@ -755,14 +719,8 @@ const ExplorationScreen = ( ); }; -const EventScreen = ( - props: { - drone: DroneData; - event: FullEventData; - }, - context, -) => { - const { act } = useBackend(context); +const EventScreen = (props: { drone: DroneData; event: FullEventData }) => { + const { act } = useBackend(); const { drone, event } = props; return ( @@ -821,16 +779,13 @@ const EventScreen = ( ); }; -export const AdventureScreen = ( - props: { - adventure_data: AdventureData; - drone_integrity: number; - drone_max_integrity: number; - hide_status?: boolean; - }, - context, -) => { - const { act } = useBackend(context); +export const AdventureScreen = (props: { + adventure_data: AdventureData; + drone_integrity: number; + drone_max_integrity: number; + hide_status?: boolean; +}) => { + const { act } = useBackend(); const { adventure_data, drone_integrity, drone_max_integrity } = props; const rawData = adventure_data.raw_image; const imgSource = rawData ? rawData : resolveAsset(adventure_data.image); @@ -913,8 +868,8 @@ const DroneScreen = (props: { drone: ActiveDrone & DroneData }) => { } }; -const ExodroneConsoleContent = (props, context) => { - const { data } = useBackend(context); +const ExodroneConsoleContent = (props) => { + const { data } = useBackend(); if (!data.drone) { return ; diff --git a/tgui/packages/tgui/interfaces/ExoscannerConsole.tsx b/tgui/packages/tgui/interfaces/ExoscannerConsole.tsx index b65d03abca46..ed3ae629901f 100644 --- a/tgui/packages/tgui/interfaces/ExoscannerConsole.tsx +++ b/tgui/packages/tgui/interfaces/ExoscannerConsole.tsx @@ -31,8 +31,8 @@ type ScanData = { site_data: SiteData; }; -const ScanFailedModal = (_, context) => { - const { act } = useBackend(context); +const ScanFailedModal = (_) => { + const { act } = useBackend(); return ( @@ -47,8 +47,8 @@ const ScanFailedModal = (_, context) => { ); }; -const ScanSelectionSection = (_, context) => { - const { act, data } = useBackend(context); +const ScanSelectionSection = (_) => { + const { act, data } = useBackend(); const { scan_power, point_scan_eta, @@ -146,8 +146,8 @@ type ScanInProgressData = { scan_description: string; }; -const ScanInProgressModal = (_, context) => { - const { act, data } = useBackend(context); +const ScanInProgressModal = (_) => { + const { act, data } = useBackend(); const { scan_time, scan_power, scan_description } = data; return ( @@ -187,8 +187,8 @@ type ExoscannerConsoleData = { scan_conditions: Array; }; -export const ExoscannerConsole = (_, context) => { - const { act, data } = useBackend(context); +export const ExoscannerConsole = (_) => { + const { act, data } = useBackend(); const { scan_in_progress, scan_power, diff --git a/tgui/packages/tgui/interfaces/ExosuitControlConsole.js b/tgui/packages/tgui/interfaces/ExosuitControlConsole.js index 9a1d602abf3e..2fe72ef4a4c2 100644 --- a/tgui/packages/tgui/interfaces/ExosuitControlConsole.js +++ b/tgui/packages/tgui/interfaces/ExosuitControlConsole.js @@ -10,8 +10,8 @@ import { } from '../components'; import { Window } from '../layouts'; -export const ExosuitControlConsole = (props, context) => { - const { act, data } = useBackend(context); +export const ExosuitControlConsole = (props) => { + const { act, data } = useBackend(); const { mechs = [] } = data; return ( diff --git a/tgui/packages/tgui/interfaces/ExosuitFabricator.js b/tgui/packages/tgui/interfaces/ExosuitFabricator.js index c3202416d8a7..85631f4b0543 100644 --- a/tgui/packages/tgui/interfaces/ExosuitFabricator.js +++ b/tgui/packages/tgui/interfaces/ExosuitFabricator.js @@ -119,8 +119,8 @@ const searchFilter = (search, allparts) => { return searchResults; }; -export const ExosuitFabricator = (props, context) => { - const { act, data } = useBackend(context); +export const ExosuitFabricator = (props) => { + const { act, data } = useBackend(); const queue = data.queue || []; const materialAsObj = materialArrayToObj(data.materials || []); const { materialTally, missingMatTally, textColors } = queueCondFormat( @@ -128,7 +128,6 @@ export const ExosuitFabricator = (props, context) => { queue, ); const [displayMatCost, setDisplayMatCost] = useSharedState( - context, 'display_mats', false, ); @@ -200,12 +199,11 @@ export const ExosuitFabricator = (props, context) => { ); }; -const PartSets = (props, context) => { - const { data } = useBackend(context); +const PartSets = (props) => { + const { data } = useBackend(); const partSets = data.partSets || []; const buildableParts = data.buildableParts || {}; const [selectedPartTab, setSelectedPartTab] = useSharedState( - context, 'part_tab', partSets.length ? buildableParts[0] : '', ); @@ -224,8 +222,8 @@ const PartSets = (props, context) => { )); }; -const PartLists = (props, context) => { - const { data } = useBackend(context); +const PartLists = (props) => { + const { data } = useBackend(); const getFirstValidPartSet = (sets) => { for (let set of sets) { @@ -242,16 +240,11 @@ const PartLists = (props, context) => { const { queueMaterials, materials } = props; const [selectedPartTab, setSelectedPartTab] = useSharedState( - context, 'part_tab', getFirstValidPartSet(partSets), ); - const [searchText, setSearchText] = useSharedState( - context, - 'search_text', - '', - ); + const [searchText, setSearchText] = useSharedState('search_text', ''); if (!selectedPartTab || !buildableParts[selectedPartTab]) { const validSet = getFirstValidPartSet(partSets); @@ -326,11 +319,11 @@ const PartLists = (props, context) => { ); }; -const PartCategory = (props, context) => { - const { act, data } = useBackend(context); +const PartCategory = (props) => { + const { act, data } = useBackend(); const { buildingPart } = data; const { parts, name, forceShow, placeholder } = props; - const [displayMatCost] = useSharedState(context, 'display_mats', false); + const [displayMatCost] = useSharedState('display_mats', false); if (!forceShow && parts.length === 0) { return null; } @@ -410,8 +403,8 @@ const PartCategory = (props, context) => { ); }; -const Queue = (props, context) => { - const { act, data } = useBackend(context); +const Queue = (props) => { + const { act, data } = useBackend(); const { isProcessingQueue } = data; const queue = data.queue || []; const { queueMaterials, missingMaterials, textColors } = props; @@ -473,7 +466,7 @@ const Queue = (props, context) => { ); }; -const QueueMaterials = (props, context) => { +const QueueMaterials = (props) => { const { queueMaterials, missingMaterials } = props; return ( @@ -493,8 +486,8 @@ const QueueMaterials = (props, context) => { ); }; -const QueueList = (props, context) => { - const { act, data } = useBackend(context); +const QueueList = (props) => { + const { act, data } = useBackend(); const { textColors } = props; @@ -520,8 +513,8 @@ const QueueList = (props, context) => { )); }; -const BeingBuilt = (props, context) => { - const { data } = useBackend(context); +const BeingBuilt = (props) => { + const { data } = useBackend(); const { buildingPart, storedPart } = data; if (storedPart) { diff --git a/tgui/packages/tgui/interfaces/FaxMachine.js b/tgui/packages/tgui/interfaces/FaxMachine.js index 8696c6b60b12..514dfd85ba4f 100644 --- a/tgui/packages/tgui/interfaces/FaxMachine.js +++ b/tgui/packages/tgui/interfaces/FaxMachine.js @@ -11,8 +11,8 @@ import { } from '../components'; import { Window } from '../layouts'; -export const FaxMachine = (props, context) => { - const { act, data } = useBackend(context); +export const FaxMachine = (props) => { + const { act, data } = useBackend(); const { display_name, destination_options = [], @@ -26,16 +26,14 @@ export const FaxMachine = (props, context) => { unread_message, } = data; - const [tab, setTab] = useSharedState(context, 'tab', 1); + const [tab, setTab] = useSharedState('tab', 1); const [selectedPaperTab, setSelectedPaper] = useLocalState( - context, 'ref', received_paperwork[0]?.ref, ); const [destination, setDestination] = useLocalState( - context, 'dest', default_destination, ); diff --git a/tgui/packages/tgui/interfaces/FilingCabinet.js b/tgui/packages/tgui/interfaces/FilingCabinet.js index 0d7b0631b5ad..503a0883fefa 100644 --- a/tgui/packages/tgui/interfaces/FilingCabinet.js +++ b/tgui/packages/tgui/interfaces/FilingCabinet.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Box, Button, Flex, Section } from '../components'; import { Window } from '../layouts'; -export const FilingCabinet = (props, context) => { - const { act, data } = useBackend(context); +export const FilingCabinet = (props) => { + const { act, data } = useBackend(); const { cabinet_name, contents, contents_ref } = data; return ( diff --git a/tgui/packages/tgui/interfaces/Filteriffic.js b/tgui/packages/tgui/interfaces/Filteriffic.js index 0335a17deee6..19f954b3df02 100644 --- a/tgui/packages/tgui/interfaces/Filteriffic.js +++ b/tgui/packages/tgui/interfaces/Filteriffic.js @@ -16,9 +16,9 @@ import { } from '../components'; import { Window } from '../layouts'; -const FilterIntegerEntry = (props, context) => { +const FilterIntegerEntry = (props) => { const { value, name, filterName } = props; - const { act } = useBackend(context); + const { act } = useBackend(); return ( { ); }; -const FilterFloatEntry = (props, context) => { +const FilterFloatEntry = (props) => { const { value, name, filterName } = props; - const { act } = useBackend(context); - const [step, setStep] = useLocalState(context, `${filterName}-${name}`, 0.01); + const { act } = useBackend(); + const [step, setStep] = useLocalState(`${filterName}-${name}`, 0.01); return ( <> { ); }; -const FilterTextEntry = (props, context) => { +const FilterTextEntry = (props) => { const { value, name, filterName } = props; - const { act } = useBackend(context); + const { act } = useBackend(); return ( { ); }; -const FilterColorEntry = (props, context) => { +const FilterColorEntry = (props) => { const { value, filterName, name } = props; - const { act } = useBackend(context); + const { act } = useBackend(); return ( <>
@@ -296,8 +296,8 @@ const LoadingAnimation = () => { ); }; -export const GreyscaleModifyMenu = (props, context) => { - const { act, data } = useBackend(context); +export const GreyscaleModifyMenu = (props) => { + const { act, data } = useBackend(); return ( diff --git a/tgui/packages/tgui/interfaces/GulagItemReclaimer.js b/tgui/packages/tgui/interfaces/GulagItemReclaimer.js index bef454da0e92..21cf4964b00d 100644 --- a/tgui/packages/tgui/interfaces/GulagItemReclaimer.js +++ b/tgui/packages/tgui/interfaces/GulagItemReclaimer.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Button, NoticeBox, Section, Table } from '../components'; import { Window } from '../layouts'; -export const GulagItemReclaimer = (props, context) => { - const { act, data } = useBackend(context); +export const GulagItemReclaimer = (props) => { + const { act, data } = useBackend(); const { mobs = [] } = data; return ( diff --git a/tgui/packages/tgui/interfaces/GulagTeleporterConsole.js b/tgui/packages/tgui/interfaces/GulagTeleporterConsole.js index 59e110b0f225..008f27627158 100644 --- a/tgui/packages/tgui/interfaces/GulagTeleporterConsole.js +++ b/tgui/packages/tgui/interfaces/GulagTeleporterConsole.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Button, LabeledList, NumberInput, Section } from '../components'; import { Window } from '../layouts'; -export const GulagTeleporterConsole = (props, context) => { - const { act, data } = useBackend(context); +export const GulagTeleporterConsole = (props) => { + const { act, data } = useBackend(); const { teleporter, teleporter_lock, diff --git a/tgui/packages/tgui/interfaces/HoloPay.tsx b/tgui/packages/tgui/interfaces/HoloPay.tsx index 1d16030e12eb..b341dc555070 100644 --- a/tgui/packages/tgui/interfaces/HoloPay.tsx +++ b/tgui/packages/tgui/interfaces/HoloPay.tsx @@ -31,10 +31,10 @@ Use of departmental funds is prohibited. For more information, visit the Head of Personnel. All rights reserved. All trademarks are property of their respective owners.`; -export const HoloPay = (_, context) => { - const { data } = useBackend(context); +export const HoloPay = (_) => { + const { data } = useBackend(); const { owner } = data; - const [setupMode, setSetupMode] = useLocalState(context, 'setupMode', false); + const [setupMode, setSetupMode] = useLocalState('setupMode', false); // User clicked the "Setup" or "Done" button. const onClick = () => { setSetupMode(!setupMode); @@ -67,8 +67,8 @@ export const HoloPay = (_, context) => { /** * Displays the current user's bank information (if any) */ -const AccountDisplay = (_, context) => { - const { data } = useBackend(context); +const AccountDisplay = (_) => { + const { data } = useBackend(); const { user } = data; if (!user) { return Error! No account detected.; @@ -99,8 +99,8 @@ const AccountDisplay = (_, context) => { * Displays the payment processor. This is the main display. * Shows icon, name, payment button. */ -const TerminalDisplay = (props, context) => { - const { act, data } = useBackend(context); +const TerminalDisplay = (props) => { + const { act, data } = useBackend(); const { description, force_fee, name, owner, user, shop_logo } = data; const { onClick } = props; const is_owner = owner === user?.name; @@ -183,8 +183,8 @@ const TerminalDisplay = (props, context) => { /** * User has clicked "setup" button. Changes vars on the holopay. */ -const SetupDisplay = (props, context) => { - const { act, data } = useBackend(context); +const SetupDisplay = (props) => { + const { act, data } = useBackend(); const { available_logos = [], force_fee, max_fee, name, shop_logo } = data; const { onClick } = props; const decodedName = name.replace(/&#(\d+);/g, (_, dec) => { diff --git a/tgui/packages/tgui/interfaces/Holodeck.js b/tgui/packages/tgui/interfaces/Holodeck.js index 48989ace9a45..7ebff7d574e7 100644 --- a/tgui/packages/tgui/interfaces/Holodeck.js +++ b/tgui/packages/tgui/interfaces/Holodeck.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Button, Section } from '../components'; import { Window } from '../layouts'; -export const Holodeck = (props, context) => { - const { act, data } = useBackend(context); +export const Holodeck = (props) => { + const { act, data } = useBackend(); const { can_toggle_safety, emagged, program } = data; const default_programs = data.default_programs || []; const emag_programs = data.emag_programs || []; diff --git a/tgui/packages/tgui/interfaces/Holopad.js b/tgui/packages/tgui/interfaces/Holopad.js index 62fc78f7ff7f..177c5566feb0 100644 --- a/tgui/packages/tgui/interfaces/Holopad.js +++ b/tgui/packages/tgui/interfaces/Holopad.js @@ -11,8 +11,8 @@ import { } from '../components'; import { Window } from '../layouts'; -export const Holopad = (props, context) => { - const { act, data } = useBackend(context); +export const Holopad = (props) => { + const { act, data } = useBackend(); const { calling } = data; return ( @@ -42,8 +42,8 @@ export const Holopad = (props, context) => { ); }; -const HolopadContent = (props, context) => { - const { act, data } = useBackend(context); +const HolopadContent = (props) => { + const { act, data } = useBackend(); const { on_network, on_cooldown, diff --git a/tgui/packages/tgui/interfaces/HotkeysHelp.tsx b/tgui/packages/tgui/interfaces/HotkeysHelp.tsx index 1f24796fa588..d2911986dcd7 100644 --- a/tgui/packages/tgui/interfaces/HotkeysHelp.tsx +++ b/tgui/packages/tgui/interfaces/HotkeysHelp.tsx @@ -88,8 +88,8 @@ const KeyBinding = (props: KeyBindingBoxProps) => ( <>{processColorModifiers(props.keycode)} ); -export const HotkeysHelp = (_, context) => { - const { data } = useBackend(context); +export const HotkeysHelp = (_) => { + const { data } = useBackend(); return ( diff --git a/tgui/packages/tgui/interfaces/Hypertorus/Controls.js b/tgui/packages/tgui/interfaces/Hypertorus/Controls.js index 78c4b9d32c31..6c830a21b5d0 100644 --- a/tgui/packages/tgui/interfaces/Hypertorus/Controls.js +++ b/tgui/packages/tgui/interfaces/Hypertorus/Controls.js @@ -18,7 +18,7 @@ import { HelpDummy, HoverHelp } from './helpers'; * for generalizing and refactoring. */ -const ComboKnob = (props, context) => { +const ComboKnob = (props) => { const { color = false, defaultValue, @@ -33,7 +33,7 @@ const ComboKnob = (props, context) => { ...rest } = props; - const { act, data } = useBackend(context); + const { act, data } = useBackend(); const iconProps = {}; if (flipIcon) { @@ -97,8 +97,8 @@ const ComboKnob = (props, context) => { ); }; -export const HypertorusSecondaryControls = (props, context) => { - const { act, data } = useBackend(context); +export const HypertorusSecondaryControls = (props) => { + const { act, data } = useBackend(); return (
@@ -161,8 +161,8 @@ export const HypertorusSecondaryControls = (props, context) => { ); }; -export const HypertorusWasteRemove = (props, context) => { - const { act, data } = useBackend(context); +export const HypertorusWasteRemove = (props) => { + const { act, data } = useBackend(); const filterTypes = data.filter_types || []; return (
diff --git a/tgui/packages/tgui/interfaces/Hypertorus/Gases.js b/tgui/packages/tgui/interfaces/Hypertorus/Gases.js index 46adf4658ed6..a03712295237 100644 --- a/tgui/packages/tgui/interfaces/Hypertorus/Gases.js +++ b/tgui/packages/tgui/interfaces/Hypertorus/Gases.js @@ -49,8 +49,8 @@ const ensure_gases = (gas_array, gasids) => { } }; -const GasList = (props, context) => { - const { act, data } = useBackend(context); +const GasList = (props) => { + const { act, data } = useBackend(); const { input_max, input_min, @@ -128,8 +128,8 @@ const GasList = (props, context) => { ); }; -export const HypertorusGases = (props, context) => { - const { data } = useBackend(context); +export const HypertorusGases = (props) => { + const { data } = useBackend(); const { fusion_gases, moderator_gases } = data; diff --git a/tgui/packages/tgui/interfaces/Hypertorus/Parameters.js b/tgui/packages/tgui/interfaces/Hypertorus/Parameters.js index 3408a21df1fb..b02e1405b99f 100644 --- a/tgui/packages/tgui/interfaces/Hypertorus/Parameters.js +++ b/tgui/packages/tgui/interfaces/Hypertorus/Parameters.js @@ -13,8 +13,8 @@ import { formatSiUnit } from '../../format'; * relevant levels. */ -export const HypertorusParameters = (props, context) => { - const { data } = useBackend(context); +export const HypertorusParameters = (props) => { + const { data } = useBackend(); const { heat_output, heat_output_min, heat_output_max } = data; diff --git a/tgui/packages/tgui/interfaces/Hypertorus/Temperatures.js b/tgui/packages/tgui/interfaces/Hypertorus/Temperatures.js index 778bbf539a73..fdff317469a7 100644 --- a/tgui/packages/tgui/interfaces/Hypertorus/Temperatures.js +++ b/tgui/packages/tgui/interfaces/Hypertorus/Temperatures.js @@ -58,8 +58,8 @@ const BarLabel = (props) => { ); }; -export const HypertorusTemperatures = (props, context) => { - const { data } = useBackend(context); +export const HypertorusTemperatures = (props) => { + const { data } = useBackend(); const { power_level, diff --git a/tgui/packages/tgui/interfaces/Hypertorus/index.js b/tgui/packages/tgui/interfaces/Hypertorus/index.js index 7cbaf28328ef..52fd3b0ac6ca 100644 --- a/tgui/packages/tgui/interfaces/Hypertorus/index.js +++ b/tgui/packages/tgui/interfaces/Hypertorus/index.js @@ -7,8 +7,8 @@ import { HypertorusParameters } from './Parameters'; import { HypertorusRecipes } from './Recipes'; import { HypertorusTemperatures } from './Temperatures'; -const HypertorusMainControls = (props, context) => { - const { act, data } = useBackend(context); +const HypertorusMainControls = (props) => { + const { act, data } = useBackend(); return (
@@ -81,7 +81,7 @@ const HypertorusLayout = () => { ); }; -export const Hypertorus = (props, context) => { +export const Hypertorus = (props) => { // The HFR has a ridiculous amount of knobs and information. // Ideally we'd display a large window for it all... const idealWidth = 850, diff --git a/tgui/packages/tgui/interfaces/HypnoChair.js b/tgui/packages/tgui/interfaces/HypnoChair.js index cb95eb886e64..19d311139522 100644 --- a/tgui/packages/tgui/interfaces/HypnoChair.js +++ b/tgui/packages/tgui/interfaces/HypnoChair.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Button, Icon, Input, LabeledList, Section } from '../components'; import { Window } from '../layouts'; -export const HypnoChair = (props, context) => { - const { act, data } = useBackend(context); +export const HypnoChair = (props) => { + const { act, data } = useBackend(); return ( diff --git a/tgui/packages/tgui/interfaces/IVDrip.js b/tgui/packages/tgui/interfaces/IVDrip.js index 1a538ed148bf..2a1777d4669e 100644 --- a/tgui/packages/tgui/interfaces/IVDrip.js +++ b/tgui/packages/tgui/interfaces/IVDrip.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Box, Button, NumberInput, LabeledList, Section } from '../components'; import { Window } from '../layouts'; -export const IVDrip = (props, context) => { - const { act, data } = useBackend(context); +export const IVDrip = (props) => { + const { act, data } = useBackend(); const { transferRate, injectOnly, diff --git a/tgui/packages/tgui/interfaces/ImplantChair.js b/tgui/packages/tgui/interfaces/ImplantChair.js index fda82defa35c..cdc6bd9d1ae6 100644 --- a/tgui/packages/tgui/interfaces/ImplantChair.js +++ b/tgui/packages/tgui/interfaces/ImplantChair.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Button, Icon, LabeledList, Section } from '../components'; import { Window } from '../layouts'; -export const ImplantChair = (props, context) => { - const { act, data } = useBackend(context); +export const ImplantChair = (props) => { + const { act, data } = useBackend(); return ( diff --git a/tgui/packages/tgui/interfaces/InfraredEmitter.js b/tgui/packages/tgui/interfaces/InfraredEmitter.js index fb8934043994..7abc089c22bc 100644 --- a/tgui/packages/tgui/interfaces/InfraredEmitter.js +++ b/tgui/packages/tgui/interfaces/InfraredEmitter.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Button, Section, LabeledList } from '../components'; import { Window } from '../layouts'; -export const InfraredEmitter = (props, context) => { - const { act, data } = useBackend(context); +export const InfraredEmitter = (props) => { + const { act, data } = useBackend(); const { on, visible } = data; return ( diff --git a/tgui/packages/tgui/interfaces/IntegratedCircuit/BasicInput.js b/tgui/packages/tgui/interfaces/IntegratedCircuit/BasicInput.js index 4cc9de3e576c..74cc9a2157f6 100644 --- a/tgui/packages/tgui/interfaces/IntegratedCircuit/BasicInput.js +++ b/tgui/packages/tgui/interfaces/IntegratedCircuit/BasicInput.js @@ -1,6 +1,6 @@ import { Stack, Button } from '../../components'; -export const BasicInput = (props, context) => { +export const BasicInput = (props) => { const { children, name, setValue, defaultValue, value } = props; return ( (value !== null && ( diff --git a/tgui/packages/tgui/interfaces/IntegratedCircuit/CircuitInfo.js b/tgui/packages/tgui/interfaces/IntegratedCircuit/CircuitInfo.js index 99513cf42490..7e932c0eb9e2 100644 --- a/tgui/packages/tgui/interfaces/IntegratedCircuit/CircuitInfo.js +++ b/tgui/packages/tgui/interfaces/IntegratedCircuit/CircuitInfo.js @@ -1,6 +1,6 @@ import { Button, Stack, Box } from '../../components'; -export const CircuitInfo = (props, context) => { +export const CircuitInfo = (props) => { const { name, desc, notices, ...rest } = props; return ( diff --git a/tgui/packages/tgui/interfaces/IntegratedCircuit/Connections.js b/tgui/packages/tgui/interfaces/IntegratedCircuit/Connections.js index 41abdcc36824..5e7d88eb6388 100644 --- a/tgui/packages/tgui/interfaces/IntegratedCircuit/Connections.js +++ b/tgui/packages/tgui/interfaces/IntegratedCircuit/Connections.js @@ -2,7 +2,7 @@ import { CSS_COLORS } from '../../constants'; import { SVG_CURVE_INTENSITY } from './constants'; import { classes } from '../../../common/react'; -export const Connections = (props, context) => { +export const Connections = (props) => { const { connections } = props; const isColorClass = (str) => { diff --git a/tgui/packages/tgui/interfaces/IntegratedCircuit/DisplayName.js b/tgui/packages/tgui/interfaces/IntegratedCircuit/DisplayName.js index f0cd2351f9c0..41ca890c6d33 100644 --- a/tgui/packages/tgui/interfaces/IntegratedCircuit/DisplayName.js +++ b/tgui/packages/tgui/interfaces/IntegratedCircuit/DisplayName.js @@ -4,7 +4,7 @@ import { DATATYPE_DISPLAY_HANDLERS, } from './FundamentalTypes'; -export const DisplayName = (props, context) => { +export const DisplayName = (props) => { const { port, isOutput, componentId, portIndex, act, ...rest } = props; const InputComponent = FUNDAMENTAL_DATA_TYPES[port.type || 'unknown']; diff --git a/tgui/packages/tgui/interfaces/IntegratedCircuit/FundamentalTypes.js b/tgui/packages/tgui/interfaces/IntegratedCircuit/FundamentalTypes.js index 64c57528523a..e6e3cf967570 100644 --- a/tgui/packages/tgui/interfaces/IntegratedCircuit/FundamentalTypes.js +++ b/tgui/packages/tgui/interfaces/IntegratedCircuit/FundamentalTypes.js @@ -3,7 +3,7 @@ import { NumberInput, Button, Stack, Input, Dropdown } from '../../components'; import { OPTION_DROPDOWN_LARGE_CHAR_AMOUNT } from './constants'; export const FUNDAMENTAL_DATA_TYPES = { - string: (props, context) => { + string: (props) => { const { name, value, setValue, color } = props; return ( @@ -16,7 +16,7 @@ export const FUNDAMENTAL_DATA_TYPES = { ); }, - number: (props, context) => { + number: (props) => { const { name, value, setValue, color } = props; return ( ); }, - entity: (props, context) => { + entity: (props) => { const { name, setValue } = props; return (
); -const LockedModule = (props, context) => { - const { act, data } = useBackend(context); +const LockedModule = (props) => { + const { act, data } = useBackend(); return ( @@ -261,7 +261,7 @@ const LockedModule = (props, context) => { ); }; -const ConfigureScreen = (props, context) => { +const ConfigureScreen = (props) => { const { configuration_data, module_ref } = props; const configuration_keys = Object.keys(configuration_data); return ( @@ -310,8 +310,8 @@ const displayText = (param) => { } }; -const ParametersSection = (props, context) => { - const { act, data } = useBackend(context); +const ParametersSection = (props) => { + const { act, data } = useBackend(); const { active, malfunctioning, @@ -390,8 +390,8 @@ const ParametersSection = (props, context) => { ); }; -const HardwareSection = (props, context) => { - const { act, data } = useBackend(context); +const HardwareSection = (props) => { + const { act, data } = useBackend(); const { active, control, @@ -443,8 +443,8 @@ const HardwareSection = (props, context) => { ); }; -const InfoSection = (props, context) => { - const { act, data } = useBackend(context); +const InfoSection = (props) => { + const { act, data } = useBackend(); const { active, modules } = data; const info_modules = modules.filter((module) => !!module.id); @@ -466,11 +466,10 @@ const InfoSection = (props, context) => { ); }; -const ModuleSection = (props, context) => { - const { act, data } = useBackend(context); +const ModuleSection = (props) => { + const { act, data } = useBackend(); const { complexity_max, modules } = data; const [configureState, setConfigureState] = useLocalState( - context, 'module_configuration', null, ); @@ -601,8 +600,8 @@ const ModuleSection = (props, context) => { ); }; -export const MODsuit = (props, context) => { - const { act, data } = useBackend(context); +export const MODsuit = (props) => { + const { act, data } = useBackend(); const { ui_theme, interface_break } = data; return ( { - const { act, data } = useBackend(context); +export const MafiaPanel = (props) => { + const { act, data } = useBackend(); const { actions, phase, roleinfo, role_theme, admin_controls } = data; return ( @@ -84,8 +84,8 @@ export const MafiaPanel = (props, context) => { ); }; -const MafiaLobby = (props, context) => { - const { act, data } = useBackend(context); +const MafiaLobby = (props) => { + const { act, data } = useBackend(); const { lobbydata, phase, timeleft } = data; const readyGhosts = lobbydata ? lobbydata.filter((player) => player.status === 'Ready') @@ -144,8 +144,8 @@ const MafiaLobby = (props, context) => { ); }; -const MafiaRole = (props, context) => { - const { act, data } = useBackend(context); +const MafiaRole = (props) => { + const { act, data } = useBackend(); const { phase, roleinfo, timeleft } = data; return (
{ ); }; -const MafiaListOfRoles = (props, context) => { - const { act, data } = useBackend(context); +const MafiaListOfRoles = (props) => { + const { act, data } = useBackend(); const { all_roles } = data; return (
{ ); }; -const MafiaJudgement = (props, context) => { - const { act, data } = useBackend(context); +const MafiaJudgement = (props) => { + const { act, data } = useBackend(); const { judgement_phase } = data; return (
{ ); }; -const MafiaPlayers = (props, context) => { - const { act, data } = useBackend(context); +const MafiaPlayers = (props) => { + const { act, data } = useBackend(); const { players } = data; return (
@@ -354,8 +354,8 @@ const MafiaPlayers = (props, context) => { ); }; -const MafiaAdmin = (props, context) => { - const { act, data } = useBackend(context); +const MafiaAdmin = (props) => { + const { act, data } = useBackend(); return (
diff --git a/tgui/packages/tgui/interfaces/MalfunctionModulePicker.js b/tgui/packages/tgui/interfaces/MalfunctionModulePicker.js index 2bfe5988a920..7ffc12400b4d 100644 --- a/tgui/packages/tgui/interfaces/MalfunctionModulePicker.js +++ b/tgui/packages/tgui/interfaces/MalfunctionModulePicker.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Window } from '../layouts'; import { GenericUplink } from './Uplink/GenericUplink'; -export const MalfunctionModulePicker = (props, context) => { - const { act, data } = useBackend(context); +export const MalfunctionModulePicker = (props) => { + const { act, data } = useBackend(); const { processingTime, categories } = data; const categoriesList = []; diff --git a/tgui/packages/tgui/interfaces/MassDriverControl.js b/tgui/packages/tgui/interfaces/MassDriverControl.js index 1bc132a9e322..91e7cc04d301 100644 --- a/tgui/packages/tgui/interfaces/MassDriverControl.js +++ b/tgui/packages/tgui/interfaces/MassDriverControl.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Box, Button, Section, LabeledList, NumberInput } from '../components'; import { Window } from '../layouts'; -export const MassDriverControl = (props, context) => { - const { act, data } = useBackend(context); +export const MassDriverControl = (props) => { + const { act, data } = useBackend(); const { connected, minutes, seconds, timing, power, poddoor } = data; return ( diff --git a/tgui/packages/tgui/interfaces/MechBayPowerConsole.js b/tgui/packages/tgui/interfaces/MechBayPowerConsole.js index 630e11dbabcb..94b102d0fc68 100644 --- a/tgui/packages/tgui/interfaces/MechBayPowerConsole.js +++ b/tgui/packages/tgui/interfaces/MechBayPowerConsole.js @@ -9,8 +9,8 @@ import { } from '../components'; import { Window } from '../layouts'; -export const MechBayPowerConsole = (props, context) => { - const { act, data } = useBackend(context); +export const MechBayPowerConsole = (props) => { + const { act, data } = useBackend(); const { recharge_port } = data; const mech = recharge_port && recharge_port.mech; const cell = mech && mech.cell; diff --git a/tgui/packages/tgui/interfaces/Mecha/AlertPane.tsx b/tgui/packages/tgui/interfaces/Mecha/AlertPane.tsx index 23896fad2234..3e97eb3a50a8 100644 --- a/tgui/packages/tgui/interfaces/Mecha/AlertPane.tsx +++ b/tgui/packages/tgui/interfaces/Mecha/AlertPane.tsx @@ -6,8 +6,8 @@ import { InternalDamageToNormalDesc, } from './data'; -export const AlertPane = (props, context) => { - const { act, data } = useBackend(context); +export const AlertPane = (props) => { + const { act, data } = useBackend(); const { internal_damage, internal_damage_keys } = data; return ( diff --git a/tgui/packages/tgui/interfaces/Mecha/ArmPane.tsx b/tgui/packages/tgui/interfaces/Mecha/ArmPane.tsx index 90244ef93863..f72b8d3adaef 100644 --- a/tgui/packages/tgui/interfaces/Mecha/ArmPane.tsx +++ b/tgui/packages/tgui/interfaces/Mecha/ArmPane.tsx @@ -9,8 +9,8 @@ import { } from '../../components'; import { MechWeapon, OperatorData } from './data'; -export const ArmPane = (props: { weapon: MechWeapon }, context) => { - const { act, data } = useBackend(context); +export const ArmPane = (props: { weapon: MechWeapon }) => { + const { act, data } = useBackend(); const { name, desc, integrity, energy_per_use } = props.weapon; const { power_level } = data; return ( @@ -72,8 +72,8 @@ export const ArmPane = (props: { weapon: MechWeapon }, context) => { ); }; -const BallisticStats = (props: { weapon: MechWeapon }, context) => { - const { act, data } = useBackend(context); +const BallisticStats = (props: { weapon: MechWeapon }) => { + const { act, data } = useBackend(); const { isballisticweapon, disabledreload, @@ -123,7 +123,7 @@ const MECHA_SNOWFLAKE_ID_SYRINGE = 'syringe_snowflake'; const MECHA_SNOWFLAKE_ID_MODE = 'mode_snowflake'; // Handles all the snowflake buttons and whatever -const Snowflake = (props: { weapon: MechWeapon }, context) => { +const Snowflake = (props: { weapon: MechWeapon }) => { const { snowflake } = props.weapon; switch (snowflake['snowflake_id']) { case MECHA_SNOWFLAKE_ID_SLEEPER: @@ -137,8 +137,8 @@ const Snowflake = (props: { weapon: MechWeapon }, context) => { } }; -const SnowflakeSleeper = (props: { weapon: MechWeapon }, context) => { - const { act, data } = useBackend(context); +const SnowflakeSleeper = (props: { weapon: MechWeapon }) => { + const { act, data } = useBackend(); const { patient } = props.weapon.snowflake; if (!patient) { return null; @@ -187,8 +187,8 @@ const SnowflakeSleeper = (props: { weapon: MechWeapon }, context) => { } }; -const SnowflakeSyringe = (props: { weapon: MechWeapon }, context) => { - const { act, data } = useBackend(context); +const SnowflakeSyringe = (props: { weapon: MechWeapon }) => { + const { act, data } = useBackend(); const { mode, syringe, max_syringe, reagents, total_reagents } = props.weapon.snowflake; return ( @@ -227,7 +227,7 @@ const SnowflakeSyringe = (props: { weapon: MechWeapon }, context) => { ); }; -const SnowflakeExtinguisher = (props: { weapon: MechWeapon }, context) => { +const SnowflakeExtinguisher = (props: { weapon: MechWeapon }) => { const { reagents, total_reagents } = props.weapon.snowflake; return (
@@ -240,8 +240,8 @@ const SnowflakeExtinguisher = (props: { weapon: MechWeapon }, context) => { ); }; -const SnowflakeMode = (props: { weapon: MechWeapon }, context) => { - const { act, data } = useBackend(context); +const SnowflakeMode = (props: { weapon: MechWeapon }) => { + const { act, data } = useBackend(); const { mode, name } = props.weapon.snowflake; return (
diff --git a/tgui/packages/tgui/interfaces/Mecha/ArmorPane.tsx b/tgui/packages/tgui/interfaces/Mecha/ArmorPane.tsx index 3bdec05047b8..79c92f2db546 100644 --- a/tgui/packages/tgui/interfaces/Mecha/ArmorPane.tsx +++ b/tgui/packages/tgui/interfaces/Mecha/ArmorPane.tsx @@ -3,8 +3,8 @@ import { Stack, Button, Box } from '../../components'; import { OperatorData } from './data'; import { classes } from 'common/react'; -export const ArmorPane = (props, context) => { - const { act, data } = useBackend(context); +export const ArmorPane = (props) => { + const { act, data } = useBackend(); const { mech_equipment } = data; return ( diff --git a/tgui/packages/tgui/interfaces/Mecha/MaintMode.tsx b/tgui/packages/tgui/interfaces/Mecha/MaintMode.tsx index 30602a1b04f3..fff6e9fb9f7b 100644 --- a/tgui/packages/tgui/interfaces/Mecha/MaintMode.tsx +++ b/tgui/packages/tgui/interfaces/Mecha/MaintMode.tsx @@ -17,12 +17,8 @@ const MECHA_MAINT_PANELS = { }, }; -export const MaintMode = (props, context) => { - const [screen, setPanel] = useLocalState( - context, - 'screen', - MECHA_MAINT_PANELS.main, - ); +export const MaintMode = (props) => { + const [screen, setPanel] = useLocalState('screen', MECHA_MAINT_PANELS.main); const Component = screen.component(); return ( @@ -47,13 +43,9 @@ export const MaintMode = (props, context) => { ); }; -const MainPanel = (props, context) => { - const { act, data } = useBackend(context); - const [screen, setPanel] = useLocalState( - context, - 'screen', - MECHA_MAINT_PANELS.main, - ); +const MainPanel = (props) => { + const { act, data } = useBackend(); + const [screen, setPanel] = useLocalState('screen', MECHA_MAINT_PANELS.main); const { mecha_flags, mechflag_keys } = data; return ( @@ -78,13 +70,9 @@ const MainPanel = (props, context) => { ); }; -const MaintEnabled = (props, context) => { - const { act, data } = useBackend(context); - const [screen, setPanel] = useLocalState( - context, - 'screen', - MECHA_MAINT_PANELS.main, - ); +const MaintEnabled = (props) => { + const { act, data } = useBackend(); + const [screen, setPanel] = useLocalState('screen', MECHA_MAINT_PANELS.main); return ( <> @@ -127,8 +115,8 @@ const MaintEnabled = (props, context) => { ); }; -const StockPartsPanel = (props, context) => { - const { act, data } = useBackend(context); +const StockPartsPanel = (props) => { + const { act, data } = useBackend(); const { cell, scanning, capacitor } = data; return ( @@ -184,8 +172,8 @@ const StockPartsPanel = (props, context) => { ); }; -const AccessPanel = (props, context) => { - const { act, data } = useBackend(context); +const AccessPanel = (props) => { + const { act, data } = useBackend(); const { idcard_access, operation_req_access } = data; return ( diff --git a/tgui/packages/tgui/interfaces/Mecha/MechStatPane.tsx b/tgui/packages/tgui/interfaces/Mecha/MechStatPane.tsx index 9b75a7233813..f63f71abcc39 100644 --- a/tgui/packages/tgui/interfaces/Mecha/MechStatPane.tsx +++ b/tgui/packages/tgui/interfaces/Mecha/MechStatPane.tsx @@ -10,8 +10,8 @@ import { import { KelvinZeroCelcius, OperatorData } from './data'; import { toFixed } from 'common/math'; -export const MechStatPane = (props, context) => { - const { act, data } = useBackend(context); +export const MechStatPane = (props) => { + const { act, data } = useBackend(); const { name, integrity, @@ -127,8 +127,8 @@ const GetTempFormat = (temp) => { ); }; -const EnviromentalAir = (props, context) => { - const { act, data } = useBackend(context); +const EnviromentalAir = (props) => { + const { act, data } = useBackend(); const { airtank_pressure, airtank_temp } = data; if (airtank_temp === null) { return No air tank detected; @@ -146,8 +146,8 @@ const EnviromentalAir = (props, context) => { } }; -const DNABody = (props, context) => { - const { act, data } = useBackend(context); +const DNABody = (props) => { + const { act, data } = useBackend(); const { dna_lock } = data; if (dna_lock === null) { return ( @@ -182,8 +182,8 @@ const DNABody = (props, context) => { } }; -const PowerBar = (props, context) => { - const { act, data } = useBackend(context); +const PowerBar = (props) => { + const { act, data } = useBackend(); const { power_level, power_max } = data; if (power_max === null) { return ; diff --git a/tgui/packages/tgui/interfaces/Mecha/OperatorMode.tsx b/tgui/packages/tgui/interfaces/Mecha/OperatorMode.tsx index 015ce1de6132..f36247b9297c 100644 --- a/tgui/packages/tgui/interfaces/Mecha/OperatorMode.tsx +++ b/tgui/packages/tgui/interfaces/Mecha/OperatorMode.tsx @@ -9,8 +9,8 @@ import { UtilityModulesPane } from './UtilityModulesPane'; import { PowerModulesPane } from './PowerModulesPane'; import { ArmPane } from './ArmPane'; -export const OperatorMode = (props, context) => { - const { act, data } = useBackend(context); +export const OperatorMode = (props) => { + const { act, data } = useBackend(); const { left_arm_weapon, right_arm_weapon, mech_view } = data; return ( diff --git a/tgui/packages/tgui/interfaces/Mecha/PowerModulesPane.tsx b/tgui/packages/tgui/interfaces/Mecha/PowerModulesPane.tsx index 763c7d81a8e9..413b079b3f57 100644 --- a/tgui/packages/tgui/interfaces/Mecha/PowerModulesPane.tsx +++ b/tgui/packages/tgui/interfaces/Mecha/PowerModulesPane.tsx @@ -3,8 +3,8 @@ import { Button, LabeledList } from '../../components'; import { OperatorData } from './data'; import { toFixed } from 'common/math'; -export const PowerModulesPane = (props, context) => { - const { act, data } = useBackend(context); +export const PowerModulesPane = (props) => { + const { act, data } = useBackend(); const { mech_equipment, mineral_material_amount } = data; return ( diff --git a/tgui/packages/tgui/interfaces/Mecha/RadioPane.tsx b/tgui/packages/tgui/interfaces/Mecha/RadioPane.tsx index ac9fb530582f..038cf7c87071 100644 --- a/tgui/packages/tgui/interfaces/Mecha/RadioPane.tsx +++ b/tgui/packages/tgui/interfaces/Mecha/RadioPane.tsx @@ -3,8 +3,8 @@ import { Button, NumberInput, LabeledList } from '../../components'; import { OperatorData } from './data'; import { toFixed } from 'common/math'; -export const RadioPane = (props, context) => { - const { act, data } = useBackend(context); +export const RadioPane = (props) => { + const { act, data } = useBackend(); const { microphone, speaker, minfreq, maxfreq, frequency } = data.mech_electronics; return ( diff --git a/tgui/packages/tgui/interfaces/Mecha/UtilityModulesPane.tsx b/tgui/packages/tgui/interfaces/Mecha/UtilityModulesPane.tsx index 5ddad376e218..0b245ac66224 100644 --- a/tgui/packages/tgui/interfaces/Mecha/UtilityModulesPane.tsx +++ b/tgui/packages/tgui/interfaces/Mecha/UtilityModulesPane.tsx @@ -2,8 +2,8 @@ import { useBackend } from '../../backend'; import { Button, LabeledList, ProgressBar } from '../../components'; import { OperatorData, MechaUtility } from './data'; -export const UtilityModulesPane = (props, context) => { - const { act, data } = useBackend(context); +export const UtilityModulesPane = (props) => { + const { act, data } = useBackend(); const { mech_equipment } = data; return ( @@ -44,7 +44,7 @@ const MECHA_SNOWFLAKE_ID_EJECTOR = 'ejector_snowflake'; const MECHA_SNOWFLAKE_ID_EXTINGUISHER = 'extinguisher_snowflake'; // Handles all the snowflake buttons and whatever -const Snowflake = (props: { module: MechaUtility }, context) => { +const Snowflake = (props: { module: MechaUtility }) => { const { snowflake } = props.module; switch (snowflake['snowflake_id']) { case MECHA_SNOWFLAKE_ID_EJECTOR: @@ -56,8 +56,8 @@ const Snowflake = (props: { module: MechaUtility }, context) => { } }; -const SnowflakeEjector = (props: { module: MechaUtility }, context) => { - const { act, data } = useBackend(context); +const SnowflakeEjector = (props: { module: MechaUtility }) => { + const { act, data } = useBackend(); const { cargo } = props.module.snowflake; return ( @@ -80,8 +80,8 @@ const SnowflakeEjector = (props: { module: MechaUtility }, context) => { ); }; -const SnowflakeExtinguisher = (props: { module: MechaUtility }, context) => { - const { act, data } = useBackend(context); +const SnowflakeExtinguisher = (props: { module: MechaUtility }) => { + const { act, data } = useBackend(); return ( <> { - const { data } = useBackend(context); +export const Mecha = (props) => { + const { data } = useBackend(); if (data.isoperator) { return ( diff --git a/tgui/packages/tgui/interfaces/MechpadConsole.js b/tgui/packages/tgui/interfaces/MechpadConsole.js index 93d5d1732598..65d2c1f6678d 100644 --- a/tgui/packages/tgui/interfaces/MechpadConsole.js +++ b/tgui/packages/tgui/interfaces/MechpadConsole.js @@ -10,9 +10,9 @@ import { } from '../components'; import { Window } from '../layouts'; -export const MechpadControl = (props, context) => { +export const MechpadControl = (props) => { const { topLevel } = props; - const { act, data } = useBackend(context); + const { act, data } = useBackend(); const { pad_name, connected_mechpad } = data; return (
{ ); }; -export const MechpadConsole = (props, context) => { - const { act, data } = useBackend(context); +export const MechpadConsole = (props) => { + const { act, data } = useBackend(); const { mechpads = [], selected_id } = data; return ( diff --git a/tgui/packages/tgui/interfaces/MedicalKiosk.js b/tgui/packages/tgui/interfaces/MedicalKiosk.js index 6ebaeda8abe5..030b0ec55c8a 100644 --- a/tgui/packages/tgui/interfaces/MedicalKiosk.js +++ b/tgui/packages/tgui/interfaces/MedicalKiosk.js @@ -13,9 +13,9 @@ import { } from '../components'; import { Window } from '../layouts'; -export const MedicalKiosk = (props, context) => { - const { act, data } = useBackend(context); - const [scanIndex] = useSharedState(context, 'scanIndex'); +export const MedicalKiosk = (props) => { + const { act, data } = useBackend(); + const [scanIndex] = useSharedState('scanIndex'); const { active_status_1, active_status_2, active_status_3, active_status_4 } = data; return ( @@ -73,10 +73,10 @@ export const MedicalKiosk = (props, context) => { ); }; -const MedicalKioskScanButton = (props, context) => { +const MedicalKioskScanButton = (props) => { const { index, name, description, icon } = props; - const { act, data } = useBackend(context); - const [scanIndex, setScanIndex] = useSharedState(context, 'scanIndex'); + const { act, data } = useBackend(); + const [scanIndex, setScanIndex] = useSharedState('scanIndex'); const paid = data[`active_status_${index}`]; return ( @@ -106,8 +106,8 @@ const MedicalKioskScanButton = (props, context) => { ); }; -const MedicalKioskInstructions = (props, context) => { - const { act, data } = useBackend(context); +const MedicalKioskInstructions = (props) => { + const { act, data } = useBackend(); const { kiosk_cost, patient_name } = data; return (
@@ -135,8 +135,8 @@ const MedicalKioskInstructions = (props, context) => { ); }; -const MedicalKioskScanResults1 = (props, context) => { - const { data } = useBackend(context); +const MedicalKioskScanResults1 = (props) => { + const { data } = useBackend(); const { patient_health, brute_health, @@ -178,8 +178,8 @@ const MedicalKioskScanResults1 = (props, context) => { ); }; -const MedicalKioskScanResults2 = (props, context) => { - const { data } = useBackend(context); +const MedicalKioskScanResults2 = (props) => { + const { data } = useBackend(); const { patient_status, patient_illness, @@ -218,8 +218,8 @@ const MedicalKioskScanResults2 = (props, context) => { ); }; -const MedicalKioskScanResults3 = (props, context) => { - const { data } = useBackend(context); +const MedicalKioskScanResults3 = (props) => { + const { data } = useBackend(); const { clone_health, brain_damage, brain_health, trauma_status } = data; return (
@@ -246,8 +246,8 @@ const MedicalKioskScanResults3 = (props, context) => { ); }; -const MedicalKioskScanResults4 = (props, context) => { - const { data } = useBackend(context); +const MedicalKioskScanResults4 = (props) => { + const { data } = useBackend(); const { chemical_list = [], overdose_list = [], diff --git a/tgui/packages/tgui/interfaces/MemoryPanel.js b/tgui/packages/tgui/interfaces/MemoryPanel.js index 63baeab70dbf..096ce366c5b6 100644 --- a/tgui/packages/tgui/interfaces/MemoryPanel.js +++ b/tgui/packages/tgui/interfaces/MemoryPanel.js @@ -10,8 +10,8 @@ const STORY_VALUE_OKAY = 3; const STORY_VALUE_AMAZING = 4; // STORY_VALUE_LEGENDARY = 5; (not actually used) -const MemoryQuality = (props, context) => { - const { act } = useBackend(context); +const MemoryQuality = (props) => { + const { act } = useBackend(); const { quality } = props; if (quality === STORY_VALUE_SHIT) { @@ -103,8 +103,8 @@ const MemoryQuality = (props, context) => { ); }; -export const MemoryPanel = (props, context) => { - const { act, data } = useBackend(context); +export const MemoryPanel = (props) => { + const { act, data } = useBackend(); const memories = data.memories || []; return ( diff --git a/tgui/packages/tgui/interfaces/Microscope.js b/tgui/packages/tgui/interfaces/Microscope.js index dca6fda0806b..c71e01aac681 100644 --- a/tgui/packages/tgui/interfaces/Microscope.js +++ b/tgui/packages/tgui/interfaces/Microscope.js @@ -2,9 +2,9 @@ import { useBackend, useSharedState } from '../backend'; import { Button, LabeledList, NoticeBox, Section, Tabs } from '../components'; import { Window } from '../layouts'; -export const Microscope = (props, context) => { - const { act, data } = useBackend(context); - const [tab, setTab] = useSharedState(context, 'tab', 1); +export const Microscope = (props) => { + const { act, data } = useBackend(); + const [tab, setTab] = useSharedState('tab', 1); const { has_dish, cell_lines = [], viruses = [] } = data; return ( @@ -46,9 +46,9 @@ export const Microscope = (props, context) => { ); }; -const Organisms = (props, context) => { +const Organisms = (props) => { const { cell_lines } = props; - const { act, data } = useBackend(context); + const { act, data } = useBackend(); if (!cell_lines.length) { return No micro-organisms found; } @@ -77,9 +77,9 @@ const Organisms = (props, context) => { }); }; -const Viruses = (props, context) => { +const Viruses = (props) => { const { viruses } = props; - const { act } = useBackend(context); + const { act } = useBackend(); if (!viruses.length) { return No viruses found; } diff --git a/tgui/packages/tgui/interfaces/MinigamesMenu.js b/tgui/packages/tgui/interfaces/MinigamesMenu.js index 35aea25d4471..bcf0d4ecfd42 100644 --- a/tgui/packages/tgui/interfaces/MinigamesMenu.js +++ b/tgui/packages/tgui/interfaces/MinigamesMenu.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Button, Section, Stack } from '../components'; import { Window } from '../layouts'; -export const MinigamesMenu = (props, context) => { - const { act } = useBackend(context); +export const MinigamesMenu = (props) => { + const { act } = useBackend(); return ( diff --git a/tgui/packages/tgui/interfaces/MiningVendor.js b/tgui/packages/tgui/interfaces/MiningVendor.js index d3721437fe4a..720301470061 100644 --- a/tgui/packages/tgui/interfaces/MiningVendor.js +++ b/tgui/packages/tgui/interfaces/MiningVendor.js @@ -3,8 +3,8 @@ import { useBackend } from '../backend'; import { Box, Button, Section, Table } from '../components'; import { Window } from '../layouts'; -export const MiningVendor = (props, context) => { - const { act, data } = useBackend(context); +export const MiningVendor = (props) => { + const { act, data } = useBackend(); let inventory = [...data.product_records]; return ( diff --git a/tgui/packages/tgui/interfaces/Mule.js b/tgui/packages/tgui/interfaces/Mule.js index e51ade22f40d..be98513e8e8f 100644 --- a/tgui/packages/tgui/interfaces/Mule.js +++ b/tgui/packages/tgui/interfaces/Mule.js @@ -11,8 +11,8 @@ import { import { Window } from '../layouts'; import { InterfaceLockNoticeBox } from './common/InterfaceLockNoticeBox'; -export const Mule = (props, context) => { - const { act, data } = useBackend(context); +export const Mule = (props) => { + const { act, data } = useBackend(); const { on, cell, diff --git a/tgui/packages/tgui/interfaces/Newscaster.js b/tgui/packages/tgui/interfaces/Newscaster.js index 3b2ca2c2a946..e77fdf9e2e6d 100644 --- a/tgui/packages/tgui/interfaces/Newscaster.js +++ b/tgui/packages/tgui/interfaces/Newscaster.js @@ -28,12 +28,11 @@ const CENSOR_MESSAGE = 'This channel has been deemed as threatening to \ the welfare of the station, and marked with a Nanotrasen D-Notice.'; -export const Newscaster = (props, context) => { - const { act, data } = useBackend(context); +export const Newscaster = (props) => { + const { act, data } = useBackend(); const NEWSCASTER_SCREEN = 1; const BOUNTYBOARD_SCREEN = 2; const [screenmode, setScreenmode] = useSharedState( - context, 'tab_main', NEWSCASTER_SCREEN, ); @@ -71,9 +70,9 @@ export const Newscaster = (props, context) => { }; /** The modal menu that contains the prompts to making new channels. */ -const NewscasterChannelCreation = (props, context) => { - const { act, data } = useBackend(context); - const [lockedmode, setLockedmode] = useLocalState(context, 'lockedmode', 1); +const NewscasterChannelCreation = (props) => { + const { act, data } = useBackend(); + const [lockedmode, setLockedmode] = useLocalState('lockedmode', 1); const { creating_channel, name, desc } = data; if (!creating_channel) { return null; @@ -164,8 +163,8 @@ const NewscasterChannelCreation = (props, context) => { }; /** The modal menu that contains the prompts to making new comments. */ -const NewscasterCommentCreation = (props, context) => { - const { act, data } = useBackend(context); +const NewscasterCommentCreation = (props) => { + const { act, data } = useBackend(); const { creating_comment, viewing_message } = data; if (!creating_comment) { return null; @@ -218,8 +217,8 @@ const NewscasterCommentCreation = (props, context) => { ); }; -const NewscasterWantedScreen = (props, context) => { - const { act, data } = useBackend(context); +const NewscasterWantedScreen = (props) => { + const { act, data } = useBackend(); const { viewing_wanted, photo_data, @@ -321,8 +320,8 @@ const NewscasterWantedScreen = (props, context) => { ); }; -const NewscasterContent = (props, context) => { - const { act, data } = useBackend(context); +const NewscasterContent = (props) => { + const { act, data } = useBackend(); const { current_channel = {} } = data; return ( @@ -355,8 +354,8 @@ const NewscasterContent = (props, context) => { }; /** The Channel Box is the basic channel information where buttons live.*/ -const NewscasterChannelBox = (_, context) => { - const { act, data } = useBackend(context); +const NewscasterChannelBox = (_) => { + const { act, data } = useBackend(); const { channelName, channelDesc, @@ -440,8 +439,8 @@ const NewscasterChannelBox = (_, context) => { }; /** Channel select is the left-hand menu where all the channels are listed. */ -const NewscasterChannelSelector = (props, context) => { - const { act, data } = useBackend(context); +const NewscasterChannelSelector = (props) => { + const { act, data } = useBackend(); const { channels = [], viewing_channel, security_mode, wanted = [] } = data; return (
@@ -507,8 +506,8 @@ const processedText = (value) => { }; /** This is where the channels comments get spangled out (tm) */ -const NewscasterChannelMessages = (_, context) => { - const { act, data } = useBackend(context); +const NewscasterChannelMessages = (_) => { + const { act, data } = useBackend(); const { messages = [], viewing_channel, diff --git a/tgui/packages/tgui/interfaces/NoticeBoard.js b/tgui/packages/tgui/interfaces/NoticeBoard.js index 6df894533855..26a672ba3ef8 100644 --- a/tgui/packages/tgui/interfaces/NoticeBoard.js +++ b/tgui/packages/tgui/interfaces/NoticeBoard.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Box, Button, Flex, Section } from '../components'; import { Window } from '../layouts'; -export const NoticeBoard = (props, context) => { - const { act, data } = useBackend(context); +export const NoticeBoard = (props) => { + const { act, data } = useBackend(); const { allowed, items = {} } = data; return ( diff --git a/tgui/packages/tgui/interfaces/NotificationPreferences.js b/tgui/packages/tgui/interfaces/NotificationPreferences.js index 5941acb63657..51b2fa794c01 100644 --- a/tgui/packages/tgui/interfaces/NotificationPreferences.js +++ b/tgui/packages/tgui/interfaces/NotificationPreferences.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Section, Button } from '../components'; import { Window } from '../layouts'; -export const NotificationPreferences = (props, context) => { - const { act, data } = useBackend(context); +export const NotificationPreferences = (props) => { + const { act, data } = useBackend(); const ignoresPreSort = data.ignore || []; const ignores = ignoresPreSort.sort((a, b) => { const descA = a.desc.toLowerCase(); diff --git a/tgui/packages/tgui/interfaces/NtnetRelay.js b/tgui/packages/tgui/interfaces/NtnetRelay.js index f7faa3d00f2a..19c50bba1b5c 100644 --- a/tgui/packages/tgui/interfaces/NtnetRelay.js +++ b/tgui/packages/tgui/interfaces/NtnetRelay.js @@ -8,8 +8,8 @@ import { } from '../components'; import { Window } from '../layouts'; -export const NtnetRelay = (props, context) => { - const { act, data } = useBackend(context); +export const NtnetRelay = (props) => { + const { act, data } = useBackend(); const { enabled, dos_capacity, dos_overload, dos_crashed } = data; return ( diff --git a/tgui/packages/tgui/interfaces/NtosArcade.js b/tgui/packages/tgui/interfaces/NtosArcade.js index 072a8372427b..b8c9aa05109e 100644 --- a/tgui/packages/tgui/interfaces/NtosArcade.js +++ b/tgui/packages/tgui/interfaces/NtosArcade.js @@ -11,8 +11,8 @@ import { } from '../components'; import { NtosWindow } from '../layouts'; -export const NtosArcade = (props, context) => { - const { act, data } = useBackend(context); +export const NtosArcade = (props) => { + const { act, data } = useBackend(); return ( diff --git a/tgui/packages/tgui/interfaces/NtosBountyBoard.js b/tgui/packages/tgui/interfaces/NtosBountyBoard.js index f48810e517e2..adad36a35a56 100644 --- a/tgui/packages/tgui/interfaces/NtosBountyBoard.js +++ b/tgui/packages/tgui/interfaces/NtosBountyBoard.js @@ -1,7 +1,7 @@ import { BountyBoardContent } from './BountyBoard'; import { NtosWindow } from '../layouts'; -export const NtosBountyBoard = (props, context) => { +export const NtosBountyBoard = (props) => { return ( diff --git a/tgui/packages/tgui/interfaces/NtosCard.js b/tgui/packages/tgui/interfaces/NtosCard.js index 59878ba7e146..34fbc683b543 100644 --- a/tgui/packages/tgui/interfaces/NtosCard.js +++ b/tgui/packages/tgui/interfaces/NtosCard.js @@ -13,7 +13,7 @@ import { import { NtosWindow } from '../layouts'; import { AccessList } from './common/AccessList'; -export const NtosCard = (props, context) => { +export const NtosCard = (props) => { return ( @@ -23,8 +23,8 @@ export const NtosCard = (props, context) => { ); }; -export const NtosCardContent = (props, context) => { - const { act, data } = useBackend(context); +export const NtosCardContent = (props) => { + const { act, data } = useBackend(); const { authenticatedUser, regions = [], @@ -48,7 +48,7 @@ export const NtosCardContent = (props, context) => { ); } - const [selectedTab] = useSharedState(context, 'selectedTab', 'login'); + const [selectedTab] = useSharedState('selectedTab', 'login'); return ( <> @@ -115,12 +115,8 @@ export const NtosCardContent = (props, context) => { ); }; -const IDCardTabs = (props, context) => { - const [selectedTab, setSelectedTab] = useSharedState( - context, - 'selectedTab', - 'login', - ); +const IDCardTabs = (props) => { + const [selectedTab, setSelectedTab] = useSharedState('selectedTab', 'login'); return ( @@ -146,8 +142,8 @@ const IDCardTabs = (props, context) => { ); }; -export const IDCardLogin = (props, context) => { - const { act, data } = useBackend(context); +export const IDCardLogin = (props) => { + const { act, data } = useBackend(); const { authenticatedUser, has_id, have_printer, authIDName } = data; return ( @@ -190,8 +186,8 @@ export const IDCardLogin = (props, context) => { ); }; -const IDCardTarget = (props, context) => { - const { act, data } = useBackend(context); +const IDCardTarget = (props) => { + const { act, data } = useBackend(); const { authenticatedUser, id_rank, id_owner, has_id, id_name, id_age } = data; @@ -254,8 +250,8 @@ const IDCardTarget = (props, context) => { ); }; -const TemplateDropdown = (props, context) => { - const { act } = useBackend(context); +const TemplateDropdown = (props) => { + const { act } = useBackend(); const { templates } = props; const templateKeys = Object.keys(templates); diff --git a/tgui/packages/tgui/interfaces/NtosCargo.js b/tgui/packages/tgui/interfaces/NtosCargo.js index b5009c0aeaf5..ae8c9a236230 100644 --- a/tgui/packages/tgui/interfaces/NtosCargo.js +++ b/tgui/packages/tgui/interfaces/NtosCargo.js @@ -1,7 +1,7 @@ import { CargoContent } from './Cargo.js'; import { NtosWindow } from '../layouts'; -export const NtosCargo = (props, context) => { +export const NtosCargo = (props) => { return ( diff --git a/tgui/packages/tgui/interfaces/NtosConfiguration.js b/tgui/packages/tgui/interfaces/NtosConfiguration.js index 1eeb184be5e8..430990a7cf9c 100644 --- a/tgui/packages/tgui/interfaces/NtosConfiguration.js +++ b/tgui/packages/tgui/interfaces/NtosConfiguration.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Box, Button, LabeledList, ProgressBar, Section } from '../components'; import { NtosWindow } from '../layouts'; -export const NtosConfiguration = (props, context) => { - const { act, data } = useBackend(context); +export const NtosConfiguration = (props) => { + const { act, data } = useBackend(); const { PC_device_theme, power_usage, diff --git a/tgui/packages/tgui/interfaces/NtosCrewManifest.js b/tgui/packages/tgui/interfaces/NtosCrewManifest.js index 0c918673accb..fb861af1912a 100644 --- a/tgui/packages/tgui/interfaces/NtosCrewManifest.js +++ b/tgui/packages/tgui/interfaces/NtosCrewManifest.js @@ -10,8 +10,8 @@ import { NtosWindow } from '../layouts'; // Original: entry.rank // {entry.rank === entry.trim ? entry.rank : <>{entry.rank} ({entry.trim})} -export const NtosCrewManifest = (props, context) => { - const { act, data } = useBackend(context); +export const NtosCrewManifest = (props) => { + const { act, data } = useBackend(); const { have_printer, manifest = {} } = data; return ( diff --git a/tgui/packages/tgui/interfaces/NtosCyborgRemoteMonitor.js b/tgui/packages/tgui/interfaces/NtosCyborgRemoteMonitor.js index 2973df10d5fc..24962f2c3bb0 100644 --- a/tgui/packages/tgui/interfaces/NtosCyborgRemoteMonitor.js +++ b/tgui/packages/tgui/interfaces/NtosCyborgRemoteMonitor.js @@ -11,7 +11,7 @@ import { } from '../components'; import { NtosWindow } from '../layouts'; -export const NtosCyborgRemoteMonitor = (props, context) => { +export const NtosCyborgRemoteMonitor = (props) => { return ( @@ -38,9 +38,9 @@ export const ProgressSwitch = (param) => { } }; -export const NtosCyborgRemoteMonitorContent = (props, context) => { - const { act, data } = useBackend(context); - const [tab_main, setTab_main] = useSharedState(context, 'tab_main', 1); +export const NtosCyborgRemoteMonitorContent = (props) => { + const { act, data } = useBackend(); + const [tab_main, setTab_main] = useSharedState('tab_main', 1); const { card, cyborgs = [], DL_progress } = data; const storedlog = data.borglog || []; diff --git a/tgui/packages/tgui/interfaces/NtosCyborgRemoteMonitorSyndicate.js b/tgui/packages/tgui/interfaces/NtosCyborgRemoteMonitorSyndicate.js index 0517f8f80ef3..c3b07b2d4dbc 100644 --- a/tgui/packages/tgui/interfaces/NtosCyborgRemoteMonitorSyndicate.js +++ b/tgui/packages/tgui/interfaces/NtosCyborgRemoteMonitorSyndicate.js @@ -1,7 +1,7 @@ import { NtosWindow } from '../layouts'; import { NtosCyborgRemoteMonitorContent } from './NtosCyborgRemoteMonitor'; -export const NtosCyborgRemoteMonitorSyndicate = (props, context) => { +export const NtosCyborgRemoteMonitorSyndicate = (props) => { return ( diff --git a/tgui/packages/tgui/interfaces/NtosFileManager.js b/tgui/packages/tgui/interfaces/NtosFileManager.js index 79d3d84ed0b3..5c618d953c3a 100644 --- a/tgui/packages/tgui/interfaces/NtosFileManager.js +++ b/tgui/packages/tgui/interfaces/NtosFileManager.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Button, Section, Table } from '../components'; import { NtosWindow } from '../layouts'; -export const NtosFileManager = (props, context) => { - const { act, data } = useBackend(context); +export const NtosFileManager = (props) => { + const { act, data } = useBackend(); const { PC_device_theme, usbconnected, files = [], usbfiles = [] } = data; return ( diff --git a/tgui/packages/tgui/interfaces/NtosGasAnalyzer.tsx b/tgui/packages/tgui/interfaces/NtosGasAnalyzer.tsx index 2ac0a1fd7db1..849262b4152b 100644 --- a/tgui/packages/tgui/interfaces/NtosGasAnalyzer.tsx +++ b/tgui/packages/tgui/interfaces/NtosGasAnalyzer.tsx @@ -1,7 +1,7 @@ import { NtosWindow } from '../layouts'; import { GasAnalyzerContent } from './GasAnalyzer'; -export const NtosGasAnalyzer = (props, context) => { +export const NtosGasAnalyzer = (props) => { return ( diff --git a/tgui/packages/tgui/interfaces/NtosJobManager.js b/tgui/packages/tgui/interfaces/NtosJobManager.js index fe1a8681849a..e02d4a4efa34 100644 --- a/tgui/packages/tgui/interfaces/NtosJobManager.js +++ b/tgui/packages/tgui/interfaces/NtosJobManager.js @@ -2,7 +2,7 @@ import { useBackend } from '../backend'; import { Button, Section, Table, NoticeBox, Dimmer, Box } from '../components'; import { NtosWindow } from '../layouts'; -export const NtosJobManager = (props, context) => { +export const NtosJobManager = (props) => { return ( @@ -12,8 +12,8 @@ export const NtosJobManager = (props, context) => { ); }; -export const NtosJobManagerContent = (props, context) => { - const { act, data } = useBackend(context); +export const NtosJobManagerContent = (props) => { + const { act, data } = useBackend(); const { authed, cooldown, slots = [], prioritized = [] } = data; if (!authed) { return ( diff --git a/tgui/packages/tgui/interfaces/NtosMain.js b/tgui/packages/tgui/interfaces/NtosMain.js index a5c8033e2701..4b2b95aff8d3 100644 --- a/tgui/packages/tgui/interfaces/NtosMain.js +++ b/tgui/packages/tgui/interfaces/NtosMain.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Button, ColorBox, Section, Table } from '../components'; import { NtosWindow } from '../layouts'; -export const NtosMain = (props, context) => { - const { act, data } = useBackend(context); +export const NtosMain = (props) => { + const { act, data } = useBackend(); const { device_theme, show_imprint, diff --git a/tgui/packages/tgui/interfaces/NtosMessenger.js b/tgui/packages/tgui/interfaces/NtosMessenger.js index acbb53e49c88..1b0f12f0f0ad 100644 --- a/tgui/packages/tgui/interfaces/NtosMessenger.js +++ b/tgui/packages/tgui/interfaces/NtosMessenger.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Box, Button, Dimmer, Icon, Section, Stack } from '../components'; import { NtosWindow } from '../layouts'; -const NoIDDimmer = (props, context) => { - const { act, data } = useBackend(context); +const NoIDDimmer = (props) => { + const { act, data } = useBackend(); const { owner } = data; return ( @@ -27,8 +27,8 @@ const NoIDDimmer = (props, context) => { ); }; -export const NtosMessenger = (props, context) => { - const { act, data } = useBackend(context); +export const NtosMessenger = (props) => { + const { act, data } = useBackend(); const { owner, messages = [], diff --git a/tgui/packages/tgui/interfaces/NtosNetChat.js b/tgui/packages/tgui/interfaces/NtosNetChat.js index fc1341c6cfae..5cd37ca0ec55 100644 --- a/tgui/packages/tgui/interfaces/NtosNetChat.js +++ b/tgui/packages/tgui/interfaces/NtosNetChat.js @@ -21,8 +21,8 @@ const STATUS2TEXT = { 2: 'Online', }; -const NoChannelDimmer = (props, context) => { - const { act, data } = useBackend(context); +const NoChannelDimmer = (props) => { + const { act, data } = useBackend(); const { owner } = data; return ( @@ -51,8 +51,8 @@ const NoChannelDimmer = (props, context) => { ); }; -export const NtosNetChat = (props, context) => { - const { act, data } = useBackend(context); +export const NtosNetChat = (props) => { + const { act, data } = useBackend(); const { title, can_admin, diff --git a/tgui/packages/tgui/interfaces/NtosNetDos.js b/tgui/packages/tgui/interfaces/NtosNetDos.js index b83794d790b7..caa9dde2bc99 100644 --- a/tgui/packages/tgui/interfaces/NtosNetDos.js +++ b/tgui/packages/tgui/interfaces/NtosNetDos.js @@ -2,7 +2,7 @@ import { useBackend } from '../backend'; import { Box, Button, LabeledList, NoticeBox, Section } from '../components'; import { NtosWindow } from '../layouts'; -export const NtosNetDos = (props, context) => { +export const NtosNetDos = (props) => { return ( @@ -12,8 +12,8 @@ export const NtosNetDos = (props, context) => { ); }; -export const NtosNetDosContent = (props, context) => { - const { act, data } = useBackend(context); +export const NtosNetDosContent = (props) => { + const { act, data } = useBackend(); const { relays = [], focus, target, speed, overload, capacity, error } = data; diff --git a/tgui/packages/tgui/interfaces/NtosNetDownloader.js b/tgui/packages/tgui/interfaces/NtosNetDownloader.js index f499b9cd04d8..0bfbd4c4e3b1 100644 --- a/tgui/packages/tgui/interfaces/NtosNetDownloader.js +++ b/tgui/packages/tgui/interfaces/NtosNetDownloader.js @@ -15,8 +15,8 @@ import { flow } from 'common/fp'; import { filter, sortBy } from 'common/collections'; import { NtosWindow } from '../layouts'; -export const NtosNetDownloader = (props, context) => { - const { act, data } = useBackend(context); +export const NtosNetDownloader = (props) => { + const { act, data } = useBackend(); const { PC_device_theme, disk_size, @@ -128,9 +128,9 @@ export const NtosNetDownloader = (props, context) => { ); }; -const Program = (props, context) => { +const Program = (props) => { const { program } = props; - const { act, data } = useBackend(context); + const { act, data } = useBackend(); const { PC_device_theme, disk_size, diff --git a/tgui/packages/tgui/interfaces/NtosNetMonitor.js b/tgui/packages/tgui/interfaces/NtosNetMonitor.js index 80f5db87f040..81df280b61a3 100644 --- a/tgui/packages/tgui/interfaces/NtosNetMonitor.js +++ b/tgui/packages/tgui/interfaces/NtosNetMonitor.js @@ -9,8 +9,8 @@ import { } from '../components'; import { NtosWindow } from '../layouts'; -export const NtosNetMonitor = (props, context) => { - const { act, data } = useBackend(context); +export const NtosNetMonitor = (props) => { + const { act, data } = useBackend(); const { ntnetrelays, ntnetstatus, diff --git a/tgui/packages/tgui/interfaces/NtosNewscaster.js b/tgui/packages/tgui/interfaces/NtosNewscaster.js index 3d21bc5463ab..5922315de2ef 100644 --- a/tgui/packages/tgui/interfaces/NtosNewscaster.js +++ b/tgui/packages/tgui/interfaces/NtosNewscaster.js @@ -1,7 +1,7 @@ import { NtosWindow } from '../layouts'; import { Newscaster } from './Newscaster'; -export const NtosNewscaster = (props, context) => { +export const NtosNewscaster = (props) => { return ( diff --git a/tgui/packages/tgui/interfaces/NtosNotepad.js b/tgui/packages/tgui/interfaces/NtosNotepad.js index 34afa8a1c066..7820f8acb67d 100644 --- a/tgui/packages/tgui/interfaces/NtosNotepad.js +++ b/tgui/packages/tgui/interfaces/NtosNotepad.js @@ -2,8 +2,8 @@ import { NtosWindow } from '../layouts'; import { useBackend } from '../backend'; import { Stack, Input, Section } from '../components'; -export const NtosNotepad = (props, context) => { - const { act, data } = useBackend(context); +export const NtosNotepad = (props) => { + const { act, data } = useBackend(); const { note } = data; return ( diff --git a/tgui/packages/tgui/interfaces/NtosPhysScanner.js b/tgui/packages/tgui/interfaces/NtosPhysScanner.js index a01c4e5736b7..982859aa07f7 100644 --- a/tgui/packages/tgui/interfaces/NtosPhysScanner.js +++ b/tgui/packages/tgui/interfaces/NtosPhysScanner.js @@ -3,8 +3,8 @@ import { NtosWindow } from '../layouts'; import { Section, Box, Dropdown } from '../components'; import { sanitizeText } from '../sanitize'; -export const NtosPhysScanner = (props, context) => { - const { act, data } = useBackend(context); +export const NtosPhysScanner = (props) => { + const { act, data } = useBackend(); const { set_mode, last_record, available_modes = [] } = data; const textHtml = { __html: sanitizeText(last_record), diff --git a/tgui/packages/tgui/interfaces/NtosPortraitPrinter.js b/tgui/packages/tgui/interfaces/NtosPortraitPrinter.js index 4e79769422a4..3f0d2c9e6798 100644 --- a/tgui/packages/tgui/interfaces/NtosPortraitPrinter.js +++ b/tgui/packages/tgui/interfaces/NtosPortraitPrinter.js @@ -3,9 +3,9 @@ import { useBackend, useLocalState } from '../backend'; import { Button, NoticeBox, Section, Stack, Input } from '../components'; import { NtosWindow } from '../layouts'; -export const NtosPortraitPrinter = (props, context) => { - const { act, data } = useBackend(context); - const [listIndex, setListIndex] = useLocalState(context, 'listIndex', 0); +export const NtosPortraitPrinter = (props) => { + const { act, data } = useBackend(); + const [listIndex, setListIndex] = useLocalState('listIndex', 0); const { paintings, search_string, search_mode } = data; const got_paintings = !!paintings.length; const current_portrait_title = got_paintings && paintings[listIndex]['title']; diff --git a/tgui/packages/tgui/interfaces/NtosRadar.js b/tgui/packages/tgui/interfaces/NtosRadar.js index 61d7627d648a..5de0449f60fa 100644 --- a/tgui/packages/tgui/interfaces/NtosRadar.js +++ b/tgui/packages/tgui/interfaces/NtosRadar.js @@ -4,7 +4,7 @@ import { useBackend } from '../backend'; import { Box, Button, Flex, Icon, NoticeBox, Section } from '../components'; import { NtosWindow } from '../layouts'; -export const NtosRadar = (props, context) => { +export const NtosRadar = (props) => { return ( @@ -12,8 +12,8 @@ export const NtosRadar = (props, context) => { ); }; -export const NtosRadarContent = (props, context) => { - const { act, data } = useBackend(context); +export const NtosRadarContent = (props) => { + const { act, data } = useBackend(); const { selected, object = [], target = [], scanning } = data; const { sig_err } = props; return ( diff --git a/tgui/packages/tgui/interfaces/NtosRadarSyndicate.js b/tgui/packages/tgui/interfaces/NtosRadarSyndicate.js index b8806d127ca2..0a083b213be5 100644 --- a/tgui/packages/tgui/interfaces/NtosRadarSyndicate.js +++ b/tgui/packages/tgui/interfaces/NtosRadarSyndicate.js @@ -1,7 +1,7 @@ import { NtosWindow } from '../layouts'; import { NtosRadarContent } from './NtosRadar'; -export const NtosRadarSyndicate = (props, context) => { +export const NtosRadarSyndicate = (props) => { return ( diff --git a/tgui/packages/tgui/interfaces/NtosRecords.js b/tgui/packages/tgui/interfaces/NtosRecords.js index 3212c70a42d5..fd690d9f44af 100644 --- a/tgui/packages/tgui/interfaces/NtosRecords.js +++ b/tgui/packages/tgui/interfaces/NtosRecords.js @@ -3,9 +3,9 @@ import { useBackend, useLocalState } from '../backend'; import { Box, Icon, Input, Section } from '../components'; import { NtosWindow } from '../layouts'; -export const NtosRecords = (props, context) => { - const { act, data } = useBackend(context); - const [searchTerm, setSearchTerm] = useLocalState(context, 'search', ''); +export const NtosRecords = (props) => { + const { act, data } = useBackend(); + const [searchTerm, setSearchTerm] = useLocalState('search', ''); const { mode, records } = data; const isMatchingSearchTerms = createSearch(searchTerm); diff --git a/tgui/packages/tgui/interfaces/NtosRevelation.js b/tgui/packages/tgui/interfaces/NtosRevelation.js index f52dfce8a268..2767896b9784 100644 --- a/tgui/packages/tgui/interfaces/NtosRevelation.js +++ b/tgui/packages/tgui/interfaces/NtosRevelation.js @@ -2,8 +2,8 @@ import { Section, Button, LabeledList } from '../components'; import { useBackend } from '../backend'; import { NtosWindow } from '../layouts'; -export const NtosRevelation = (props, context) => { - const { act, data } = useBackend(context); +export const NtosRevelation = (props) => { + const { act, data } = useBackend(); return ( diff --git a/tgui/packages/tgui/interfaces/NtosRoboControl.js b/tgui/packages/tgui/interfaces/NtosRoboControl.js index 304e327cb97d..5a57f63aa69a 100644 --- a/tgui/packages/tgui/interfaces/NtosRoboControl.js +++ b/tgui/packages/tgui/interfaces/NtosRoboControl.js @@ -15,9 +15,9 @@ const getMuleByRef = (mules, ref) => { return mules?.find((mule) => mule.mule_ref === ref); }; -export const NtosRoboControl = (props, context) => { - const { act, data } = useBackend(context); - const [tab_main, setTab_main] = useSharedState(context, 'tab_main', 1); +export const NtosRoboControl = (props) => { + const { act, data } = useBackend(); + const [tab_main, setTab_main] = useSharedState('tab_main', 1); const { bots, drones, id_owner, has_id, droneaccess, dronepingtypes } = data; return ( @@ -94,9 +94,9 @@ export const NtosRoboControl = (props, context) => { ); }; -export const RobotInfo = (props, context) => { +export const RobotInfo = (props) => { const { robot } = props; - const { act, data } = useBackend(context); + const { act, data } = useBackend(); const mules = data.mules || []; // Get a mule object const mule = !!robot.mule_check && getMuleByRef(mules, robot.bot_ref); @@ -292,9 +292,9 @@ export const RobotInfo = (props, context) => { ); }; -export const DroneInfo = (props, context) => { +export const DroneInfo = (props) => { const { drone } = props; - const { act, data } = useBackend(context); + const { act, data } = useBackend(); const color = 'rgba(74, 59, 140, 1)'; return ( diff --git a/tgui/packages/tgui/interfaces/NtosRobotact.js b/tgui/packages/tgui/interfaces/NtosRobotact.js index cb7d4eb64e34..3b6b6fd6d5fd 100644 --- a/tgui/packages/tgui/interfaces/NtosRobotact.js +++ b/tgui/packages/tgui/interfaces/NtosRobotact.js @@ -12,8 +12,8 @@ import { } from '../components'; import { NtosWindow } from '../layouts'; -export const NtosRobotact = (props, context) => { - const { act, data } = useBackend(context); +export const NtosRobotact = (props) => { + const { act, data } = useBackend(); const { PC_device_theme } = data; return ( @@ -24,10 +24,10 @@ export const NtosRobotact = (props, context) => { ); }; -export const NtosRobotactContent = (props, context) => { - const { act, data } = useBackend(context); - const [tab_main, setTab_main] = useSharedState(context, 'tab_main', 1); - const [tab_sub, setTab_sub] = useSharedState(context, 'tab_sub', 1); +export const NtosRobotactContent = (props) => { + const { act, data } = useBackend(); + const [tab_main, setTab_main] = useSharedState('tab_main', 1); + const [tab_sub, setTab_sub] = useSharedState('tab_sub', 1); const { charge, maxcharge, diff --git a/tgui/packages/tgui/interfaces/NtosScipaper.js b/tgui/packages/tgui/interfaces/NtosScipaper.js index fc1ffd603d65..5d7bfdbc8c80 100644 --- a/tgui/packages/tgui/interfaces/NtosScipaper.js +++ b/tgui/packages/tgui/interfaces/NtosScipaper.js @@ -18,7 +18,7 @@ import { import { TableCell, TableRow } from '../components/Table'; import { NtosWindow } from '../layouts'; -export const NtosScipaper = (props, context) => { +export const NtosScipaper = (props) => { return ( @@ -28,8 +28,8 @@ export const NtosScipaper = (props, context) => { ); }; -const PaperPublishing = (props, context) => { - const { act, data } = useBackend(context); +const PaperPublishing = (props) => { + const { act, data } = useBackend(); const { title, author, @@ -221,8 +221,8 @@ const PaperPublishing = (props, context) => { ); }; -const PaperBrowser = (props, context) => { - const { act, data } = useBackend(context); +const PaperBrowser = (props) => { + const { act, data } = useBackend(); const { publishedPapers, coopIndex, fundingIndex } = data; if (publishedPapers.length === 0) { return No Published Papers! ; @@ -262,8 +262,8 @@ const PaperBrowser = (props, context) => { )); } }; -const ExperimentBrowser = (props, context) => { - const { act, data } = useBackend(context); +const ExperimentBrowser = (props) => { + const { act, data } = useBackend(); const { experimentInformation = [] } = data; return experimentInformation.map((experiment) => (
@@ -288,8 +288,8 @@ const ExperimentBrowser = (props, context) => { )); }; -const PartnersBrowser = (props, context) => { - const { act, data } = useBackend(context); +const PartnersBrowser = (props) => { + const { act, data } = useBackend(); const { partnersInformation, coopIndex, @@ -356,8 +356,8 @@ const PartnersBrowser = (props, context) => { )); }; -export const NtosScipaperContent = (props, context) => { - const { act, data } = useBackend(context); +export const NtosScipaperContent = (props) => { + const { act, data } = useBackend(); const { currentTab } = data; return ( <> diff --git a/tgui/packages/tgui/interfaces/NtosSecurEye.js b/tgui/packages/tgui/interfaces/NtosSecurEye.js index d9a591a7b700..d9f1b1f264ca 100644 --- a/tgui/packages/tgui/interfaces/NtosSecurEye.js +++ b/tgui/packages/tgui/interfaces/NtosSecurEye.js @@ -7,8 +7,8 @@ import { CameraConsoleContent, } from './CameraConsole'; -export const NtosSecurEye = (props, context) => { - const { act, data, config } = useBackend(context); +export const NtosSecurEye = (props) => { + const { act, data, config } = useBackend(); const { PC_device_theme, mapRef, activeCamera } = data; const cameras = selectCameras(data.cameras); const [prevCameraName, nextCameraName] = prevNextCamera( diff --git a/tgui/packages/tgui/interfaces/NtosShipping.js b/tgui/packages/tgui/interfaces/NtosShipping.js index 2bcb21cdcf39..6302c77be780 100644 --- a/tgui/packages/tgui/interfaces/NtosShipping.js +++ b/tgui/packages/tgui/interfaces/NtosShipping.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Box, Button, LabeledList, Section } from '../components'; import { NtosWindow } from '../layouts'; -export const NtosShipping = (props, context) => { - const { act, data } = useBackend(context); +export const NtosShipping = (props) => { + const { act, data } = useBackend(); return ( diff --git a/tgui/packages/tgui/interfaces/NtosSignaler.js b/tgui/packages/tgui/interfaces/NtosSignaler.js index 02370dbf9401..e4455fabaa24 100644 --- a/tgui/packages/tgui/interfaces/NtosSignaler.js +++ b/tgui/packages/tgui/interfaces/NtosSignaler.js @@ -1,7 +1,7 @@ import { SignalerContent } from './Signaler'; import { NtosWindow } from '../layouts'; -export const NtosSignaler = (props, context) => { +export const NtosSignaler = (props) => { return ( diff --git a/tgui/packages/tgui/interfaces/NtosSkillTracker.js b/tgui/packages/tgui/interfaces/NtosSkillTracker.js index abb3ec3f0296..e63776a4444a 100644 --- a/tgui/packages/tgui/interfaces/NtosSkillTracker.js +++ b/tgui/packages/tgui/interfaces/NtosSkillTracker.js @@ -9,8 +9,8 @@ import { } from '../components'; import { NtosWindow } from '../layouts'; -export const NtosSkillTracker = (props, context) => { - const { act, data } = useBackend(context); +export const NtosSkillTracker = (props) => { + const { act, data } = useBackend(); const { skills = {} } = data; return ( diff --git a/tgui/packages/tgui/interfaces/NtosStatus.js b/tgui/packages/tgui/interfaces/NtosStatus.js index 6f6bf24cda69..e119d06b1087 100644 --- a/tgui/packages/tgui/interfaces/NtosStatus.js +++ b/tgui/packages/tgui/interfaces/NtosStatus.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { NtosWindow } from '../layouts'; import { Input, Section, Button } from '../components'; -export const NtosStatus = (props, context) => { - const { act, data } = useBackend(context); +export const NtosStatus = (props) => { + const { act, data } = useBackend(); const { upper, lower } = data; return ( diff --git a/tgui/packages/tgui/interfaces/NtosSupermatterMonitor.js b/tgui/packages/tgui/interfaces/NtosSupermatterMonitor.js index 82f078923166..cf921706b96b 100644 --- a/tgui/packages/tgui/interfaces/NtosSupermatterMonitor.js +++ b/tgui/packages/tgui/interfaces/NtosSupermatterMonitor.js @@ -1,7 +1,7 @@ import { NtosWindow } from '../layouts'; import { SupermatterMonitorContent } from './SupermatterMonitor'; -export const NtosSupermatterMonitor = (props, context) => { +export const NtosSupermatterMonitor = (props) => { return ( diff --git a/tgui/packages/tgui/interfaces/NuclearBomb.js b/tgui/packages/tgui/interfaces/NuclearBomb.js index 741b1bc5b07b..c2d42d8f8164 100644 --- a/tgui/packages/tgui/interfaces/NuclearBomb.js +++ b/tgui/packages/tgui/interfaces/NuclearBomb.js @@ -7,8 +7,8 @@ import { Window } from '../layouts'; // and hand made width sets that changing pretty much anything // is going to require a lot of tweaking it get it looking correct again // I'm sorry, but it looks bangin -const NukeKeypad = (props, context) => { - const { act } = useBackend(context); +const NukeKeypad = (props) => { + const { act } = useBackend(); const keypadKeys = [ ['1', '4', '7', 'C'], ['2', '5', '8', '0'], @@ -45,8 +45,8 @@ const NukeKeypad = (props, context) => { ); }; -export const NuclearBomb = (props, context) => { - const { act, data } = useBackend(context); +export const NuclearBomb = (props) => { + const { act, data } = useBackend(); const { anchored, disk_present, status1, status2 } = data; return ( diff --git a/tgui/packages/tgui/interfaces/NumberInputModal.tsx b/tgui/packages/tgui/interfaces/NumberInputModal.tsx index 56740f4e80e8..a50fc23a8eb9 100644 --- a/tgui/packages/tgui/interfaces/NumberInputModal.tsx +++ b/tgui/packages/tgui/interfaces/NumberInputModal.tsx @@ -15,10 +15,10 @@ type NumberInputData = { title: string; }; -export const NumberInputModal = (_, context) => { - const { act, data } = useBackend(context); +export const NumberInputModal = (_) => { + const { act, data } = useBackend(); const { init_value, large_buttons, message = '', timeout, title } = data; - const [input, setInput] = useLocalState(context, 'input', init_value); + const [input, setInput] = useLocalState('input', init_value); const onChange = (value: number) => { if (value === input) { return; @@ -70,8 +70,8 @@ export const NumberInputModal = (_, context) => { }; /** Gets the user input and invalidates if there's a constraint. */ -const InputArea = (props, context) => { - const { act, data } = useBackend(context); +const InputArea = (props) => { + const { act, data } = useBackend(); const { min_value, max_value, init_value } = data; const { input, onClick, onChange } = props; diff --git a/tgui/packages/tgui/interfaces/OperatingComputer.js b/tgui/packages/tgui/interfaces/OperatingComputer.js index 3f5a5bac868d..33a8b3c9bd2c 100644 --- a/tgui/packages/tgui/interfaces/OperatingComputer.js +++ b/tgui/packages/tgui/interfaces/OperatingComputer.js @@ -28,9 +28,9 @@ const damageTypes = [ }, ]; -export const OperatingComputer = (props, context) => { - const { act } = useBackend(context); - const [tab, setTab] = useSharedState(context, 'tab', 1); +export const OperatingComputer = (props) => { + const { act } = useBackend(); + const [tab, setTab] = useSharedState('tab', 1); return ( @@ -53,8 +53,8 @@ export const OperatingComputer = (props, context) => { ); }; -const PatientStateView = (props, context) => { - const { act, data } = useBackend(context); +const PatientStateView = (props) => { + const { act, data } = useBackend(); const { table, procedures = [], patient = {} } = data; if (!table) { return No Table Detected; @@ -127,8 +127,8 @@ const PatientStateView = (props, context) => { ); }; -const SurgeryProceduresView = (props, context) => { - const { act, data } = useBackend(context); +const SurgeryProceduresView = (props) => { + const { act, data } = useBackend(); const { surgeries = [] } = data; return (
diff --git a/tgui/packages/tgui/interfaces/Orbit.js b/tgui/packages/tgui/interfaces/Orbit.js index b022e3e7e332..a27d5c0a9b85 100644 --- a/tgui/packages/tgui/interfaces/Orbit.js +++ b/tgui/packages/tgui/interfaces/Orbit.js @@ -43,8 +43,8 @@ const compareNumberedText = (a, b) => { return compareString(aName, bName); }; -const BasicSection = (props, context) => { - const { act } = useBackend(context); +const BasicSection = (props) => { + const { act } = useBackend(); const { searchText, source, title, autoObserve } = props; const things = source.filter(searchFor(searchText)); @@ -69,8 +69,8 @@ const BasicSection = (props, context) => { ); }; -const OrbitedButton = (props, context) => { - const { act } = useBackend(context); +const OrbitedButton = (props) => { + const { act } = useBackend(); const { color, thing, autoObserve } = props; return ( @@ -96,16 +96,12 @@ const OrbitedButton = (props, context) => { ); }; -export const Orbit = (props, context) => { - const { act, data } = useBackend(context); +export const Orbit = (props) => { + const { act, data } = useBackend(); const { alive, antagonists, dead, ghosts, misc, npcs } = data; - const [searchText, setSearchText] = useLocalState(context, 'searchText', ''); - const [autoObserve, setAutoObserve] = useLocalState( - context, - 'autoObserve', - true, - ); + const [searchText, setSearchText] = useLocalState('searchText', ''); + const [autoObserve, setAutoObserve] = useLocalState('autoObserve', true); const collatedAntagonists = {}; for (const antagonist of antagonists) { diff --git a/tgui/packages/tgui/interfaces/OreBox.js b/tgui/packages/tgui/interfaces/OreBox.js index f3aef4290d79..8382a90a9ba0 100644 --- a/tgui/packages/tgui/interfaces/OreBox.js +++ b/tgui/packages/tgui/interfaces/OreBox.js @@ -3,8 +3,8 @@ import { Box, Button, Section, Table } from '../components'; import { useBackend } from '../backend'; import { Window } from '../layouts'; -export const OreBox = (props, context) => { - const { act, data } = useBackend(context); +export const OreBox = (props) => { + const { act, data } = useBackend(); const { materials } = data; return ( diff --git a/tgui/packages/tgui/interfaces/OreRedemptionMachine.js b/tgui/packages/tgui/interfaces/OreRedemptionMachine.js index 8a948be83e6c..c27e93e408fe 100644 --- a/tgui/packages/tgui/interfaces/OreRedemptionMachine.js +++ b/tgui/packages/tgui/interfaces/OreRedemptionMachine.js @@ -10,8 +10,8 @@ import { } from '../components'; import { Window } from '../layouts'; -export const OreRedemptionMachine = (props, context) => { - const { act, data } = useBackend(context); +export const OreRedemptionMachine = (props) => { + const { act, data } = useBackend(); const { unclaimedPoints, materials, alloys, diskDesigns, hasDisk } = data; return ( @@ -111,14 +111,10 @@ export const OreRedemptionMachine = (props, context) => { ); }; -const MaterialRow = (props, context) => { +const MaterialRow = (props) => { const { material, onRelease } = props; - const [amount, setAmount] = useLocalState( - context, - 'amount' + material.name, - 1, - ); + const [amount, setAmount] = useLocalState('amount' + material.name, 1); const amountAvailable = Math.floor(material.amount); return ( diff --git a/tgui/packages/tgui/interfaces/OrionGame.js b/tgui/packages/tgui/interfaces/OrionGame.js index 302de0635ef7..8ab7e4c8d904 100644 --- a/tgui/packages/tgui/interfaces/OrionGame.js +++ b/tgui/packages/tgui/interfaces/OrionGame.js @@ -100,8 +100,8 @@ const locationInfo = [ }, ]; -const AdventureStatus = (props, context) => { - const { data, act } = useBackend(context); +const AdventureStatus = (props) => { + const { data, act } = useBackend(); const { lings_suspected, eventname, @@ -211,8 +211,8 @@ const AdventureStatus = (props, context) => { ); }; -const ORION_STATUS_START = (props, context) => { - const { data, act } = useBackend(context); +const ORION_STATUS_START = (props) => { + const { data, act } = useBackend(); const { gamename } = data; return (
@@ -246,8 +246,8 @@ const ORION_STATUS_START = (props, context) => { ); }; -const ORION_STATUS_INSTRUCTIONS = (props, context) => { - const { act } = useBackend(context); +const ORION_STATUS_INSTRUCTIONS = (props) => { + const { act } = useBackend(); const fake_settlers = ['John', 'William', 'Alice', 'Tom']; return ( <> @@ -370,8 +370,8 @@ const ORION_STATUS_INSTRUCTIONS = (props, context) => { ); }; -const ORION_STATUS_NORMAL = (props, context) => { - const { data, act } = useBackend(context); +const ORION_STATUS_NORMAL = (props) => { + const { data, act } = useBackend(); const { settlers, settlermoods, @@ -433,8 +433,8 @@ const ORION_STATUS_NORMAL = (props, context) => { ); }; -const ORION_STATUS_GAMEOVER = (props, context) => { - const { data, act } = useBackend(context); +const ORION_STATUS_GAMEOVER = (props) => { + const { data, act } = useBackend(); const { reason } = data; return (
@@ -463,8 +463,8 @@ const ORION_STATUS_GAMEOVER = (props, context) => { const marketButtonSpacing = 0.8; -const ORION_STATUS_MARKET = (props, context) => { - const { data, act } = useBackend(context); +const ORION_STATUS_MARKET = (props) => { + const { data, act } = useBackend(); const { turns, spaceport_raided } = data; return ( @@ -641,8 +641,8 @@ const ORION_STATUS_MARKET = (props, context) => { ); }; -export const OrionGame = (props, context) => { - const { act, data } = useBackend(context); +export const OrionGame = (props) => { + const { act, data } = useBackend(); const { gamestatus, gamename, eventname } = data; const GameStatusComponent = STATUS2COMPONENT[gamestatus].component(); const MarketRaid = STATUS2COMPONENT[2].component(); diff --git a/tgui/packages/tgui/interfaces/OutfitEditor.js b/tgui/packages/tgui/interfaces/OutfitEditor.js index 7be547f704d8..d32c5420fd46 100644 --- a/tgui/packages/tgui/interfaces/OutfitEditor.js +++ b/tgui/packages/tgui/interfaces/OutfitEditor.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Box, Button, Icon, Section, Stack } from '../components'; import { Window } from '../layouts'; -export const OutfitEditor = (props, context) => { - const { act, data } = useBackend(context); +export const OutfitEditor = (props) => { + const { act, data } = useBackend(); const { outfit, saveable, dummy64 } = data; return ( @@ -120,8 +120,8 @@ export const OutfitEditor = (props, context) => { ); }; -const OutfitSlot = (props, context) => { - const { act, data } = useBackend(context); +const OutfitSlot = (props) => { + const { act, data } = useBackend(); const { name, icon, iconRot, slot } = props; const { outfit } = data; const currItem = outfit[slot]; diff --git a/tgui/packages/tgui/interfaces/OutfitManager.js b/tgui/packages/tgui/interfaces/OutfitManager.js index d3a402b04c13..116cfac86dfa 100644 --- a/tgui/packages/tgui/interfaces/OutfitManager.js +++ b/tgui/packages/tgui/interfaces/OutfitManager.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Button, Section, Stack } from '../components'; import { Window } from '../layouts'; -export const OutfitManager = (props, context) => { - const { act, data } = useBackend(context); +export const OutfitManager = (props) => { + const { act, data } = useBackend(); const { outfits } = data; return ( diff --git a/tgui/packages/tgui/interfaces/PaiCard.tsx b/tgui/packages/tgui/interfaces/PaiCard.tsx index 9c789930f930..9b89444aab91 100644 --- a/tgui/packages/tgui/interfaces/PaiCard.tsx +++ b/tgui/packages/tgui/interfaces/PaiCard.tsx @@ -33,8 +33,8 @@ type Pai = { receive: BooleanLike; }; -export const PaiCard = (_, context) => { - const { data } = useBackend(context); +export const PaiCard = (_) => { + const { data } = useBackend(); const { pai } = data; return ( @@ -45,10 +45,10 @@ export const PaiCard = (_, context) => { }; /** Gives a list of candidates as cards */ -const PaiDownload = (_, context) => { - const { act, data } = useBackend(context); +const PaiDownload = (_) => { + const { act, data } = useBackend(); const { candidates = [] } = data; - const [tabInChar, setTabInChar] = useLocalState(context, 'tab', true); + const [tabInChar, setTabInChar] = useLocalState('tab', true); const onClick = () => { setTabInChar(!tabInChar); }; @@ -104,8 +104,8 @@ const PaiDownload = (_, context) => { * had to make the comments and descriptions a separate tab. * In longer entries, it is much more readable. */ -const CandidateDisplay = (props, context) => { - const { act } = useBackend(context); +const CandidateDisplay = (props) => { + const { act } = useBackend(); const { candidate, index, tabInChar } = props; const { comments, description, key, name } = candidate; @@ -145,8 +145,8 @@ const CandidateDisplay = (props, context) => { }; /** Once a pAI has been loaded, you can alter its settings here */ -const PaiOptions = (_, context) => { - const { act, data } = useBackend(context); +const PaiOptions = (_) => { + const { act, data } = useBackend(); const { pai } = data; const { can_holo, dna, emagged, laws, master, name, transmit, receive } = pai; diff --git a/tgui/packages/tgui/interfaces/PaiInterface.tsx b/tgui/packages/tgui/interfaces/PaiInterface.tsx index 1664956bfc25..fb7351e99da0 100644 --- a/tgui/packages/tgui/interfaces/PaiInterface.tsx +++ b/tgui/packages/tgui/interfaces/PaiInterface.tsx @@ -114,8 +114,8 @@ const ICON_MAP = { what: 'question', }; -export const PaiInterface = (_, context) => { - const [tab, setTab] = useLocalState(context, 'tab', 1); +export const PaiInterface = (_) => { + const [tab, setTab] = useLocalState('tab', 1); const setTabHandler = (tab: number) => { setTab(tab); }; @@ -191,8 +191,8 @@ const SystemDisplay = () => { }; /** Renders some ASCII art. Changes to red on emag. */ -const SystemWallpaper = (_, context) => { - const { data } = useBackend(context); +const SystemWallpaper = (_) => { + const { data } = useBackend(); const { emagged } = data; const owner = !emagged ? 'NANOTRASEN' : ' SYNDICATE'; @@ -236,8 +236,8 @@ const SystemWallpaper = (_, context) => { /** Displays master info. * You can check their DNA and change your image here. */ -const SystemInfo = (_, context) => { - const { act, data } = useBackend(context); +const SystemInfo = (_) => { + const { act, data } = useBackend(); const { image, master } = data; return ( @@ -276,8 +276,8 @@ const SystemInfo = (_, context) => { }; /** Shows the hardcoded PAI info along with any supplied orders. */ -const DirectiveDisplay = (_, context) => { - const { data } = useBackend(context); +const DirectiveDisplay = (_) => { + const { data } = useBackend(); const { directives, master } = data; return ( @@ -316,12 +316,8 @@ const DirectiveDisplay = (_, context) => { * another section that displays the selected installed * software info. */ -const InstalledDisplay = (_, context) => { - const [installSelected, setInstallSelected] = useLocalState( - context, - 'software', - '', - ); +const InstalledDisplay = (_) => { + const [installSelected, setInstallSelected] = useLocalState('software', ''); const onInstallHandler = (software: string) => { setInstallSelected(software); }; @@ -339,8 +335,8 @@ const InstalledDisplay = (_, context) => { }; /** Iterates over installed software to render buttons. */ -const InstalledSoftware = (props, context) => { - const { data } = useBackend(context); +const InstalledSoftware = (props) => { + const { data } = useBackend(); const { installed = [] } = data; const { onInstallClick } = props; @@ -399,8 +395,8 @@ const InstalledInfo = (props) => { }; /** Todo: Remove this entirely when records get a TGUI interface themselves */ -const RecordsDisplay = (props, context) => { - const { act, data } = useBackend(context); +const RecordsDisplay = (props) => { + const { act, data } = useBackend(); const { record_type } = props; const { records = [], refresh_spam } = data; const convertedRecords: CrewRecord[] = records[record_type]; @@ -472,8 +468,8 @@ const RecordRow = (props) => { /** Once a software is selected, generates custom buttons or a default * power toggle. */ -const SoftwareButtons = (props, context) => { - const { act, data } = useBackend(context); +const SoftwareButtons = (props) => { + const { act, data } = useBackend(); const { door_jack, languages, pda } = data; const { software } = props; @@ -592,8 +588,8 @@ const AvailableDisplay = () => { }; /** Displays the remaining RAM left as a progressbar. */ -const AvailableMemory = (_, context) => { - const { data } = useBackend(context); +const AvailableMemory = (_) => { + const { data } = useBackend(); const { ram } = data; return ( @@ -622,8 +618,8 @@ const AvailableMemory = (_, context) => { /** A list of available software. * creates table rows for each, like a vendor. */ -const AvailableSoftware = (_, context) => { - const { data } = useBackend(context); +const AvailableSoftware = (_) => { + const { data } = useBackend(); const { available } = data; const convertedList: Available[] = Object.entries(available).map((key) => { return { name: key[0], value: key[1] }; @@ -639,8 +635,8 @@ const AvailableSoftware = (_, context) => { }; /** A row for an individual software listing. */ -const AvailableRow = (props, context) => { - const { act, data } = useBackend(context); +const AvailableRow = (props) => { + const { act, data } = useBackend(); const { ram } = data; const { installed } = data; const { software } = props; diff --git a/tgui/packages/tgui/interfaces/PaiSubmit.tsx b/tgui/packages/tgui/interfaces/PaiSubmit.tsx index 833a2c4b7641..66c80b11a7a3 100644 --- a/tgui/packages/tgui/interfaces/PaiSubmit.tsx +++ b/tgui/packages/tgui/interfaces/PaiSubmit.tsx @@ -19,9 +19,9 @@ const PAI_RULES = `You are expected to role play to some degree. Keep in mind: Not entering information may lead to you not being selected. Press submit to alert pAI cards of your candidacy.`; -export const PaiSubmit = (_, context) => { - const { data } = useBackend(context); - const [input, setInput] = useLocalState(context, 'input', { +export const PaiSubmit = (_) => { + const { data } = useBackend(); + const [input, setInput] = useLocalState('input', { comments: data.comments || '', description: data.description || '', name: data.name || '', @@ -113,8 +113,8 @@ const InputDisplay = (props) => { }; /** Gives the user a submit button */ -const ButtonsDisplay = (props, context) => { - const { act } = useBackend(context); +const ButtonsDisplay = (props) => { + const { act } = useBackend(); const { input } = props; return ( diff --git a/tgui/packages/tgui/interfaces/PaintingAdminPanel.tsx b/tgui/packages/tgui/interfaces/PaintingAdminPanel.tsx index 25d3b99d0ac9..12053517496f 100644 --- a/tgui/packages/tgui/interfaces/PaintingAdminPanel.tsx +++ b/tgui/packages/tgui/interfaces/PaintingAdminPanel.tsx @@ -25,11 +25,11 @@ type PaintingData = { medium: string | null; }; -export const PaintingAdminPanel = (props, context) => { - const { act, data } = useBackend(context); +export const PaintingAdminPanel = (props) => { + const { act, data } = useBackend(); const [chosenPaintingRef, setChosenPaintingRef] = useLocalState< string | null - >(context, 'chosenPainting', null); + >('chosenPainting', null); const { paintings } = data; const chosenPainting = paintings.find((p) => p.ref === chosenPaintingRef); return ( diff --git a/tgui/packages/tgui/interfaces/PaintingMachine.js b/tgui/packages/tgui/interfaces/PaintingMachine.js index e2bbd84cbf31..67ab4c0066a0 100644 --- a/tgui/packages/tgui/interfaces/PaintingMachine.js +++ b/tgui/packages/tgui/interfaces/PaintingMachine.js @@ -2,19 +2,17 @@ import { useBackend, useSharedState } from '../backend'; import { Window } from '../layouts'; import { Button, Dropdown, Section, Stack } from '../components'; -export const PaintingMachine = (props, context) => { - const { act, data } = useBackend(context); +export const PaintingMachine = (props) => { + const { act, data } = useBackend(); const { pdaTypes, cardTrims, hasPDA, pdaName, hasID, idName } = data; const [selectedPDA] = useSharedState( - context, 'pdaSelection', pdaTypes[Object.keys(pdaTypes)[0]], ); const [selectedTrim] = useSharedState( - context, 'trimSelection', cardTrims[Object.keys(cardTrims)[0]], ); @@ -97,7 +95,7 @@ export const PaintingMachine = (props, context) => { ); }; -export const EjectButton = (props, context) => { +export const EjectButton = (props) => { const { name, onClickEject } = props; return ( @@ -111,11 +109,10 @@ export const EjectButton = (props, context) => { ); }; -export const PainterDropdown = (props, context) => { +export const PainterDropdown = (props) => { const { stateKey, options } = props; const [selectedOption, setSelectedOption] = useSharedState( - context, stateKey, options[Object.keys(options)[0]], ); diff --git a/tgui/packages/tgui/interfaces/Pandemic.tsx b/tgui/packages/tgui/interfaces/Pandemic.tsx index 7c4690f950a4..102256d939a9 100644 --- a/tgui/packages/tgui/interfaces/Pandemic.tsx +++ b/tgui/packages/tgui/interfaces/Pandemic.tsx @@ -98,8 +98,8 @@ type ThresholdDisplayProps = { thresholds: Threshold[]; }; -export const Pandemic = (_, context) => { - const { data } = useBackend(context); +export const Pandemic = (_) => { + const { data } = useBackend(); const { has_beaker, has_blood } = data; return ( @@ -121,8 +121,8 @@ export const Pandemic = (_, context) => { }; /** Displays loaded container info, if it exists */ -const BeakerDisplay = (_, context) => { - const { act, data } = useBackend(context); +const BeakerDisplay = (_) => { + const { act, data } = useBackend(); const { has_beaker, beaker, has_blood } = data; const cant_empty = !has_beaker || !beaker?.volume; let content; @@ -178,8 +178,8 @@ const BeakerDisplay = (_, context) => { }; /** Displays info about the blood type, beaker capacity - volume */ -const BeakerInfoDisplay = (_, context) => { - const { data } = useBackend(context); +const BeakerInfoDisplay = (_) => { + const { data } = useBackend(); const { beaker, blood } = data; if (!beaker || !blood) { return No beaker loaded; @@ -219,8 +219,8 @@ const BeakerInfoDisplay = (_, context) => { }; /** If antibodies are present, returns buttons to create vaccines */ -const AntibodyInfoDisplay = (_, context) => { - const { act, data } = useBackend(context); +const AntibodyInfoDisplay = (_) => { + const { act, data } = useBackend(); const { is_ready, resistances = [] } = data; if (!resistances) { return Nothing detected; @@ -254,9 +254,9 @@ const AntibodyInfoDisplay = (_, context) => { }; /** Displays info for the loaded blood, if any */ -const SpecimenDisplay = (_, context) => { - const { act, data } = useBackend(context); - const [tab, setTab] = useLocalState(context, 'tab', 0); +const SpecimenDisplay = (_) => { + const { act, data } = useBackend(); + const [tab, setTab] = useLocalState('tab', 0); const { is_ready, viruses = [] } = data; const virus = viruses[tab]; const setTabHandler = (index: number) => { @@ -308,8 +308,8 @@ const SpecimenDisplay = (_, context) => { /** Virus Tab display - changes the tab for virus info * Whenever the tab changes, the virus info is updated */ -const VirusTabs = (props: TabsProps, context) => { - const { data } = useBackend(context); +const VirusTabs = (props: TabsProps) => { + const { data } = useBackend(); const { tab, tabHandler } = props; const { viruses = [] } = data; @@ -354,8 +354,8 @@ const VirusDisplay = (props: VirusDisplayProps) => { }; /** Displays the description, name and other info for the virus. */ -const VirusTextInfo = (props: VirusInfoProps, context) => { - const { act } = useBackend(context); +const VirusTextInfo = (props: VirusInfoProps) => { + const { act } = useBackend(); const { virus } = props; return ( diff --git a/tgui/packages/tgui/interfaces/PaperSheet.js b/tgui/packages/tgui/interfaces/PaperSheet.js index 17f031564b9c..9aee958cd56e 100644 --- a/tgui/packages/tgui/interfaces/PaperSheet.js +++ b/tgui/packages/tgui/interfaces/PaperSheet.js @@ -218,7 +218,7 @@ const pauseEvent = (e) => { return false; }; -const Stamp = (props, context) => { +const Stamp = (props) => { const { image, opacity } = props; const stamp_transform = { left: image.x + 'px', @@ -243,7 +243,7 @@ const setInputReadonly = (text, readonly) => { // got to make this a full component if we // want to control updates -const PaperSheetView = (props, context) => { +const PaperSheetView = (props) => { const { value = '', stamps = [], backgroundColor, readOnly } = props; const stamp_list = stamps; const text_html = { @@ -279,8 +279,8 @@ const PaperSheetView = (props, context) => { // again, need the states for dragging and such class PaperSheetStamper extends Component { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); this.state = { x: 0, y: 0, @@ -300,7 +300,7 @@ class PaperSheetStamper extends Component { if (e.pageY <= 30) { return; } - const { act, data } = useBackend(this.context); + const { act, data } = useBackend(); const stamp_obj = { x: this.state.x, y: this.state.y, @@ -447,8 +447,8 @@ const createPreview = ( // component too if I want to keep updates // low and keep the weird flashing down class PaperSheetEdit extends Component { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); this.state = { previewSelected: 'Preview', old_text: props.value || '', @@ -460,7 +460,7 @@ class PaperSheetEdit extends Component { } createPreviewFromData(value, do_fields = false) { - const { data } = useBackend(this.context); + const { data } = useBackend(); return createPreview( value, this.state.old_text, @@ -500,7 +500,7 @@ class PaperSheetEdit extends Component { } // the final update send to byond, final upkeep finalUpdate(new_text) { - const { act } = useBackend(this.context); + const { act } = useBackend(); const final_processing = this.createPreviewFromData(new_text, true); act('save', final_processing); this.setState(() => { @@ -630,8 +630,8 @@ class PaperSheetEdit extends Component { } } -export const PaperSheet = (props, context) => { - const { data } = useBackend(context); +export const PaperSheet = (props) => { + const { data } = useBackend(); const { edit_mode, text, diff --git a/tgui/packages/tgui/interfaces/ParticleEdit/EntriesBasic.tsx b/tgui/packages/tgui/interfaces/ParticleEdit/EntriesBasic.tsx index eff1faaaeb0c..e887192b65e7 100644 --- a/tgui/packages/tgui/interfaces/ParticleEdit/EntriesBasic.tsx +++ b/tgui/packages/tgui/interfaces/ParticleEdit/EntriesBasic.tsx @@ -25,9 +25,9 @@ import { } from './data'; import { editKeyOf, editWeightOf, setGradientSpace } from './helpers'; -export const EntryFloat = (props: EntryFloatProps, context) => { - const { act, data } = useBackend(context); - const [desc, setdesc] = useLocalState(context, 'desc', ''); +export const EntryFloat = (props: EntryFloatProps) => { + const { act, data } = useBackend(); + const [desc, setdesc] = useLocalState('desc', ''); const { name, var_name, float } = props; return ( @@ -51,9 +51,9 @@ export const EntryFloat = (props: EntryFloatProps, context) => { ); }; -export const EntryCoord = (props: EntryCoordProps, context) => { - const { act, data } = useBackend(context); - const [desc, setdesc] = useLocalState(context, 'desc', ''); +export const EntryCoord = (props: EntryCoordProps) => { + const { act, data } = useBackend(); + const [desc, setdesc] = useLocalState('desc', ''); const { name, var_name, coord } = props; return ( @@ -96,9 +96,9 @@ export const EntryCoord = (props: EntryCoordProps, context) => { ); }; -export const EntryGradient = (props: EntryGradientProps, context) => { - const { act, data } = useBackend(context); - const [desc, setdesc] = useLocalState(context, 'desc', ''); +export const EntryGradient = (props: EntryGradientProps) => { + const { act, data } = useBackend(); + const [desc, setdesc] = useLocalState('desc', ''); const { name, var_name, gradient } = props; const isLooping = gradient?.find((x) => x === 'loop'); const space_type = gradient?.includes('space') @@ -197,9 +197,9 @@ export const EntryGradient = (props: EntryGradientProps, context) => { ); }; -export const EntryTransform = (props: EntryTransformProps, context) => { - const { act, data } = useBackend(context); - const [desc, setdesc] = useLocalState(context, 'desc', ''); +export const EntryTransform = (props: EntryTransformProps) => { + const { act, data } = useBackend(); + const [desc, setdesc] = useLocalState('desc', ''); const len = props.transform?.length ? props.transform.length : 0; const selected = len < 7 @@ -250,9 +250,9 @@ export const EntryTransform = (props: EntryTransformProps, context) => { ); }; -export const EntryIcon = (props: EntryIconStateProps, context) => { - const { act, data } = useBackend(context); - const [desc, setdesc] = useLocalState(context, 'desc', ''); +export const EntryIcon = (props: EntryIconStateProps) => { + const { act, data } = useBackend(); + const [desc, setdesc] = useLocalState('desc', ''); const { name, var_name, icon_state } = props; return ( @@ -322,9 +322,9 @@ export const EntryIcon = (props: EntryIconStateProps, context) => { ); }; -export const EntryIconState = (props: EntryIconStateProps, context) => { - const { act, data } = useBackend(context); - const [desc, setdesc] = useLocalState(context, 'desc', ''); +export const EntryIconState = (props: EntryIconStateProps) => { + const { act, data } = useBackend(); + const [desc, setdesc] = useLocalState('desc', ''); const { name, var_name, icon_state } = props; const newValue = typeof icon_state === 'string' diff --git a/tgui/packages/tgui/interfaces/ParticleEdit/EntriesGenerators.tsx b/tgui/packages/tgui/interfaces/ParticleEdit/EntriesGenerators.tsx index aaf878e6127a..16073b6978b9 100644 --- a/tgui/packages/tgui/interfaces/ParticleEdit/EntriesGenerators.tsx +++ b/tgui/packages/tgui/interfaces/ParticleEdit/EntriesGenerators.tsx @@ -19,9 +19,9 @@ import { import { isStringArray } from './helpers'; import { GeneratorListEntry } from './Generators'; -export const FloatGenerator = (props: FloatGeneratorProps, context) => { - const { act, data } = useBackend(context); - const [desc, setdesc] = useLocalState(context, 'desc', ''); +export const FloatGenerator = (props: FloatGeneratorProps) => { + const { act, data } = useBackend(); + const [desc, setdesc] = useLocalState('desc', ''); const { name, var_name, float } = props; return ( @@ -73,8 +73,8 @@ export const FloatGeneratorColor = ( props: FloatGeneratorColorProps, context, ) => { - const { act, data } = useBackend(context); - const [desc, setdesc] = useLocalState(context, 'desc', ''); + const { act, data } = useBackend(); + const [desc, setdesc] = useLocalState('desc', ''); const { name, var_name, float } = props; return ( @@ -131,8 +131,8 @@ export const EntryGeneratorNumbersList = ( props: EntryGeneratorNumbersListProps, context, ) => { - const { act, data } = useBackend(context); - const [desc, setdesc] = useLocalState(context, 'desc', ''); + const { act, data } = useBackend(); + const [desc, setdesc] = useLocalState('desc', ''); const { name, var_name, allow_z, input } = props; return ( diff --git a/tgui/packages/tgui/interfaces/ParticleEdit/Generators.tsx b/tgui/packages/tgui/interfaces/ParticleEdit/Generators.tsx index 22e75dcd2628..5fc8411281e7 100644 --- a/tgui/packages/tgui/interfaces/ParticleEdit/Generators.tsx +++ b/tgui/packages/tgui/interfaces/ParticleEdit/Generators.tsx @@ -10,8 +10,8 @@ import { RandTypes, } from './data'; -export const GeneratorListEntry = (props: GeneratorProps, context) => { - const { act, data } = useBackend(context); +export const GeneratorListEntry = (props: GeneratorProps) => { + const { act, data } = useBackend(); const { var_name, generator, allow_vectors } = props; // omits generators that are not allowed with certain vars const allowed_generators = allow_vectors diff --git a/tgui/packages/tgui/interfaces/ParticleEdit/Tutorial.tsx b/tgui/packages/tgui/interfaces/ParticleEdit/Tutorial.tsx index c0fab0b4efc4..4f965ce44073 100644 --- a/tgui/packages/tgui/interfaces/ParticleEdit/Tutorial.tsx +++ b/tgui/packages/tgui/interfaces/ParticleEdit/Tutorial.tsx @@ -9,8 +9,8 @@ import { } from '../../components'; import { resolveAsset } from '../../assets'; -export const ShowDesc = (props, context) => { - const [desc, setdesc] = useLocalState(context, 'desc', ''); +export const ShowDesc = (props) => { + const [desc, setdesc] = useLocalState('desc', ''); return ( { - const { act, data } = useBackend(context); - const [desc, setdesc] = useLocalState(context, 'desc', ''); +export const ParticleEdit = (props) => { + const { act, data } = useBackend(); + const [desc, setdesc] = useLocalState('desc', ''); const { width, diff --git a/tgui/packages/tgui/interfaces/PersonalCrafting.js b/tgui/packages/tgui/interfaces/PersonalCrafting.js index 541fa956f4aa..80d232804cbd 100644 --- a/tgui/packages/tgui/interfaces/PersonalCrafting.js +++ b/tgui/packages/tgui/interfaces/PersonalCrafting.js @@ -10,8 +10,8 @@ import { } from '../components'; import { Window } from '../layouts'; -export const PersonalCrafting = (props, context) => { - const { act, data } = useBackend(context); +export const PersonalCrafting = (props) => { + const { act, data } = useBackend(); const { busy, display_craftable_only, display_compact } = data; const crafting_recipes = data.crafting_recipes || {}; // Sort everything into flat categories @@ -56,7 +56,7 @@ export const PersonalCrafting = (props, context) => { } } // Sort out the tab state - const [tab, setTab] = useLocalState(context, 'tab', categories[0]?.name); + const [tab, setTab] = useLocalState('tab', categories[0]?.name); const shownRecipes = recipes.filter((recipe) => recipe.category === tab); return ( @@ -121,9 +121,9 @@ export const PersonalCrafting = (props, context) => { ); }; -const CraftingList = (props, context) => { +const CraftingList = (props) => { const { craftables = [] } = props; - const { act, data } = useBackend(context); + const { act, data } = useBackend(); const { craftability = {}, display_compact, display_craftable_only } = data; return craftables.map((craftable) => { if (display_craftable_only && !craftability[craftable.ref]) { diff --git a/tgui/packages/tgui/interfaces/Photocopier.js b/tgui/packages/tgui/interfaces/Photocopier.js index 00dfb0511210..a6a426feceef 100644 --- a/tgui/packages/tgui/interfaces/Photocopier.js +++ b/tgui/packages/tgui/interfaces/Photocopier.js @@ -11,8 +11,8 @@ import { } from '../components'; import { Window } from '../layouts'; -export const Photocopier = (props, context) => { - const { data } = useBackend(context); +export const Photocopier = (props) => { + const { data } = useBackend(); const { isAI, has_toner, has_item, forms_exist } = data; return ( @@ -47,8 +47,8 @@ export const Photocopier = (props, context) => { ); }; -const Toner = (props, context) => { - const { act, data } = useBackend(context); +const Toner = (props) => { + const { act, data } = useBackend(); const { has_toner, max_toner, current_toner } = data; const average_toner = max_toner * 0.66; @@ -81,8 +81,8 @@ const Toner = (props, context) => { ); }; -const Options = (props, context) => { - const { act, data } = useBackend(context); +const Options = (props) => { + const { act, data } = useBackend(); const { color_mode, is_photo, num_copies, has_enough_toner } = data; return ( @@ -165,8 +165,8 @@ const Options = (props, context) => { ); }; -const Blanks = (props, context) => { - const { act, data } = useBackend(context); +const Blanks = (props) => { + const { act, data } = useBackend(); const { blanks, category, has_toner } = data; const sortedBlanks = sortBy((blank) => blanks.category)(blanks || []); @@ -216,8 +216,8 @@ const Blanks = (props, context) => { ); }; -const AIOptions = (props, context) => { - const { act, data } = useBackend(context); +const AIOptions = (props) => { + const { act, data } = useBackend(); const { can_AI_print } = data; return ( diff --git a/tgui/packages/tgui/interfaces/PhysicalNewscaster.js b/tgui/packages/tgui/interfaces/PhysicalNewscaster.js index 38d3b6c59ddb..dbf2a11c1cde 100644 --- a/tgui/packages/tgui/interfaces/PhysicalNewscaster.js +++ b/tgui/packages/tgui/interfaces/PhysicalNewscaster.js @@ -1,7 +1,7 @@ import { Newscaster } from '../interfaces/Newscaster'; import { Window } from '../layouts'; -export const PhysicalNewscaster = (props, context) => { +export const PhysicalNewscaster = (props) => { return ( diff --git a/tgui/packages/tgui/interfaces/PipeDispenser.js b/tgui/packages/tgui/interfaces/PipeDispenser.js index d51bfb3ae0ef..5736a6789225 100644 --- a/tgui/packages/tgui/interfaces/PipeDispenser.js +++ b/tgui/packages/tgui/interfaces/PipeDispenser.js @@ -8,13 +8,10 @@ import { SmartPipeBlockSection, } from './RapidPipeDispenser'; -const PipeTypeSection = (props, context) => { - const { act, data } = useBackend(context); +const PipeTypeSection = (props) => { + const { act, data } = useBackend(); const { categories = [] } = data; - const [categoryName, setCategoryName] = useLocalState( - context, - 'categoryName', - ); + const [categoryName, setCategoryName] = useLocalState('categoryName'); const shownCategory = categories.find((category) => category.cat_name === categoryName) || categories[0]; @@ -53,8 +50,8 @@ const PipeTypeSection = (props, context) => { ); }; -export const PipeDispenser = (props, context) => { - const { act, data } = useBackend(context); +export const PipeDispenser = (props) => { + const { act, data } = useBackend(); const { category: rootCategoryIndex } = data; return ( diff --git a/tgui/packages/tgui/interfaces/PortableChemMixer.js b/tgui/packages/tgui/interfaces/PortableChemMixer.js index ec1624c60bc0..2e43afc03eb5 100644 --- a/tgui/packages/tgui/interfaces/PortableChemMixer.js +++ b/tgui/packages/tgui/interfaces/PortableChemMixer.js @@ -10,8 +10,8 @@ import { } from '../components'; import { Window } from '../layouts'; -export const PortableChemMixer = (props, context) => { - const { act, data } = useBackend(context); +export const PortableChemMixer = (props) => { + const { act, data } = useBackend(); const recording = !!data.recordingRecipe; const beakerTransferAmounts = data.beakerTransferAmounts || []; const beakerContents = diff --git a/tgui/packages/tgui/interfaces/PortableGenerator.js b/tgui/packages/tgui/interfaces/PortableGenerator.js index d0c1eb990b06..76a8e2bab3da 100644 --- a/tgui/packages/tgui/interfaces/PortableGenerator.js +++ b/tgui/packages/tgui/interfaces/PortableGenerator.js @@ -9,8 +9,8 @@ import { } from '../components'; import { Window } from '../layouts'; -export const PortableGenerator = (props, context) => { - const { act, data } = useBackend(context); +export const PortableGenerator = (props) => { + const { act, data } = useBackend(); const { stack_percent } = data; const stackPercentState = (stack_percent > 50 && 'good') || diff --git a/tgui/packages/tgui/interfaces/PortablePump.js b/tgui/packages/tgui/interfaces/PortablePump.js index f76e1a0feb35..2bc7c47e5dd4 100644 --- a/tgui/packages/tgui/interfaces/PortablePump.js +++ b/tgui/packages/tgui/interfaces/PortablePump.js @@ -3,8 +3,8 @@ import { Button, LabeledList, NumberInput, Section } from '../components'; import { Window } from '../layouts'; import { PortableBasicInfo } from './common/PortableAtmos'; -export const PortablePump = (props, context) => { - const { act, data } = useBackend(context); +export const PortablePump = (props) => { + const { act, data } = useBackend(); const { direction, holding, diff --git a/tgui/packages/tgui/interfaces/PortableScrubber.js b/tgui/packages/tgui/interfaces/PortableScrubber.js index a18a5c431685..5ab33f2fa710 100644 --- a/tgui/packages/tgui/interfaces/PortableScrubber.js +++ b/tgui/packages/tgui/interfaces/PortableScrubber.js @@ -4,8 +4,8 @@ import { getGasLabel } from '../constants'; import { Window } from '../layouts'; import { PortableBasicInfo } from './common/PortableAtmos'; -export const PortableScrubber = (props, context) => { - const { act, data } = useBackend(context); +export const PortableScrubber = (props) => { + const { act, data } = useBackend(); const filter_types = data.filter_types || []; return ( diff --git a/tgui/packages/tgui/interfaces/PortableTurret.js b/tgui/packages/tgui/interfaces/PortableTurret.js index a2cdab07df96..90b1a570a60e 100644 --- a/tgui/packages/tgui/interfaces/PortableTurret.js +++ b/tgui/packages/tgui/interfaces/PortableTurret.js @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Button, LabeledList, NoticeBox, Section } from '../components'; import { Window } from '../layouts'; -export const PortableTurret = (props, context) => { - const { act, data } = useBackend(context); +export const PortableTurret = (props) => { + const { act, data } = useBackend(); const { silicon_user, locked, diff --git a/tgui/packages/tgui/interfaces/PortraitPicker.js b/tgui/packages/tgui/interfaces/PortraitPicker.js index b38ad2431fa6..010c9db21beb 100644 --- a/tgui/packages/tgui/interfaces/PortraitPicker.js +++ b/tgui/packages/tgui/interfaces/PortraitPicker.js @@ -3,9 +3,9 @@ import { useBackend, useLocalState } from '../backend'; import { Button, Flex, NoticeBox, Section, Input } from '../components'; import { Window } from '../layouts'; -export const PortraitPicker = (props, context) => { - const { act, data } = useBackend(context); - const [listIndex, setListIndex] = useLocalState(context, 'listIndex', 0); +export const PortraitPicker = (props) => { + const { act, data } = useBackend(); + const [listIndex, setListIndex] = useLocalState('listIndex', 0); const { paintings, search_string, search_mode } = data; const got_paintings = !!paintings.length; const current_portrait_title = got_paintings && paintings[listIndex]['title']; diff --git a/tgui/packages/tgui/interfaces/PowerMonitor.js b/tgui/packages/tgui/interfaces/PowerMonitor.js index 91844a5ccef1..bf0b8a1d93f8 100644 --- a/tgui/packages/tgui/interfaces/PowerMonitor.js +++ b/tgui/packages/tgui/interfaces/PowerMonitor.js @@ -34,14 +34,10 @@ export const PowerMonitor = () => { ); }; -export const PowerMonitorContent = (props, context) => { - const { data } = useBackend(context); +export const PowerMonitorContent = (props) => { + const { data } = useBackend(); const { history } = data; - const [sortByField, setSortByField] = useLocalState( - context, - 'sortByField', - null, - ); + const [sortByField, setSortByField] = 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]); diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/AntagsPage.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/AntagsPage.tsx index e1db1fe69cdc..cc4558cd86dc 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/AntagsPage.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/AntagsPage.tsx @@ -42,18 +42,11 @@ for (const antagKey of requireAntag.keys()) { ); } -const AntagSelection = ( - props: { - antagonists: Antagonist[]; - name: string; - }, - context, -) => { - const { act, data } = useBackend(context); +const AntagSelection = (props: { antagonists: Antagonist[]; name: string }) => { + const { act, data } = useBackend(); const className = 'PreferencesMenu__Antags__antagSelection'; const [predictedState, setPredictedState] = useLocalState( - context, 'AntagSelection_predictedState', new Set(data.selected_antags), ); diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/CharacterPreferenceWindow.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/CharacterPreferenceWindow.tsx index 108ab0ac8058..a58e7edb44c5 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/CharacterPreferenceWindow.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/CharacterPreferenceWindow.tsx @@ -44,14 +44,10 @@ const CharacterProfiles = (props: { ); }; -export const CharacterPreferenceWindow = (props, context) => { - const { act, data } = useBackend(context); +export const CharacterPreferenceWindow = (props) => { + const { act, data } = useBackend(); - const [currentPage, setCurrentPage] = useLocalState( - context, - 'currentPage', - Page.Main, - ); + const [currentPage, setCurrentPage] = useLocalState('currentPage', Page.Main); let pageContents; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/GamePreferenceWindow.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/GamePreferenceWindow.tsx index 863ffa6426b0..518493b76bec 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/GamePreferenceWindow.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/GamePreferenceWindow.tsx @@ -7,16 +7,12 @@ import { useBackend, useLocalState } from '../../backend'; import { GamePreferencesSelectedPage, PreferencesMenuData } from './data'; import { exhaustiveCheck } from 'common/exhaustive'; -export const GamePreferenceWindow = ( - props: { - startingPage?: GamePreferencesSelectedPage; - }, - context, -) => { - const { act, data } = useBackend(context); +export const GamePreferenceWindow = (props: { + startingPage?: GamePreferencesSelectedPage; +}) => { + const { act, data } = useBackend(); const [currentPage, setCurrentPage] = useLocalState( - context, 'currentPage', props.startingPage ?? GamePreferencesSelectedPage.Settings, ); diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/GamePreferencesPage.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/GamePreferencesPage.tsx index c1c3c3bc4358..22bc42166893 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/GamePreferencesPage.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/GamePreferencesPage.tsx @@ -18,8 +18,8 @@ const binaryInsertPreference = binaryInsertWith( const sortByName = sortBy<[string, PreferenceChild[]]>(([name]) => name); -export const GamePreferencesPage = (props, context) => { - const { act, data } = useBackend(context); +export const GamePreferencesPage = (props) => { + const { act, data } = useBackend(); const gamePreferences: Record = {}; diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/JobsPage.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/JobsPage.tsx index 63a577b2c4aa..353caa9d723a 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/JobsPage.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/JobsPage.tsx @@ -54,7 +54,6 @@ type CreateSetPriority = (priority: JobPriority | null) => () => void; const createSetPriorityCache: Record = {}; const createCreateSetPriorityFromName = ( - context, jobName: string, ): CreateSetPriority => { if (createSetPriorityCache[jobName] !== undefined) { @@ -70,7 +69,7 @@ const createCreateSetPriorityFromName = ( } const setPriority = () => { - const { act } = useBackend(context); + const { act } = useBackend(); act('set_job_preference', { job: jobName, @@ -175,23 +174,16 @@ const PriorityButtons = (props: { ); }; -const JobRow = ( - props: { - className?: string; - job: Job; - name: string; - }, - context, -) => { - const { data } = useBackend(context); +const JobRow = (props: { className?: string; job: Job; name: string }) => { + const { data } = useBackend(); const { className, job, name } = props; const isOverflow = data.overflow_role === name; const priority = data.job_preferences[name]; - const createSetPriority = createCreateSetPriorityFromName(context, name); + const createSetPriority = createCreateSetPriorityFromName(name); // PARIAH EDIT - const { act } = useBackend(context); + const { act } = useBackend(); // PARIAH EDIT END const experienceNeeded = @@ -355,8 +347,8 @@ const Gap = (props: { amount: number }) => { return ; }; -const JoblessRoleDropdown = (props, context) => { - const { act, data } = useBackend(context); +const JoblessRoleDropdown = (props) => { + const { act, data } = useBackend(); const selected = data.character_preferences.misc.joblessrole; const options = [ diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/KeybindingsPage.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/KeybindingsPage.tsx index 25f224d21d64..552fff65b0c7 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/KeybindingsPage.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/KeybindingsPage.tsx @@ -178,13 +178,8 @@ KeybindingName.defaultHooks = { }, }; -const ResetToDefaultButton = ( - props: { - keybindingId: string; - }, - context, -) => { - const { act } = useBackend(context); +const ResetToDefaultButton = (props: { keybindingId: string }) => { + const { act } = useBackend(); return (