mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 17:43:48 +01:00
litn
This commit is contained in:
parent
05fd85002c
commit
2d463b60a0
@ -1,30 +1,8 @@
|
|||||||
import { AugmentationNames } from "./Augmentation/data/AugmentationNames";
|
|
||||||
import { CodingContractTypes } from "./CodingContracts";
|
|
||||||
import { generateContract, generateRandomContract, generateRandomContractOnHome } from "./CodingContractGenerator";
|
|
||||||
import { IPlayer } from "./PersonObjects/IPlayer";
|
import { IPlayer } from "./PersonObjects/IPlayer";
|
||||||
import { Bladeburner } from "./Bladeburner/Bladeburner";
|
import { Bladeburner } from "./Bladeburner/Bladeburner";
|
||||||
import { IEngine } from "./IEngine";
|
import { IEngine } from "./IEngine";
|
||||||
import { saveObject } from "./SaveObject";
|
|
||||||
|
|
||||||
import { dialogBoxCreate } from "../utils/DialogBox";
|
import React from "react";
|
||||||
import { Money } from "./ui/React/Money";
|
|
||||||
import { TextField } from "./ui/React/TextField";
|
|
||||||
import { Button } from "./ui/React/Button";
|
|
||||||
import { Select } from "./ui/React/Select";
|
|
||||||
|
|
||||||
import React, { useState } from "react";
|
|
||||||
import AddIcon from "@material-ui/icons/Add";
|
|
||||||
import RemoveIcon from "@material-ui/icons/Remove";
|
|
||||||
import IconButton from "@material-ui/core/IconButton";
|
|
||||||
import ExposureZeroIcon from "@material-ui/icons/ExposureZero";
|
|
||||||
import ButtonGroup from "@material-ui/core/ButtonGroup";
|
|
||||||
import DoubleArrowIcon from "@material-ui/icons/DoubleArrow";
|
|
||||||
import ReplyAllIcon from "@material-ui/icons/ReplyAll";
|
|
||||||
import ReplyIcon from "@material-ui/icons/Reply";
|
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
|
||||||
import MenuItem from "@material-ui/core/MenuItem";
|
|
||||||
import FormControl from "@material-ui/core/FormControl";
|
|
||||||
import InputLabel from "@material-ui/core/InputLabel";
|
|
||||||
import { Theme } from "./ui/React/Theme";
|
import { Theme } from "./ui/React/Theme";
|
||||||
|
|
||||||
import { General } from "./DevMenu/ui/General";
|
import { General } from "./DevMenu/ui/General";
|
||||||
@ -59,8 +37,8 @@ export function DevMenuRoot(props: IProps): React.ReactElement {
|
|||||||
<Augmentations player={props.player} />
|
<Augmentations player={props.player} />
|
||||||
<SourceFiles player={props.player} />
|
<SourceFiles player={props.player} />
|
||||||
<Programs player={props.player} />
|
<Programs player={props.player} />
|
||||||
<Servers player={props.player} />
|
<Servers />
|
||||||
<Companies player={props.player} />
|
<Companies />
|
||||||
|
|
||||||
{props.player.bladeburner instanceof Bladeburner && <BladeburnerElem player={props.player} />}
|
{props.player.bladeburner instanceof Bladeburner && <BladeburnerElem player={props.player} />}
|
||||||
|
|
||||||
@ -68,9 +46,9 @@ export function DevMenuRoot(props: IProps): React.ReactElement {
|
|||||||
|
|
||||||
{props.player.hasCorporation() && <Corporation player={props.player} />}
|
{props.player.hasCorporation() && <Corporation player={props.player} />}
|
||||||
|
|
||||||
<CodingContracts player={props.player} />
|
<CodingContracts />
|
||||||
|
|
||||||
{props.player.hasWseAccount && <StockMarket player={props.player} />}
|
{props.player.hasWseAccount && <StockMarket />}
|
||||||
|
|
||||||
{props.player.sleeves.length > 0 && <Sleeves player={props.player} />}
|
{props.player.sleeves.length > 0 && <Sleeves player={props.player} />}
|
||||||
|
|
||||||
|
@ -4,7 +4,8 @@ import RemoveIcon from "@material-ui/icons/Remove";
|
|||||||
import IconButton from "@material-ui/core/IconButton";
|
import IconButton from "@material-ui/core/IconButton";
|
||||||
import ExposureZeroIcon from "@material-ui/icons/ExposureZero";
|
import ExposureZeroIcon from "@material-ui/icons/ExposureZero";
|
||||||
import DoubleArrowIcon from "@material-ui/icons/DoubleArrow";
|
import DoubleArrowIcon from "@material-ui/icons/DoubleArrow";
|
||||||
import { TextField } from "../../ui/React/TextField";
|
import TextField from "@material-ui/core/TextField";
|
||||||
|
import Tooltip from "@material-ui/core/Tooltip";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
label: string;
|
label: string;
|
||||||
@ -35,22 +36,30 @@ export function Adjuster(props: IProps): React.ReactElement {
|
|||||||
InputProps={{
|
InputProps={{
|
||||||
startAdornment: (
|
startAdornment: (
|
||||||
<>
|
<>
|
||||||
|
<Tooltip title="Add a lot">
|
||||||
<IconButton color="primary" onClick={tons}>
|
<IconButton color="primary" onClick={tons}>
|
||||||
<DoubleArrowIcon style={{ transform: "rotate(-90deg)" }} />
|
<DoubleArrowIcon style={{ transform: "rotate(-90deg)" }} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
|
<Tooltip title="Add">
|
||||||
<IconButton color="primary" onClick={() => add(typeof value !== "string" ? value : 0)}>
|
<IconButton color="primary" onClick={() => add(typeof value !== "string" ? value : 0)}>
|
||||||
<AddIcon />
|
<AddIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
endAdornment: (
|
endAdornment: (
|
||||||
<>
|
<>
|
||||||
|
<Tooltip title="Remove">
|
||||||
<IconButton color="primary" onClick={() => subtract(typeof value !== "string" ? value : 0)}>
|
<IconButton color="primary" onClick={() => subtract(typeof value !== "string" ? value : 0)}>
|
||||||
<RemoveIcon />
|
<RemoveIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
|
<Tooltip title="Reset">
|
||||||
<IconButton color="primary" onClick={reset}>
|
<IconButton color="primary" onClick={reset}>
|
||||||
<ExposureZeroIcon />
|
<ExposureZeroIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
</Tooltip>
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
|
@ -5,8 +5,7 @@ import AccordionSummary from "@material-ui/core/AccordionSummary";
|
|||||||
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||||
|
|
||||||
import { Button } from "../../ui/React/Button";
|
import Select from "@material-ui/core/Select";
|
||||||
import { Select } from "../../ui/React/Select";
|
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||||
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames";
|
import { AugmentationNames } from "../../Augmentation/data/AugmentationNames";
|
||||||
import MenuItem from "@material-ui/core/MenuItem";
|
import MenuItem from "@material-ui/core/MenuItem";
|
||||||
@ -14,8 +13,6 @@ import IconButton from "@material-ui/core/IconButton";
|
|||||||
import ReplyAllIcon from "@material-ui/icons/ReplyAll";
|
import ReplyAllIcon from "@material-ui/icons/ReplyAll";
|
||||||
import ReplyIcon from "@material-ui/icons/Reply";
|
import ReplyIcon from "@material-ui/icons/Reply";
|
||||||
|
|
||||||
const bigNumber = 1e27;
|
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
player: IPlayer;
|
player: IPlayer;
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import AccordionSummary from "@material-ui/core/AccordionSummary";
|
|||||||
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||||
|
|
||||||
import { Button } from "../../ui/React/Button";
|
|
||||||
import { Adjuster } from "./Adjuster";
|
import { Adjuster } from "./Adjuster";
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||||
|
|
||||||
|
@ -5,24 +5,13 @@ import AccordionSummary from "@material-ui/core/AccordionSummary";
|
|||||||
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||||
|
|
||||||
import { Button } from "../../ui/React/Button";
|
import Button from "@material-ui/core/Button";
|
||||||
import { Select } from "../../ui/React/Select";
|
import Select from "@material-ui/core/Select";
|
||||||
import { PlayerOwnedSourceFile } from "../../SourceFile/PlayerOwnedSourceFile";
|
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
|
||||||
import { generateContract, generateRandomContract, generateRandomContractOnHome } from "../../CodingContractGenerator";
|
|
||||||
import ButtonGroup from "@material-ui/core/ButtonGroup";
|
|
||||||
import MenuItem from "@material-ui/core/MenuItem";
|
import MenuItem from "@material-ui/core/MenuItem";
|
||||||
|
import { generateContract, generateRandomContract, generateRandomContractOnHome } from "../../CodingContractGenerator";
|
||||||
import { CodingContractTypes } from "../../CodingContracts";
|
import { CodingContractTypes } from "../../CodingContracts";
|
||||||
|
|
||||||
// Update as additional BitNodes get implemented
|
export function CodingContracts(): React.ReactElement {
|
||||||
const validSFN = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
||||||
const bigNumber = 1e27;
|
|
||||||
|
|
||||||
interface IProps {
|
|
||||||
player: IPlayer;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function CodingContracts(props: IProps): React.ReactElement {
|
|
||||||
const [codingcontract, setCodingcontract] = useState("Find Largest Prime Factor");
|
const [codingcontract, setCodingcontract] = useState("Find Largest Prime Factor");
|
||||||
function setCodingcontractDropdown(event: React.ChangeEvent<{ value: unknown }>): void {
|
function setCodingcontractDropdown(event: React.ChangeEvent<{ value: unknown }>): void {
|
||||||
setCodingcontract(event.target.value as string);
|
setCodingcontract(event.target.value as string);
|
||||||
|
@ -5,25 +5,15 @@ import AccordionSummary from "@material-ui/core/AccordionSummary";
|
|||||||
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||||
|
|
||||||
import { Button } from "../../ui/React/Button";
|
import Button from "@material-ui/core/Button";
|
||||||
import { Select } from "../../ui/React/Select";
|
import Select from "@material-ui/core/Select";
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
|
||||||
import { Companies as AllCompanies } from "../../Company/Companies";
|
import { Companies as AllCompanies } from "../../Company/Companies";
|
||||||
import FormControl from "@material-ui/core/FormControl";
|
|
||||||
import MenuItem from "@material-ui/core/MenuItem";
|
import MenuItem from "@material-ui/core/MenuItem";
|
||||||
import IconButton from "@material-ui/core/IconButton";
|
|
||||||
import ReplyAllIcon from "@material-ui/icons/ReplyAll";
|
|
||||||
import ReplyIcon from "@material-ui/icons/Reply";
|
|
||||||
import InputLabel from "@material-ui/core/InputLabel";
|
|
||||||
import { Adjuster } from "./Adjuster";
|
import { Adjuster } from "./Adjuster";
|
||||||
|
|
||||||
const bigNumber = 1e12;
|
const bigNumber = 1e12;
|
||||||
|
|
||||||
interface IProps {
|
export function Companies(): React.ReactElement {
|
||||||
player: IPlayer;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function Companies(props: IProps): React.ReactElement {
|
|
||||||
const [company, setCompany] = useState("ECorp");
|
const [company, setCompany] = useState("ECorp");
|
||||||
function setCompanyDropdown(event: React.ChangeEvent<{ value: unknown }>): void {
|
function setCompanyDropdown(event: React.ChangeEvent<{ value: unknown }>): void {
|
||||||
setCompany(event.target.value as string);
|
setCompany(event.target.value as string);
|
||||||
|
@ -5,7 +5,7 @@ import AccordionSummary from "@material-ui/core/AccordionSummary";
|
|||||||
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||||
|
|
||||||
import { Button } from "../../ui/React/Button";
|
import Button from "@material-ui/core/Button";
|
||||||
import { Adjuster } from "./Adjuster";
|
import { Adjuster } from "./Adjuster";
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@ import AccordionSummary from "@material-ui/core/AccordionSummary";
|
|||||||
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||||
|
|
||||||
import { Button } from "../../ui/React/Button";
|
import Button from "@material-ui/core/Button";
|
||||||
import { Select } from "../../ui/React/Select";
|
import Select from "@material-ui/core/Select";
|
||||||
import { Adjuster } from "./Adjuster";
|
import { Adjuster } from "./Adjuster";
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||||
import { Factions as AllFaction } from "../../Faction/Factions";
|
import { Factions as AllFaction } from "../../Faction/Factions";
|
||||||
|
@ -5,7 +5,6 @@ import AccordionSummary from "@material-ui/core/AccordionSummary";
|
|||||||
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||||
|
|
||||||
import { Button } from "../../ui/React/Button";
|
|
||||||
import { Adjuster } from "./Adjuster";
|
import { Adjuster } from "./Adjuster";
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import AccordionSummary from "@material-ui/core/AccordionSummary";
|
|||||||
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||||
|
|
||||||
import { Button } from "../../ui/React/Button";
|
import Button from "@material-ui/core/Button";
|
||||||
import { Money } from "../../ui/React/Money";
|
import { Money } from "../../ui/React/Money";
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||||
import { hackWorldDaemon } from "../../RedPill";
|
import { hackWorldDaemon } from "../../RedPill";
|
||||||
|
@ -5,18 +5,11 @@ import AccordionSummary from "@material-ui/core/AccordionSummary";
|
|||||||
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||||
|
|
||||||
import { Button } from "../../ui/React/Button";
|
import Button from "@material-ui/core/Button";
|
||||||
import { Select } from "../../ui/React/Select";
|
import Select from "@material-ui/core/Select";
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||||
import { Programs as AllPrograms } from "../../Programs/Programs";
|
import { Programs as AllPrograms } from "../../Programs/Programs";
|
||||||
import FormControl from "@material-ui/core/FormControl";
|
|
||||||
import MenuItem from "@material-ui/core/MenuItem";
|
import MenuItem from "@material-ui/core/MenuItem";
|
||||||
import IconButton from "@material-ui/core/IconButton";
|
|
||||||
import ReplyAllIcon from "@material-ui/icons/ReplyAll";
|
|
||||||
import ReplyIcon from "@material-ui/icons/Reply";
|
|
||||||
import InputLabel from "@material-ui/core/InputLabel";
|
|
||||||
|
|
||||||
const bigNumber = 1e12;
|
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
player: IPlayer;
|
player: IPlayer;
|
||||||
|
@ -5,26 +5,14 @@ import AccordionSummary from "@material-ui/core/AccordionSummary";
|
|||||||
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||||
|
|
||||||
import { Button } from "../../ui/React/Button";
|
import Button from "@material-ui/core/Button";
|
||||||
import { Select } from "../../ui/React/Select";
|
import Select from "@material-ui/core/Select";
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
|
||||||
import { AllServers } from "../../Server/AllServers";
|
import { AllServers } from "../../Server/AllServers";
|
||||||
import { HacknetServer } from "../../Hacknet/HacknetServer";
|
import { HacknetServer } from "../../Hacknet/HacknetServer";
|
||||||
import { GetServerByHostname } from "../../Server/ServerHelpers";
|
import { GetServerByHostname } from "../../Server/ServerHelpers";
|
||||||
import FormControl from "@material-ui/core/FormControl";
|
|
||||||
import MenuItem from "@material-ui/core/MenuItem";
|
import MenuItem from "@material-ui/core/MenuItem";
|
||||||
import IconButton from "@material-ui/core/IconButton";
|
|
||||||
import ReplyAllIcon from "@material-ui/icons/ReplyAll";
|
|
||||||
import ReplyIcon from "@material-ui/icons/Reply";
|
|
||||||
import InputLabel from "@material-ui/core/InputLabel";
|
|
||||||
|
|
||||||
const bigNumber = 1e12;
|
export function Servers(): React.ReactElement {
|
||||||
|
|
||||||
interface IProps {
|
|
||||||
player: IPlayer;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function Servers(props: IProps): React.ReactElement {
|
|
||||||
const [server, setServer] = useState("home");
|
const [server, setServer] = useState("home");
|
||||||
function setServerDropdown(event: React.ChangeEvent<{ value: unknown }>): void {
|
function setServerDropdown(event: React.ChangeEvent<{ value: unknown }>): void {
|
||||||
setServer(event.target.value as string);
|
setServer(event.target.value as string);
|
||||||
|
@ -5,14 +5,8 @@ import AccordionSummary from "@material-ui/core/AccordionSummary";
|
|||||||
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||||
|
|
||||||
import { Button } from "../../ui/React/Button";
|
import Button from "@material-ui/core/Button";
|
||||||
import { PlayerOwnedSourceFile } from "../../SourceFile/PlayerOwnedSourceFile";
|
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||||
import ButtonGroup from "@material-ui/core/ButtonGroup";
|
|
||||||
|
|
||||||
// Update as additional BitNodes get implemented
|
|
||||||
const validSFN = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
||||||
const bigNumber = 1e27;
|
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
player: IPlayer;
|
player: IPlayer;
|
||||||
|
@ -5,14 +5,13 @@ import AccordionSummary from "@material-ui/core/AccordionSummary";
|
|||||||
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||||
|
|
||||||
import { Button } from "../../ui/React/Button";
|
import Button from "@material-ui/core/Button";
|
||||||
import { PlayerOwnedSourceFile } from "../../SourceFile/PlayerOwnedSourceFile";
|
import { PlayerOwnedSourceFile } from "../../SourceFile/PlayerOwnedSourceFile";
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||||
import ButtonGroup from "@material-ui/core/ButtonGroup";
|
import ButtonGroup from "@material-ui/core/ButtonGroup";
|
||||||
|
|
||||||
// Update as additional BitNodes get implemented
|
// Update as additional BitNodes get implemented
|
||||||
const validSFN = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
const validSFN = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
||||||
const bigNumber = 1e27;
|
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
player: IPlayer;
|
player: IPlayer;
|
||||||
|
@ -5,7 +5,7 @@ import AccordionSummary from "@material-ui/core/AccordionSummary";
|
|||||||
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||||
|
|
||||||
import { Button } from "../../ui/React/Button";
|
import Button from "@material-ui/core/Button";
|
||||||
import { Adjuster } from "./Adjuster";
|
import { Adjuster } from "./Adjuster";
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||||
|
|
||||||
|
@ -5,22 +5,14 @@ import AccordionSummary from "@material-ui/core/AccordionSummary";
|
|||||||
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||||
|
|
||||||
import { Button } from "../../ui/React/Button";
|
import Button from "@material-ui/core/Button";
|
||||||
import { TextField } from "../../ui/React/TextField";
|
import TextField from "@material-ui/core/TextField";
|
||||||
import { Money } from "../../ui/React/Money";
|
import { Money } from "../../ui/React/Money";
|
||||||
import { Adjuster } from "./Adjuster";
|
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
|
||||||
import { dialogBoxCreate } from "../../../utils/DialogBox";
|
import { dialogBoxCreate } from "../../../utils/DialogBox";
|
||||||
import { StockMarket as SM } from "../../StockMarket/StockMarket";
|
import { StockMarket as SM } from "../../StockMarket/StockMarket";
|
||||||
import { Stock } from "../../StockMarket/Stock";
|
import { Stock } from "../../StockMarket/Stock";
|
||||||
|
|
||||||
const bigNumber = 1e27;
|
export function StockMarket(): React.ReactElement {
|
||||||
|
|
||||||
interface IProps {
|
|
||||||
player: IPlayer;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function StockMarket(props: IProps): React.ReactElement {
|
|
||||||
const [stockPrice, setStockPrice] = useState(0);
|
const [stockPrice, setStockPrice] = useState(0);
|
||||||
const [stockSymbol, setStockSymbol] = useState("");
|
const [stockSymbol, setStockSymbol] = useState("");
|
||||||
|
|
||||||
|
@ -5,16 +5,12 @@ import AccordionSummary from "@material-ui/core/AccordionSummary";
|
|||||||
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
import AccordionDetails from "@material-ui/core/AccordionDetails";
|
||||||
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
|
||||||
|
|
||||||
import { Button } from "../../ui/React/Button";
|
import Button from "@material-ui/core/Button";
|
||||||
import { PlayerOwnedSourceFile } from "../../SourceFile/PlayerOwnedSourceFile";
|
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||||
import ButtonGroup from "@material-ui/core/ButtonGroup";
|
|
||||||
import { saveObject } from "../../SaveObject";
|
import { saveObject } from "../../SaveObject";
|
||||||
import { IEngine } from "../../IEngine";
|
import { IEngine } from "../../IEngine";
|
||||||
|
|
||||||
// Update as additional BitNodes get implemented
|
// Update as additional BitNodes get implemented
|
||||||
const validSFN = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
||||||
const bigNumber = 1e27;
|
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
player: IPlayer;
|
player: IPlayer;
|
||||||
|
@ -61,7 +61,7 @@ function ListWorldMap(props: IProps): React.ReactElement {
|
|||||||
{Object.values(CityName)
|
{Object.values(CityName)
|
||||||
.filter((city: string) => city != props.p.city)
|
.filter((city: string) => city != props.p.city)
|
||||||
.map((city: string) => {
|
.map((city: string) => {
|
||||||
const match = Object.entries(CityName).find(([key, value]) => value === city);
|
const match = Object.entries(CityName).find((entry) => entry[1] === city);
|
||||||
if (match === undefined) throw new Error(`could not find key for city '${city}'`);
|
if (match === undefined) throw new Error(`could not find key for city '${city}'`);
|
||||||
return (
|
return (
|
||||||
<StdButton
|
<StdButton
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
/**
|
|
||||||
* Wrapper around material-ui's Button component that styles it with
|
|
||||||
* Bitburner's UI theme
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from "react";
|
|
||||||
import { Button as MuiButton, ButtonProps, makeStyles } from "@material-ui/core";
|
|
||||||
import { colors } from "./Theme";
|
|
||||||
|
|
||||||
const useStyles = makeStyles({
|
|
||||||
// Tries to emulate StdButton in buttons.scss
|
|
||||||
root: {
|
|
||||||
backgroundColor: "#333",
|
|
||||||
border: "1px solid #000",
|
|
||||||
color: colors.primary,
|
|
||||||
margin: "5px",
|
|
||||||
padding: "3px 5px",
|
|
||||||
"&:hover": {
|
|
||||||
backgroundColor: "#000",
|
|
||||||
},
|
|
||||||
|
|
||||||
borderRadius: 0,
|
|
||||||
},
|
|
||||||
textPrimary: {
|
|
||||||
color: "rgb( 144, 202, 249)",
|
|
||||||
},
|
|
||||||
textSecondary: {
|
|
||||||
color: "rgb(244, 143, 177)",
|
|
||||||
},
|
|
||||||
disabled: {
|
|
||||||
backgroundColor: "#333",
|
|
||||||
color: "#fff",
|
|
||||||
cursor: "default",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const Button: React.FC<ButtonProps> = (props: ButtonProps) => {
|
|
||||||
return (
|
|
||||||
<MuiButton
|
|
||||||
{...props}
|
|
||||||
classes={{
|
|
||||||
...useStyles(),
|
|
||||||
...props.classes,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
@ -1,19 +0,0 @@
|
|||||||
/**
|
|
||||||
* Wrapper around material-ui's Button component that styles it with
|
|
||||||
* Bitburner's UI colors
|
|
||||||
*/
|
|
||||||
|
|
||||||
import React from "react";
|
|
||||||
import { TextField as MuiTF, TextFieldProps, makeStyles } from "@material-ui/core";
|
|
||||||
import { colors } from "./Theme";
|
|
||||||
|
|
||||||
export const TextField: React.FC<TextFieldProps> = (props: TextFieldProps) => {
|
|
||||||
return (
|
|
||||||
<MuiTF
|
|
||||||
{...props}
|
|
||||||
classes={{
|
|
||||||
...props.classes,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
};
|
|
@ -1,7 +1,5 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { createMuiTheme } from "@material-ui/core/styles";
|
import { createMuiTheme, ThemeProvider } from "@material-ui/core/styles";
|
||||||
|
|
||||||
import { ThemeProvider } from "@material-ui/core/styles";
|
|
||||||
|
|
||||||
export const colors = {
|
export const colors = {
|
||||||
primarylight: "#0f0",
|
primarylight: "#0f0",
|
||||||
@ -41,7 +39,7 @@ export const theme = createMuiTheme({
|
|||||||
borderBottomColor: "#fff",
|
borderBottomColor: "#fff",
|
||||||
},
|
},
|
||||||
underline: {
|
underline: {
|
||||||
"&:hover:before": {
|
"&:hover": {
|
||||||
borderBottomColor: colors.primarydark,
|
borderBottomColor: colors.primarydark,
|
||||||
},
|
},
|
||||||
"&:before": {
|
"&:before": {
|
||||||
@ -61,6 +59,20 @@ export const theme = createMuiTheme({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
MuiButton: {
|
||||||
|
root: {
|
||||||
|
backgroundColor: "#333",
|
||||||
|
border: "1px solid " + colors.well,
|
||||||
|
color: colors.primary,
|
||||||
|
margin: "5px",
|
||||||
|
padding: "3px 5px",
|
||||||
|
"&:hover": {
|
||||||
|
backgroundColor: "#000",
|
||||||
|
},
|
||||||
|
|
||||||
|
borderRadius: 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
MuiSelect: {
|
MuiSelect: {
|
||||||
icon: {
|
icon: {
|
||||||
color: colors.primary,
|
color: colors.primary,
|
||||||
@ -86,6 +98,20 @@ export const theme = createMuiTheme({
|
|||||||
backgroundColor: "#000",
|
backgroundColor: "#000",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
MuiIconButton: {
|
||||||
|
root: {
|
||||||
|
color: colors.primary,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
MuiTooltip: {
|
||||||
|
tooltip: {
|
||||||
|
fontSize: "1em",
|
||||||
|
color: colors.primary,
|
||||||
|
backgroundColor: colors.well,
|
||||||
|
borderRadius: 0,
|
||||||
|
border: "2px solid white",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user