Skip to content

Commit

Permalink
Changes overwatch consoles to useSharedState to prevent losing state …
Browse files Browse the repository at this point in the history
…information upon closing the UI (#5850)

# About the pull request

Overwatch console will now save your filter settings, and they affect
other people using the console

# Explain why it's good for the game
# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
refactor: Overwatch console will now save your filter settings
/:cl:
  • Loading branch information
TheGamerdk authored Mar 1, 2024
1 parent 4dfc001 commit af5480b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tgui/packages/tgui/interfaces/OverwatchConsole.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useBackend, useLocalState, useSharedState } from '../backend';
import { useBackend, useSharedState } from '../backend';
import { Button, Section, Stack, Tabs, Table, Box, Input, NumberInput, LabeledControls, Divider, Collapsible } from '../components';
import { Window } from '../layouts';

Expand Down Expand Up @@ -60,7 +60,7 @@ const HomePanel = (props) => {
const SquadPanel = (props) => {
const { act, data } = useBackend();

const [category, setCategory] = useLocalState('selected', 'monitor');
const [category, setCategory] = useSharedState('selected', 'monitor');

return (
<>
Expand Down Expand Up @@ -325,21 +325,21 @@ const SquadMonitor = (props) => {

let { marines, squad_leader } = data;

const [hidden_marines, setHiddenMarines] = useLocalState(
const [hidden_marines, setHiddenMarines] = useSharedState(
'hidden_marines',
[]
);

const [showHiddenMarines, setShowHiddenMarines] = useLocalState(
const [showHiddenMarines, setShowHiddenMarines] = useSharedState(
'showhidden',
false
);
const [showDeadMarines, setShowDeadMarines] = useLocalState(
const [showDeadMarines, setShowDeadMarines] = useSharedState(
'showdead',
false
);

const [marineSearch, setMarineSearch] = useLocalState('marinesearch', null);
const [marineSearch, setMarineSearch] = useSharedState('marinesearch', null);

let determine_status_color = (status) => {
let conscious = status.includes('Conscious');
Expand Down

0 comments on commit af5480b

Please sign in to comment.