mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-03 14:27:03 +02:00
ENUMS: Initial Enum Helper rework + Reorganization (#596)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { Player } from "@player";
|
||||
import React, { useState } from "react";
|
||||
import { Clear, ExpandMore, Reply, ReplyAll } from "@mui/icons-material";
|
||||
import {
|
||||
Accordion,
|
||||
@@ -10,9 +12,7 @@ import {
|
||||
SelectChangeEvent,
|
||||
Typography,
|
||||
} from "@mui/material";
|
||||
import React, { useState } from "react";
|
||||
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames";
|
||||
import { Player } from "@player";
|
||||
import { AugmentationName } from "@enums";
|
||||
|
||||
export function Augmentations(): React.ReactElement {
|
||||
const [augmentation, setAugmentation] = useState("Augmented Targeting I");
|
||||
@@ -25,7 +25,7 @@ export function Augmentations(): React.ReactElement {
|
||||
}
|
||||
|
||||
function queueAllAugs(): void {
|
||||
for (const augName of Object.values(AugmentationNames)) {
|
||||
for (const augName of Object.values(AugmentationName)) {
|
||||
Player.queueAugmentation(augName);
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ export function Augmentations(): React.ReactElement {
|
||||
</>
|
||||
}
|
||||
>
|
||||
{Object.values(AugmentationNames).map((aug) => (
|
||||
{Object.values(AugmentationName).map((aug) => (
|
||||
<MenuItem key={aug} value={aug}>
|
||||
{aug}
|
||||
</MenuItem>
|
||||
|
||||
@@ -15,7 +15,7 @@ import Select, { SelectChangeEvent } from "@mui/material/Select";
|
||||
import DeleteIcon from "@mui/icons-material/Delete";
|
||||
import { Adjuster } from "./Adjuster";
|
||||
import { Player } from "@player";
|
||||
import { CityName } from "../../Enums";
|
||||
import { CityName } from "@enums";
|
||||
import { Skills as AllSkills } from "../../Bladeburner/Skills";
|
||||
import { SkillNames } from "../../Bladeburner/data/SkillNames";
|
||||
|
||||
|
||||
@@ -4,19 +4,19 @@ import Accordion from "@mui/material/Accordion";
|
||||
import AccordionSummary from "@mui/material/AccordionSummary";
|
||||
import AccordionDetails from "@mui/material/AccordionDetails";
|
||||
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
||||
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Button from "@mui/material/Button";
|
||||
import Select, { SelectChangeEvent } from "@mui/material/Select";
|
||||
import { Companies as AllCompanies } from "../../Company/Companies";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
|
||||
import { FactionName } from "@enums";
|
||||
import { Companies as AllCompanies } from "../../Company/Companies";
|
||||
import { Adjuster } from "./Adjuster";
|
||||
import { FactionNames } from "../../Faction/data/FactionNames";
|
||||
|
||||
const bigNumber = 1e12;
|
||||
|
||||
export function Companies(): React.ReactElement {
|
||||
const [company, setCompany] = useState(FactionNames.ECorp as string);
|
||||
const [company, setCompany] = useState(FactionName.ECorp as string);
|
||||
function setCompanyDropdown(event: SelectChangeEvent): void {
|
||||
setCompany(event.target.value);
|
||||
}
|
||||
|
||||
+15
-13
@@ -1,28 +1,30 @@
|
||||
import React, { useState } from "react";
|
||||
|
||||
import Accordion from "@mui/material/Accordion";
|
||||
import AccordionSummary from "@mui/material/AccordionSummary";
|
||||
import AccordionDetails from "@mui/material/AccordionDetails";
|
||||
import { Player } from "@player";
|
||||
import { FactionName } from "@enums";
|
||||
import {
|
||||
Accordion,
|
||||
AccordionSummary,
|
||||
AccordionDetails,
|
||||
Button,
|
||||
FormControl,
|
||||
IconButton,
|
||||
InputLabel,
|
||||
MenuItem,
|
||||
Typography,
|
||||
} from "@mui/material";
|
||||
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
||||
|
||||
import Typography from "@mui/material/Typography";
|
||||
import Button from "@mui/material/Button";
|
||||
import Select, { SelectChangeEvent } from "@mui/material/Select";
|
||||
import { Adjuster } from "./Adjuster";
|
||||
import { Player } from "@player";
|
||||
import { Factions as AllFaction } from "../../Faction/Factions";
|
||||
import FormControl from "@mui/material/FormControl";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import ReplyAllIcon from "@mui/icons-material/ReplyAll";
|
||||
import ReplyIcon from "@mui/icons-material/Reply";
|
||||
import InputLabel from "@mui/material/InputLabel";
|
||||
import { FactionNames } from "../../Faction/data/FactionNames";
|
||||
|
||||
const bigNumber = 1e12;
|
||||
|
||||
export function Factions(): React.ReactElement {
|
||||
const [faction, setFaction] = useState(FactionNames.Illuminati as string);
|
||||
const [faction, setFaction] = useState(FactionName.Illuminati as string);
|
||||
|
||||
function setFactionDropdown(event: SelectChangeEvent): void {
|
||||
setFaction(event.target.value);
|
||||
@@ -33,7 +35,7 @@ export function Factions(): React.ReactElement {
|
||||
}
|
||||
|
||||
function receiveAllInvites(): void {
|
||||
Object.values(FactionNames).forEach((faction) => Player.receiveInvite(faction));
|
||||
Object.values(FactionName).forEach((faction) => Player.receiveInvite(faction));
|
||||
}
|
||||
|
||||
function modifyFactionRep(modifier: number): (x: number) => void {
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Router } from "../../ui/GameRoot";
|
||||
import { MenuItem, SelectChangeEvent, TextField, Select } from "@mui/material";
|
||||
import { Bladeburner } from "../../Bladeburner/Bladeburner";
|
||||
import { GangConstants } from "../../Gang/data/Constants";
|
||||
import { FactionNames } from "../../Faction/data/FactionNames";
|
||||
import { FactionName } from "@enums";
|
||||
import { checkForMessagesToSend } from "../../Message/MessageHelpers";
|
||||
import { ThemeEvents } from "../../Themes/ui/Theme";
|
||||
|
||||
@@ -61,7 +61,7 @@ export function General(): React.ReactElement {
|
||||
|
||||
// Gang functions
|
||||
const startGang = () => {
|
||||
const isHacking = gangFaction === FactionNames.NiteSec || gangFaction === FactionNames.TheBlackHand;
|
||||
const isHacking = gangFaction === FactionName.NiteSec || gangFaction === FactionName.TheBlackHand;
|
||||
Player.startGang(gangFaction, isHacking);
|
||||
// Rerender so the gang menu option will show up immediately on the devmenu page selection
|
||||
ThemeEvents.emit();
|
||||
|
||||
@@ -10,7 +10,7 @@ import Button from "@mui/material/Button";
|
||||
import Select, { SelectChangeEvent } from "@mui/material/Select";
|
||||
import { Player } from "@player";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import { CompletedProgramName } from "../../Programs/Programs";
|
||||
import { CompletedProgramName } from "@enums";
|
||||
|
||||
export function Programs(): React.ReactElement {
|
||||
const [program, setProgram] = useState(CompletedProgramName.bruteSsh);
|
||||
|
||||
@@ -7,7 +7,8 @@ import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
||||
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { saveObject } from "../../SaveObject";
|
||||
import { SnackbarEvents, ToastVariant } from "../../ui/React/Snackbar";
|
||||
import { SnackbarEvents } from "../../ui/React/Snackbar";
|
||||
import { ToastVariant } from "@enums";
|
||||
import { Upload } from "@mui/icons-material";
|
||||
import { Button } from "@mui/material";
|
||||
import { OptionSwitch } from "../../ui/React/OptionSwitch";
|
||||
|
||||
Reference in New Issue
Block a user