2022-12-05 03:05:55 +01:00
|
|
|
import React, { useMemo, useCallback, useState, useEffect } from "react";
|
2022-12-04 04:56:42 +01:00
|
|
|
import { KEYCODE } from "../../utils/helpers/keyCodes";
|
2021-09-18 01:43:08 +02:00
|
|
|
import { styled, Theme, CSSObject } from "@mui/material/styles";
|
2021-09-17 01:23:03 +02:00
|
|
|
import createStyles from "@mui/styles/createStyles";
|
|
|
|
import makeStyles from "@mui/styles/makeStyles";
|
2021-09-17 01:42:55 +02:00
|
|
|
import MuiDrawer from "@mui/material/Drawer";
|
2021-09-17 01:23:03 +02:00
|
|
|
import List from "@mui/material/List";
|
|
|
|
import Divider from "@mui/material/Divider";
|
2021-12-16 21:23:27 +01:00
|
|
|
import Tooltip from "@mui/material/Tooltip";
|
2021-09-17 01:23:03 +02:00
|
|
|
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
|
|
|
|
import ChevronRightIcon from "@mui/icons-material/ChevronRight";
|
|
|
|
import ListItem from "@mui/material/ListItem";
|
|
|
|
import ListItemIcon from "@mui/material/ListItemIcon";
|
|
|
|
import ListItemText from "@mui/material/ListItemText";
|
|
|
|
import Typography from "@mui/material/Typography";
|
2021-09-14 21:23:16 +02:00
|
|
|
|
2021-09-17 01:23:03 +02:00
|
|
|
import ComputerIcon from "@mui/icons-material/Computer";
|
|
|
|
import LastPageIcon from "@mui/icons-material/LastPage"; // Terminal
|
|
|
|
import CreateIcon from "@mui/icons-material/Create"; // Create Script
|
|
|
|
import StorageIcon from "@mui/icons-material/Storage"; // Active Scripts
|
|
|
|
import BugReportIcon from "@mui/icons-material/BugReport"; // Create Program
|
|
|
|
import EqualizerIcon from "@mui/icons-material/Equalizer"; // Stats
|
|
|
|
import ContactsIcon from "@mui/icons-material/Contacts"; // Factions
|
|
|
|
import DoubleArrowIcon from "@mui/icons-material/DoubleArrow"; // Augmentations
|
|
|
|
import AccountTreeIcon from "@mui/icons-material/AccountTree"; // Hacknet
|
|
|
|
import PeopleAltIcon from "@mui/icons-material/PeopleAlt"; // Sleeves
|
|
|
|
import LocationCityIcon from "@mui/icons-material/LocationCity"; // City
|
|
|
|
import AirplanemodeActiveIcon from "@mui/icons-material/AirplanemodeActive"; // Travel
|
|
|
|
import WorkIcon from "@mui/icons-material/Work"; // Job
|
|
|
|
import TrendingUpIcon from "@mui/icons-material/TrendingUp"; // Stock Market
|
|
|
|
import FormatBoldIcon from "@mui/icons-material/FormatBold"; // Bladeburner
|
|
|
|
import BusinessIcon from "@mui/icons-material/Business"; // Corp
|
|
|
|
import SportsMmaIcon from "@mui/icons-material/SportsMma"; // Gang
|
|
|
|
import CheckIcon from "@mui/icons-material/Check"; // Milestones
|
|
|
|
import HelpIcon from "@mui/icons-material/Help"; // Tutorial
|
|
|
|
import SettingsIcon from "@mui/icons-material/Settings"; // options
|
|
|
|
import DeveloperBoardIcon from "@mui/icons-material/DeveloperBoard"; // Dev
|
2022-01-06 13:04:03 +01:00
|
|
|
import EmojiEventsIcon from "@mui/icons-material/EmojiEvents"; // Achievements
|
2021-09-17 01:23:03 +02:00
|
|
|
import AccountBoxIcon from "@mui/icons-material/AccountBox";
|
|
|
|
import PublicIcon from "@mui/icons-material/Public";
|
|
|
|
import LiveHelpIcon from "@mui/icons-material/LiveHelp";
|
2021-09-14 21:23:16 +02:00
|
|
|
|
2022-09-06 15:07:12 +02:00
|
|
|
import { Router } from "../../ui/GameRoot";
|
2023-06-26 10:24:37 +02:00
|
|
|
import { Page, isSimplePage } from "../../ui/Router";
|
2022-12-05 03:05:55 +01:00
|
|
|
import { SidebarAccordion } from "./SidebarAccordion";
|
2022-10-10 00:42:14 +02:00
|
|
|
import { Player } from "@player";
|
2021-09-14 21:23:16 +02:00
|
|
|
import { CONSTANTS } from "../../Constants";
|
2021-09-11 07:54:19 +02:00
|
|
|
import { iTutorialSteps, iTutorialNextStep, ITutorial } from "../../InteractiveTutorial";
|
|
|
|
import { getAvailableCreatePrograms } from "../../Programs/ProgramHelpers";
|
2021-09-13 00:03:07 +02:00
|
|
|
import { Settings } from "../../Settings/Settings";
|
2023-06-12 06:34:20 +02:00
|
|
|
import { AugmentationName } from "@enums";
|
2021-09-13 00:03:07 +02:00
|
|
|
|
2021-10-23 21:22:58 +02:00
|
|
|
import { ProgramsSeen } from "../../Programs/ui/ProgramsRoot";
|
|
|
|
import { InvitationsSeen } from "../../Faction/ui/FactionsRoot";
|
2021-12-17 02:07:34 +01:00
|
|
|
import { hash } from "../../hash/hash";
|
2022-07-19 20:21:12 +02:00
|
|
|
import { Locations } from "../../Locations/Locations";
|
2023-02-11 19:22:55 +01:00
|
|
|
import { useRerender } from "../../ui/React/hooks";
|
2021-09-11 07:54:19 +02:00
|
|
|
|
2023-01-01 10:10:06 +01:00
|
|
|
const RotatedDoubleArrowIcon = React.forwardRef((props: { color: "primary" | "secondary" | "error" }, __ref) => (
|
2022-12-05 05:04:33 +01:00
|
|
|
<DoubleArrowIcon color={props.color} style={{ transform: "rotate(-90deg)" }} />
|
2023-01-01 10:10:06 +01:00
|
|
|
));
|
2022-12-05 03:05:55 +01:00
|
|
|
|
2021-09-17 01:42:55 +02:00
|
|
|
const openedMixin = (theme: Theme): CSSObject => ({
|
2021-09-17 02:51:25 +02:00
|
|
|
width: theme.spacing(31),
|
2021-09-17 01:42:55 +02:00
|
|
|
transition: theme.transitions.create("width", {
|
|
|
|
easing: theme.transitions.easing.sharp,
|
|
|
|
duration: theme.transitions.duration.enteringScreen,
|
|
|
|
}),
|
|
|
|
overflowX: "hidden",
|
|
|
|
});
|
|
|
|
|
|
|
|
const closedMixin = (theme: Theme): CSSObject => ({
|
|
|
|
transition: theme.transitions.create("width", {
|
|
|
|
easing: theme.transitions.easing.sharp,
|
|
|
|
duration: theme.transitions.duration.leavingScreen,
|
|
|
|
}),
|
|
|
|
overflowX: "hidden",
|
2021-09-17 02:51:25 +02:00
|
|
|
width: `calc(${theme.spacing(2)} + 1px)`,
|
2021-09-17 01:42:55 +02:00
|
|
|
[theme.breakpoints.up("sm")]: {
|
2021-09-17 02:51:25 +02:00
|
|
|
width: `calc(${theme.spacing(7)} + 1px)`,
|
2021-09-17 01:42:55 +02:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
const Drawer = styled(MuiDrawer, { shouldForwardProp: (prop) => prop !== "open" })(({ theme, open }) => ({
|
2021-09-17 02:51:25 +02:00
|
|
|
width: theme.spacing(31),
|
2021-09-17 01:42:55 +02:00
|
|
|
whiteSpace: "nowrap",
|
|
|
|
boxSizing: "border-box",
|
|
|
|
...(open && {
|
|
|
|
...openedMixin(theme),
|
|
|
|
"& .MuiDrawer-paper": openedMixin(theme),
|
|
|
|
}),
|
|
|
|
...(!open && {
|
|
|
|
...closedMixin(theme),
|
|
|
|
"& .MuiDrawer-paper": closedMixin(theme),
|
|
|
|
}),
|
|
|
|
}));
|
|
|
|
|
2021-09-14 21:23:16 +02:00
|
|
|
const useStyles = makeStyles((theme: Theme) =>
|
|
|
|
createStyles({
|
|
|
|
active: {
|
2021-09-18 01:43:08 +02:00
|
|
|
borderLeft: "3px solid " + theme.palette.primary.main,
|
2021-09-14 21:23:16 +02:00
|
|
|
},
|
2021-09-17 08:07:08 +02:00
|
|
|
listitem: {},
|
2021-09-14 21:23:16 +02:00
|
|
|
}),
|
|
|
|
);
|
|
|
|
|
2023-06-26 10:24:37 +02:00
|
|
|
export function SidebarRoot(props: { page: Page }): React.ReactElement {
|
2023-02-11 19:22:55 +01:00
|
|
|
useRerender(200);
|
2021-09-11 07:54:19 +02:00
|
|
|
|
2022-12-04 09:14:06 +01:00
|
|
|
let flash: Page | null = null;
|
|
|
|
switch (ITutorial.currStep) {
|
|
|
|
case iTutorialSteps.CharacterGoToTerminalPage:
|
|
|
|
case iTutorialSteps.ActiveScriptsPage:
|
|
|
|
flash = Page.Terminal;
|
|
|
|
break;
|
|
|
|
case iTutorialSteps.GoToCharacterPage:
|
|
|
|
flash = Page.Stats;
|
|
|
|
break;
|
|
|
|
case iTutorialSteps.TerminalGoToActiveScriptsPage:
|
|
|
|
flash = Page.ActiveScripts;
|
|
|
|
break;
|
|
|
|
case iTutorialSteps.GoToHacknetNodesPage:
|
|
|
|
flash = Page.Hacknet;
|
|
|
|
break;
|
|
|
|
case iTutorialSteps.HacknetNodesGoToWorldPage:
|
|
|
|
flash = Page.City;
|
|
|
|
break;
|
|
|
|
case iTutorialSteps.WorldDescription:
|
|
|
|
flash = Page.Tutorial;
|
|
|
|
break;
|
|
|
|
}
|
2021-09-11 07:54:19 +02:00
|
|
|
|
2022-09-06 15:07:12 +02:00
|
|
|
const augmentationCount = Player.queuedAugmentations.length;
|
|
|
|
const invitationsCount = Player.factionInvitations.filter((f) => !InvitationsSeen.includes(f)).length;
|
|
|
|
const programCount = getAvailableCreatePrograms().length - ProgramsSeen.length;
|
2021-09-11 07:54:19 +02:00
|
|
|
|
|
|
|
const canOpenFactions =
|
2022-09-06 15:07:12 +02:00
|
|
|
Player.factionInvitations.length > 0 ||
|
|
|
|
Player.factions.length > 0 ||
|
|
|
|
Player.augmentations.length > 0 ||
|
|
|
|
Player.queuedAugmentations.length > 0 ||
|
2023-04-18 09:19:45 +02:00
|
|
|
Player.sourceFiles.size > 0;
|
2021-09-11 07:54:19 +02:00
|
|
|
|
|
|
|
const canOpenAugmentations =
|
2023-04-18 09:19:45 +02:00
|
|
|
Player.augmentations.length > 0 ||
|
|
|
|
Player.queuedAugmentations.length > 0 ||
|
|
|
|
Player.sourceFiles.size > 0 ||
|
|
|
|
Player.exploits.length > 0;
|
2021-09-11 07:54:19 +02:00
|
|
|
|
2022-09-06 15:07:12 +02:00
|
|
|
const canOpenSleeves = Player.sleeves.length > 0;
|
2021-09-11 07:54:19 +02:00
|
|
|
|
2022-09-06 15:07:12 +02:00
|
|
|
const canCorporation = !!Player.corporation;
|
|
|
|
const canGang = !!Player.gang;
|
|
|
|
const canJob = Object.values(Player.jobs).length > 0;
|
|
|
|
const canStockMarket = Player.hasWseAccount;
|
|
|
|
const canBladeburner = !!Player.bladeburner;
|
2023-06-12 06:34:20 +02:00
|
|
|
const canStaneksGift = Player.augmentations.some((aug) => aug.name === AugmentationName.StaneksGift1);
|
2021-09-11 07:54:19 +02:00
|
|
|
|
2021-09-13 00:03:07 +02:00
|
|
|
useEffect(() => {
|
|
|
|
// Shortcuts to navigate through the game
|
|
|
|
// Alt-t - Terminal
|
|
|
|
// Alt-c - Character
|
|
|
|
// Alt-e - Script editor
|
|
|
|
// Alt-s - Active scripts
|
|
|
|
// Alt-h - Hacknet Nodes
|
|
|
|
// Alt-w - City
|
|
|
|
// Alt-j - Job
|
|
|
|
// Alt-r - Travel Agency of current city
|
|
|
|
// Alt-p - Create program
|
|
|
|
// Alt-f - Factions
|
|
|
|
// Alt-a - Augmentations
|
|
|
|
// Alt-u - Tutorial
|
|
|
|
// Alt-o - Options
|
2022-06-29 02:33:39 +02:00
|
|
|
// Alt-b - Bladeburner
|
|
|
|
// Alt-g - Gang
|
2022-07-15 01:02:59 +02:00
|
|
|
function handleShortcuts(this: Document, event: KeyboardEvent): void {
|
2021-09-13 00:03:07 +02:00
|
|
|
if (Settings.DisableHotkeys) return;
|
2022-09-06 15:07:12 +02:00
|
|
|
if ((Player.currentWork && Player.focus) || Router.page() === Page.BitVerse) return;
|
2022-12-04 04:56:42 +01:00
|
|
|
if (event.code === KEYCODE.T && event.altKey) {
|
2021-09-13 00:03:07 +02:00
|
|
|
event.preventDefault();
|
2022-12-04 09:14:06 +01:00
|
|
|
clickPage(Page.Terminal);
|
2022-12-04 04:56:42 +01:00
|
|
|
} else if (event.code === KEYCODE.C && event.altKey) {
|
2021-09-13 00:03:07 +02:00
|
|
|
event.preventDefault();
|
2022-12-04 09:14:06 +01:00
|
|
|
clickPage(Page.Stats);
|
2022-12-04 04:56:42 +01:00
|
|
|
} else if (event.code === KEYCODE.E && event.altKey) {
|
2021-09-13 00:03:07 +02:00
|
|
|
event.preventDefault();
|
2022-12-04 09:14:06 +01:00
|
|
|
clickPage(Page.ScriptEditor);
|
2022-12-04 04:56:42 +01:00
|
|
|
} else if (event.code === KEYCODE.S && event.altKey) {
|
2021-09-13 00:03:07 +02:00
|
|
|
event.preventDefault();
|
2022-12-04 09:14:06 +01:00
|
|
|
clickPage(Page.ActiveScripts);
|
2022-12-04 04:56:42 +01:00
|
|
|
} else if (event.code === KEYCODE.H && event.altKey) {
|
2021-09-13 00:03:07 +02:00
|
|
|
event.preventDefault();
|
2022-12-04 09:14:06 +01:00
|
|
|
clickPage(Page.Hacknet);
|
2022-12-04 04:56:42 +01:00
|
|
|
} else if (event.code === KEYCODE.W && event.altKey) {
|
2021-09-13 00:03:07 +02:00
|
|
|
event.preventDefault();
|
2022-12-04 09:14:06 +01:00
|
|
|
clickPage(Page.City);
|
2022-12-04 04:56:42 +01:00
|
|
|
} else if (event.code === KEYCODE.J && event.altKey && !event.ctrlKey && !event.metaKey && canJob) {
|
2021-12-17 18:35:47 +01:00
|
|
|
// ctrl/cmd + alt + j is shortcut to open Chrome dev tools
|
2021-09-13 00:03:07 +02:00
|
|
|
event.preventDefault();
|
2022-12-04 09:14:06 +01:00
|
|
|
clickPage(Page.Job);
|
2022-12-04 04:56:42 +01:00
|
|
|
} else if (event.code === KEYCODE.R && event.altKey) {
|
2021-09-13 00:03:07 +02:00
|
|
|
event.preventDefault();
|
2022-12-04 09:14:06 +01:00
|
|
|
clickPage(Page.Travel);
|
2022-12-04 04:56:42 +01:00
|
|
|
} else if (event.code === KEYCODE.P && event.altKey) {
|
2021-09-13 00:03:07 +02:00
|
|
|
event.preventDefault();
|
2022-12-04 09:14:06 +01:00
|
|
|
clickPage(Page.CreateProgram);
|
2022-12-04 04:56:42 +01:00
|
|
|
} else if (event.code === KEYCODE.F && event.altKey) {
|
2021-09-22 07:36:17 +02:00
|
|
|
if (props.page == Page.Terminal && Settings.EnableBashHotkeys) {
|
2021-09-13 00:03:07 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
event.preventDefault();
|
2022-12-04 09:14:06 +01:00
|
|
|
clickPage(Page.Factions);
|
2022-12-04 04:56:42 +01:00
|
|
|
} else if (event.code === KEYCODE.A && event.altKey) {
|
2021-09-13 00:03:07 +02:00
|
|
|
event.preventDefault();
|
2022-12-04 09:14:06 +01:00
|
|
|
clickPage(Page.Augmentations);
|
2022-12-04 04:56:42 +01:00
|
|
|
} else if (event.code === KEYCODE.U && event.altKey) {
|
2021-09-13 00:03:07 +02:00
|
|
|
event.preventDefault();
|
2022-12-04 09:14:06 +01:00
|
|
|
clickPage(Page.Tutorial);
|
2022-12-04 04:56:42 +01:00
|
|
|
} else if (event.code === KEYCODE.O && event.altKey) {
|
2022-06-29 02:33:39 +02:00
|
|
|
event.preventDefault();
|
2022-12-04 09:14:06 +01:00
|
|
|
clickPage(Page.Options);
|
2022-12-04 04:56:42 +01:00
|
|
|
} else if (event.code === KEYCODE.B && event.altKey && Player.bladeburner) {
|
2021-09-13 00:03:07 +02:00
|
|
|
event.preventDefault();
|
2022-12-04 09:14:06 +01:00
|
|
|
clickPage(Page.Bladeburner);
|
2022-12-04 04:56:42 +01:00
|
|
|
} else if (event.code === KEYCODE.G && event.altKey && Player.gang) {
|
2021-09-13 00:03:07 +02:00
|
|
|
event.preventDefault();
|
2022-12-04 09:14:06 +01:00
|
|
|
clickPage(Page.Gang);
|
2021-09-13 00:03:07 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-12 20:02:45 +01:00
|
|
|
document.addEventListener("keydown", handleShortcuts);
|
|
|
|
return () => document.removeEventListener("keydown", handleShortcuts);
|
2021-09-13 00:03:07 +02:00
|
|
|
}, []);
|
|
|
|
|
2022-12-04 09:14:06 +01:00
|
|
|
const clickPage = useCallback(
|
|
|
|
(page: Page) => {
|
|
|
|
if (page === Page.Job) {
|
2023-06-26 10:24:37 +02:00
|
|
|
Router.toPage(page, { location: Locations[Object.keys(Player.jobs)[0]] });
|
2022-12-04 09:14:06 +01:00
|
|
|
} else if (page == Page.ScriptEditor) {
|
2023-06-26 10:24:37 +02:00
|
|
|
Router.toPage(page, {});
|
|
|
|
} else if (isSimplePage(page)) {
|
|
|
|
Router.toPage(page);
|
2022-12-04 09:14:06 +01:00
|
|
|
} else {
|
|
|
|
throw new Error("Can't handle click on Page " + page);
|
|
|
|
}
|
|
|
|
if (flash === page) {
|
|
|
|
iTutorialNextStep();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
[flash],
|
|
|
|
);
|
2022-01-16 22:54:10 +01:00
|
|
|
|
2022-12-04 09:14:06 +01:00
|
|
|
const classes = useStyles();
|
|
|
|
const [open, setOpen] = useState(Settings.IsSidebarOpened);
|
|
|
|
const toggleDrawer = (): void =>
|
|
|
|
setOpen((old) => {
|
|
|
|
Settings.IsSidebarOpened = !old;
|
|
|
|
return !old;
|
|
|
|
});
|
2022-12-05 03:05:55 +01:00
|
|
|
const li_classes = useMemo(() => ({ root: classes.listitem }), [classes.listitem]);
|
2022-12-05 05:04:33 +01:00
|
|
|
const ChevronOpenClose = open ? ChevronLeftIcon : ChevronRightIcon;
|
2022-01-16 22:54:10 +01:00
|
|
|
|
2022-12-05 03:05:55 +01:00
|
|
|
// Explicitily useMemo() to save rerendering deep chunks of this tree.
|
|
|
|
// memo() can't be (easily) used on components like <List>, because the
|
|
|
|
// props.children array will be a different object every time.
|
2021-09-11 07:54:19 +02:00
|
|
|
return (
|
2021-09-17 08:04:44 +02:00
|
|
|
<Drawer open={open} anchor="left" variant="permanent">
|
2022-12-05 03:05:55 +01:00
|
|
|
{useMemo(
|
|
|
|
() => (
|
|
|
|
<ListItem classes={li_classes} button onClick={toggleDrawer}>
|
2022-12-05 05:04:33 +01:00
|
|
|
<ListItemIcon>
|
|
|
|
<ChevronOpenClose color={"primary"} />
|
|
|
|
</ListItemIcon>
|
2022-12-05 03:05:55 +01:00
|
|
|
<ListItemText
|
|
|
|
primary={
|
|
|
|
<Tooltip title={hash()}>
|
|
|
|
<Typography>Bitburner v{CONSTANTS.VersionString}</Typography>
|
2022-01-16 23:11:12 +01:00
|
|
|
</Tooltip>
|
2022-12-05 03:05:55 +01:00
|
|
|
}
|
|
|
|
/>
|
2021-09-14 21:23:16 +02:00
|
|
|
</ListItem>
|
2022-12-05 03:05:55 +01:00
|
|
|
),
|
|
|
|
[li_classes, open],
|
|
|
|
)}
|
2022-12-05 05:04:33 +01:00
|
|
|
<Divider />
|
2022-12-05 03:05:55 +01:00
|
|
|
<List>
|
|
|
|
<SidebarAccordion
|
|
|
|
key_="Hacking"
|
|
|
|
page={props.page}
|
|
|
|
clickPage={clickPage}
|
|
|
|
flash={flash}
|
2022-12-05 05:04:33 +01:00
|
|
|
icon={ComputerIcon}
|
2022-12-05 03:05:55 +01:00
|
|
|
sidebarOpen={open}
|
|
|
|
classes={classes}
|
|
|
|
items={[
|
2022-12-05 05:04:33 +01:00
|
|
|
{ key_: Page.Terminal, icon: LastPageIcon },
|
|
|
|
{ key_: Page.ScriptEditor, icon: CreateIcon },
|
|
|
|
{ key_: Page.ActiveScripts, icon: StorageIcon },
|
|
|
|
{ key_: Page.CreateProgram, icon: BugReportIcon, count: programCount },
|
|
|
|
canStaneksGift && { key_: Page.StaneksGift, icon: DeveloperBoardIcon },
|
2022-12-05 03:05:55 +01:00
|
|
|
]}
|
|
|
|
/>
|
2022-12-05 05:04:33 +01:00
|
|
|
<Divider />
|
2022-12-05 03:05:55 +01:00
|
|
|
<SidebarAccordion
|
|
|
|
key_="Character"
|
|
|
|
page={props.page}
|
|
|
|
clickPage={clickPage}
|
|
|
|
flash={flash}
|
2022-12-05 05:04:33 +01:00
|
|
|
icon={AccountBoxIcon}
|
2022-12-05 03:05:55 +01:00
|
|
|
sidebarOpen={open}
|
|
|
|
classes={classes}
|
|
|
|
items={[
|
2022-12-05 05:04:33 +01:00
|
|
|
{ key_: Page.Stats, icon: EqualizerIcon },
|
2022-12-05 03:05:55 +01:00
|
|
|
canOpenFactions && {
|
|
|
|
key_: Page.Factions,
|
2022-12-05 05:04:33 +01:00
|
|
|
icon: ContactsIcon,
|
2022-12-05 03:05:55 +01:00
|
|
|
active: [Page.Factions as Page, Page.Faction].includes(props.page),
|
|
|
|
count: invitationsCount,
|
|
|
|
},
|
|
|
|
canOpenAugmentations && {
|
|
|
|
key_: Page.Augmentations,
|
2022-12-05 05:04:33 +01:00
|
|
|
icon: RotatedDoubleArrowIcon,
|
2022-12-05 03:05:55 +01:00
|
|
|
count: augmentationCount,
|
|
|
|
},
|
2022-12-05 05:04:33 +01:00
|
|
|
{ key_: Page.Hacknet, icon: AccountTreeIcon },
|
|
|
|
canOpenSleeves && { key_: Page.Sleeves, icon: PeopleAltIcon },
|
2022-12-05 03:05:55 +01:00
|
|
|
]}
|
|
|
|
/>
|
2022-12-05 05:04:33 +01:00
|
|
|
<Divider />
|
2022-12-05 03:05:55 +01:00
|
|
|
<SidebarAccordion
|
|
|
|
key_="World"
|
|
|
|
page={props.page}
|
|
|
|
clickPage={clickPage}
|
|
|
|
flash={flash}
|
2022-12-05 05:04:33 +01:00
|
|
|
icon={PublicIcon}
|
2022-12-05 03:05:55 +01:00
|
|
|
sidebarOpen={open}
|
|
|
|
classes={classes}
|
|
|
|
items={[
|
|
|
|
{
|
|
|
|
key_: Page.City,
|
2022-12-05 05:04:33 +01:00
|
|
|
icon: LocationCityIcon,
|
2022-12-05 03:05:55 +01:00
|
|
|
active: [Page.City as Page, Page.Grafting, Page.Location].includes(props.page),
|
|
|
|
},
|
2022-12-05 05:04:33 +01:00
|
|
|
{ key_: Page.Travel, icon: AirplanemodeActiveIcon },
|
|
|
|
canJob && { key_: Page.Job, icon: WorkIcon },
|
|
|
|
canStockMarket && { key_: Page.StockMarket, icon: TrendingUpIcon },
|
|
|
|
canBladeburner && { key_: Page.Bladeburner, icon: FormatBoldIcon },
|
|
|
|
canCorporation && { key_: Page.Corporation, icon: BusinessIcon },
|
|
|
|
canGang && { key_: Page.Gang, icon: SportsMmaIcon },
|
2022-12-05 03:05:55 +01:00
|
|
|
]}
|
|
|
|
/>
|
2022-12-05 05:04:33 +01:00
|
|
|
<Divider />
|
2022-12-05 03:05:55 +01:00
|
|
|
<SidebarAccordion
|
|
|
|
key_="Help"
|
|
|
|
page={props.page}
|
|
|
|
clickPage={clickPage}
|
|
|
|
flash={flash}
|
2022-12-05 05:04:33 +01:00
|
|
|
icon={LiveHelpIcon}
|
2022-12-05 03:05:55 +01:00
|
|
|
sidebarOpen={open}
|
|
|
|
classes={classes}
|
|
|
|
items={[
|
2022-12-05 05:04:33 +01:00
|
|
|
{ key_: Page.Milestones, icon: CheckIcon },
|
|
|
|
{ key_: Page.Tutorial, icon: HelpIcon },
|
|
|
|
{ key_: Page.Achievements, icon: EmojiEventsIcon },
|
|
|
|
{ key_: Page.Options, icon: SettingsIcon },
|
|
|
|
process.env.NODE_ENV === "development" && { key_: Page.DevMenu, icon: DeveloperBoardIcon },
|
2022-12-05 03:05:55 +01:00
|
|
|
]}
|
|
|
|
/>
|
2021-09-17 08:04:44 +02:00
|
|
|
</List>
|
|
|
|
</Drawer>
|
2021-09-11 07:54:19 +02:00
|
|
|
);
|
|
|
|
}
|