Rename enum

This commit is contained in:
nickofolas 2022-04-17 15:09:47 -05:00
parent f222dc5277
commit 4073050333
4 changed files with 18 additions and 18 deletions

@ -1,4 +1,4 @@
export enum GameOptionsTabs {
export enum GameOptionsTab {
SYSTEM,
INTERFACE,
GAMEPLAY,

@ -4,12 +4,12 @@ import { IPlayer } from "../../PersonObjects/IPlayer";
import { Settings } from "../../Settings/Settings";
import { OptionSwitch } from "../../ui/React/OptionSwitch";
import { formatTime } from "../../utils/helpers/formatTime";
import { GameOptionsTabs } from "../GameOptionsTabs";
import { GameOptionsTab } from "../GameOptionsTab";
import { GameOptionsPage } from "./GameOptionsPage";
import { OptionsSlider } from "./OptionsSlider";
interface IProps {
currentTab: GameOptionsTabs;
currentTab: GameOptionsTab;
player: IPlayer;
}
@ -64,7 +64,7 @@ export const CurrentOptionsPage = (props: IProps): React.ReactElement => {
}
const pages = {
[GameOptionsTabs.SYSTEM]: (
[GameOptionsTab.SYSTEM]: (
<GameOptionsPage title="System" noList>
<OptionsSlider
label=".script exec time (ms)"
@ -149,7 +149,7 @@ export const CurrentOptionsPage = (props: IProps): React.ReactElement => {
/>
</GameOptionsPage>
),
[GameOptionsTabs.INTERFACE]: (
[GameOptionsTab.INTERFACE]: (
<GameOptionsPage title="Interface">
<OptionSwitch
checked={Settings.DisableASCIIArt}
@ -232,7 +232,7 @@ export const CurrentOptionsPage = (props: IProps): React.ReactElement => {
</>
</GameOptionsPage>
),
[GameOptionsTabs.GAMEPLAY]: (
[GameOptionsTab.GAMEPLAY]: (
<GameOptionsPage title="Gameplay">
<OptionSwitch
checked={Settings.SuppressMessages}
@ -312,7 +312,7 @@ export const CurrentOptionsPage = (props: IProps): React.ReactElement => {
)}
</GameOptionsPage>
),
[GameOptionsTabs.MISC]: (
[GameOptionsTab.MISC]: (
<GameOptionsPage title="Misc">
<OptionSwitch
checked={Settings.DisableHotkeys}

@ -2,7 +2,7 @@ import { Box, Container, Typography } from "@mui/material";
import React, { useState } from "react";
import { IPlayer } from "../../PersonObjects/IPlayer";
import { IRouter } from "../../ui/Router";
import { GameOptionsTabs } from "../GameOptionsTabs";
import { GameOptionsTab } from "../GameOptionsTab";
import { CurrentOptionsPage } from "./CurrentOptionsPage";
import { GameOptionsSidebar } from "./GameOptionsSidebar";
@ -16,7 +16,7 @@ interface IProps {
}
export function GameOptionsRoot(props: IProps): React.ReactElement {
const [currentTab, setCurrentTab] = useState(GameOptionsTabs.SYSTEM);
const [currentTab, setCurrentTab] = useState(GameOptionsTab.SYSTEM);
return (
<Container disableGutters maxWidth="lg" sx={{ mx: 0 }}>
@ -24,7 +24,7 @@ export function GameOptionsRoot(props: IProps): React.ReactElement {
<Box sx={{ display: "grid", gridTemplateColumns: "1fr 3fr", gap: 1 }}>
<GameOptionsSidebar
tab={currentTab}
setTab={(tab: GameOptionsTabs) => setCurrentTab(tab)}
setTab={(tab: GameOptionsTab) => setCurrentTab(tab)}
player={props.player}
router={props.router}
save={props.save}

@ -25,11 +25,11 @@ import { SnackbarEvents, ToastVariant } from "../../ui/React/Snackbar";
import { SoftResetButton } from "../../ui/React/SoftResetButton";
import { IRouter } from "../../ui/Router";
import { convertTimeMsToTimeElapsedString } from "../../utils/StringHelperFunctions";
import { GameOptionsTabs } from "../GameOptionsTabs";
import { GameOptionsTab } from "../GameOptionsTab";
interface IProps {
tab: GameOptionsTabs;
setTab: (tab: GameOptionsTabs) => void;
tab: GameOptionsTab;
setTab: (tab: GameOptionsTab) => void;
player: IPlayer;
router: IRouter;
save: () => void;
@ -40,7 +40,7 @@ interface IProps {
interface ITabProps {
sideBarProps: IProps;
tab: GameOptionsTabs;
tab: GameOptionsTab;
tabName: string;
}
@ -104,10 +104,10 @@ export const GameOptionsSidebar = (props: IProps): React.ReactElement => {
<Box>
<Paper sx={{ height: "fit-content", mb: 1 }}>
<List>
<SideBarTab sideBarProps={props} tab={GameOptionsTabs.SYSTEM} tabName="System" />
<SideBarTab sideBarProps={props} tab={GameOptionsTabs.GAMEPLAY} tabName="Gameplay" />
<SideBarTab sideBarProps={props} tab={GameOptionsTabs.INTERFACE} tabName="Interface" />
<SideBarTab sideBarProps={props} tab={GameOptionsTabs.MISC} tabName="Misc" />
<SideBarTab sideBarProps={props} tab={GameOptionsTab.SYSTEM} tabName="System" />
<SideBarTab sideBarProps={props} tab={GameOptionsTab.GAMEPLAY} tabName="Gameplay" />
<SideBarTab sideBarProps={props} tab={GameOptionsTab.INTERFACE} tabName="Interface" />
<SideBarTab sideBarProps={props} tab={GameOptionsTab.MISC} tabName="Misc" />
</List>
</Paper>
<Box