build gang in mui

This commit is contained in:
Olivier Gagnon
2021-10-01 15:39:56 -04:00
parent 9cbb525da3
commit 5ba7b2796d
33 changed files with 50 additions and 96 deletions

66
dist/vendor.bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -6,13 +6,12 @@ import { enterBitNode, setRedPillFlag } from "../../RedPill";
import { PortalModal } from "./PortalModal"; import { PortalModal } from "./PortalModal";
import { CinematicText } from "../../ui/React/CinematicText"; import { CinematicText } from "../../ui/React/CinematicText";
import { use } from "../../ui/Context"; import { use } from "../../ui/Context";
import { Theme } from "@mui/material";
import makeStyles from "@mui/styles/makeStyles"; import makeStyles from "@mui/styles/makeStyles";
import createStyles from "@mui/styles/createStyles"; import createStyles from "@mui/styles/createStyles";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";
import Tooltip from "@mui/material/Tooltip"; import Tooltip from "@mui/material/Tooltip";
const useStyles = makeStyles((theme: Theme) => const useStyles = makeStyles(() =>
createStyles({ createStyles({
level0: { level0: {
color: "red", color: "red",

View File

@ -1,4 +1,3 @@
import React from "react";
import { Player } from "../Player"; import { Player } from "../Player";
import { getRandomInt } from "../utils/helpers/getRandomInt"; import { getRandomInt } from "../utils/helpers/getRandomInt";
import { addOffset } from "../utils/helpers/addOffset"; import { addOffset } from "../utils/helpers/addOffset";

View File

@ -1,4 +1,3 @@
import React from "react";
import { BlackOperation } from "./BlackOperation"; import { BlackOperation } from "./BlackOperation";
import { IMap } from "../types"; import { IMap } from "../types";

View File

@ -1,4 +1,3 @@
import React from "react";
import { Reviver, Generic_toJSON, Generic_fromJSON } from "../utils/JSONReviver"; import { Reviver, Generic_toJSON, Generic_fromJSON } from "../utils/JSONReviver";
import { IBladeburner } from "./IBladeburner"; import { IBladeburner } from "./IBladeburner";
import { IActionIdentifier } from "./IActionIdentifier"; import { IActionIdentifier } from "./IActionIdentifier";

View File

@ -1,4 +1,3 @@
import React from "react";
import { Action } from "./Action"; import { Action } from "./Action";
import { IMap } from "../types"; import { IMap } from "../types";

View File

@ -37,9 +37,7 @@ export function SkillElem(props: IProps): React.ReactElement {
return ( return (
<Paper sx={{ my: 1, p: 1 }}> <Paper sx={{ my: 1, p: 1 }}>
<Box display="flex" flexDirection="row" alignItems="center"> <Box display="flex" flexDirection="row" alignItems="center">
<Typography> <CopyableText variant="h6" color="primary" value={props.skill.name} />
<CopyableText value={props.skill.name} />
</Typography>
{!canLevel || maxLvl ? ( {!canLevel || maxLvl ? (
<IconButton disabled> <IconButton disabled>
<CloseIcon /> <CloseIcon />
@ -50,8 +48,6 @@ export function SkillElem(props: IProps): React.ReactElement {
</IconButton> </IconButton>
)} )}
</Box> </Box>
<br />
<br />
<Typography>Level: {currentLevel}</Typography> <Typography>Level: {currentLevel}</Typography>
{maxLvl ? ( {maxLvl ? (
<Typography>MAX LEVEL</Typography> <Typography>MAX LEVEL</Typography>

View File

@ -26,12 +26,9 @@ export function SkillPage(props: IProps): React.ReactElement {
You will gain one skill point every{" "} You will gain one skill point every{" "}
{BladeburnerConstants.RanksPerSkillPoint * BitNodeMultipliers.BladeburnerSkillCost} ranks. {BladeburnerConstants.RanksPerSkillPoint * BitNodeMultipliers.BladeburnerSkillCost} ranks.
<br /> <br />
<br />
Note that when upgrading a skill, the benefit for that skill is additive. However, the effects of different Note that when upgrading a skill, the benefit for that skill is additive. However, the effects of different
skills with each other is multiplicative. skills with each other is multiplicative.
<br />
</Typography> </Typography>
<br />
{valid(mults["successChanceAll"]) && ( {valid(mults["successChanceAll"]) && (
<Typography>Total Success Chance: x{formatNumber(mults["successChanceAll"], 3)}</Typography> <Typography>Total Success Chance: x{formatNumber(mults["successChanceAll"], 3)}</Typography>
)} )}
@ -61,7 +58,6 @@ export function SkillPage(props: IProps): React.ReactElement {
{valid(mults["stamina"]) && <Typography>Stamina: x{formatNumber(mults["stamina"], 3)}</Typography>} {valid(mults["stamina"]) && <Typography>Stamina: x{formatNumber(mults["stamina"], 3)}</Typography>}
{valid(mults["money"]) && <Typography>Contract Money: x{formatNumber(mults["money"], 3)}</Typography>} {valid(mults["money"]) && <Typography>Contract Money: x{formatNumber(mults["money"], 3)}</Typography>}
{valid(mults["expGain"]) && <Typography>Exp Gain: x{formatNumber(mults["expGain"], 3)}</Typography>} {valid(mults["expGain"]) && <Typography>Exp Gain: x{formatNumber(mults["expGain"], 3)}</Typography>}
<br />
<SkillList bladeburner={props.bladeburner} onUpgrade={() => setRerender((old) => !old)} /> <SkillList bladeburner={props.bladeburner} onUpgrade={() => setRerender((old) => !old)} />
</> </>
); );

View File

@ -3,7 +3,6 @@ import { Card, Suit } from "./Card";
import makeStyles from "@mui/styles/makeStyles"; import makeStyles from "@mui/styles/makeStyles";
import createStyles from "@mui/styles/createStyles"; import createStyles from "@mui/styles/createStyles";
import Typography from "@mui/material/Typography";
import Paper from "@mui/material/Paper"; import Paper from "@mui/material/Paper";
type Props = { type Props = {

View File

@ -13,14 +13,6 @@ type IProps = {
p: IPlayer; p: IPlayer;
}; };
type IState = {
index: number[];
locks: number[];
investment: number;
canPlay: boolean;
status: string | JSX.Element;
};
// statically shuffled array of symbols. // statically shuffled array of symbols.
const symbols = [ const symbols = [
"D", "D",

View File

@ -1,11 +1,8 @@
import { CorporationConstants } from "./data/Constants"; import { CorporationConstants } from "./data/Constants";
import { getRandomInt } from "../utils/helpers/getRandomInt"; import { getRandomInt } from "../utils/helpers/getRandomInt";
import { Generic_fromJSON, Generic_toJSON, Reviver } from "../utils/JSONReviver"; import { Generic_fromJSON, Generic_toJSON, Reviver } from "../utils/JSONReviver";
import { createElement } from "../ui/uiHelpers/createElement";
import { EmployeePositions } from "./EmployeePositions"; import { EmployeePositions } from "./EmployeePositions";
import { ICorporation } from "./ICorporation"; import { ICorporation } from "./ICorporation";
import { numeralWrapper } from "../ui/numeralFormat";
import { formatNumber } from "../utils/StringHelperFunctions";
import { OfficeSpace } from "./OfficeSpace"; import { OfficeSpace } from "./OfficeSpace";
import { IIndustry } from "./IIndustry"; import { IIndustry } from "./IIndustry";

View File

@ -16,7 +16,6 @@ import { Warehouse } from "./Warehouse";
import { ICorporation } from "./ICorporation"; import { ICorporation } from "./ICorporation";
import { IIndustry } from "./IIndustry"; import { IIndustry } from "./IIndustry";
import { IndustryUpgrade, IndustryUpgrades } from "./IndustryUpgrades"; import { IndustryUpgrade, IndustryUpgrades } from "./IndustryUpgrades";
import { formatNumber } from "../utils/StringHelperFunctions";
interface IParams { interface IParams {
name?: string; name?: string;

View File

@ -3,7 +3,6 @@ import { ICorporation } from "./ICorporation";
import { IIndustry } from "./IIndustry"; import { IIndustry } from "./IIndustry";
import { MaterialSizes } from "./MaterialSizes"; import { MaterialSizes } from "./MaterialSizes";
import { IMap } from "../types"; import { IMap } from "../types";
import { numeralWrapper } from "../ui/numeralFormat";
import { Generic_fromJSON, Generic_toJSON, Reviver } from "../utils/JSONReviver"; import { Generic_fromJSON, Generic_toJSON, Reviver } from "../utils/JSONReviver";
import { exceptionAlert } from "../utils/helpers/exceptionAlert"; import { exceptionAlert } from "../utils/helpers/exceptionAlert";

View File

@ -1,7 +1,6 @@
import React, { useState } from "react"; import React, { useState } from "react";
import { Modal } from "../../ui/React/Modal"; import { Modal } from "../../ui/React/Modal";
import { numeralWrapper } from "../../ui/numeralFormat"; import { numeralWrapper } from "../../ui/numeralFormat";
import { dialogBoxCreate } from "../../ui/React/DialogBox";
import { use } from "../../ui/Context"; import { use } from "../../ui/Context";
import { useCorporation } from "./Context"; import { useCorporation } from "./Context";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";

View File

@ -10,5 +10,5 @@ export const Context: {
Division: React.createContext<IIndustry>({} as IIndustry), Division: React.createContext<IIndustry>({} as IIndustry),
}; };
export const useCorporation = () => useContext(Context.Corporation); export const useCorporation = (): ICorporation => useContext(Context.Corporation);
export const useDivision = () => useContext(Context.Division); export const useDivision = (): IIndustry => useContext(Context.Division);

View File

@ -5,8 +5,7 @@ import React from "react";
import { CityTabs } from "./CityTabs"; import { CityTabs } from "./CityTabs";
import { IIndustry } from "../IIndustry"; import { IIndustry } from "../IIndustry";
import { useCorporation } from "./Context"; import { Context, useCorporation } from "./Context";
import { Context } from "./Context";
import { CityName } from "../../Locations/data/CityNames"; import { CityName } from "../../Locations/data/CityNames";

View File

@ -83,7 +83,6 @@ interface IProps {
// Create a popup that lets the player use the Market TA research for Products // Create a popup that lets the player use the Market TA research for Products
export function ProductMarketTaModal(props: IProps): React.ReactElement { export function ProductMarketTaModal(props: IProps): React.ReactElement {
const division = useDivision();
const markupLimit = props.product.rat / props.product.mku; const markupLimit = props.product.rat / props.product.mku;
const setRerender = useState(false)[1]; const setRerender = useState(false)[1];
function rerender(): void { function rerender(): void {

View File

@ -6,7 +6,6 @@ import { CorporationConstants } from "../data/Constants";
import { Treant } from "treant-js"; import { Treant } from "treant-js";
import { IIndustry } from "../IIndustry"; import { IIndustry } from "../IIndustry";
import { Research } from "../Actions"; import { Research } from "../Actions";
import Typography from "@mui/material/Typography";
interface IProps { interface IProps {
industry: IIndustry; industry: IIndustry;

View File

@ -13,6 +13,8 @@ import { Settings } from "../../Settings/Settings";
import { hasAugmentationPrereqs } from "../FactionHelpers"; import { hasAugmentationPrereqs } from "../FactionHelpers";
import { use } from "../../ui/Context"; import { use } from "../../ui/Context";
import { Reputation } from "../../ui/React/Reputation";
import { Favor } from "../../ui/React/Favor";
import Button from "@mui/material/Button"; import Button from "@mui/material/Button";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";
@ -181,6 +183,9 @@ export function AugmentationsPage(props: IProps): React.ReactElement {
<Typography> <Typography>
These are all of the Augmentations that are available to purchase from {props.faction.name}. Augmentations are These are all of the Augmentations that are available to purchase from {props.faction.name}. Augmentations are
powerful upgrades that will enhance your abilities. powerful upgrades that will enhance your abilities.
<br />
Reputation: <Reputation reputation={props.faction.playerReputation} /> Favor:{" "}
<Favor favor={props.faction.favor} />
</Typography> </Typography>
<Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Cost)}>Sort by Cost</Button> <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Cost)}>Sort by Cost</Button>
<Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Reputation)}>Sort by Reputation</Button> <Button onClick={() => switchSortOrder(PurchaseAugmentationsOrderSetting.Reputation)}>Sort by Reputation</Button>

View File

@ -16,7 +16,6 @@ import { BitNodeMultipliers } from "../../BitNode/BitNodeMultipliers";
import { Faction } from "../../Faction/Faction"; import { Faction } from "../../Faction/Faction";
import { SourceFileFlags } from "../../SourceFile/SourceFileFlags"; import { SourceFileFlags } from "../../SourceFile/SourceFileFlags";
import { createPopup } from "../../ui/React/createPopup";
import { use } from "../../ui/Context"; import { use } from "../../ui/Context";
import { CreateGangModal } from "./CreateGangModal"; import { CreateGangModal } from "./CreateGangModal";

View File

@ -56,10 +56,6 @@ export function AscensionModal(props: IProps): React.ReactElement {
props.onClose(); props.onClose();
} }
function cancel(): void {
props.onClose();
}
// const ascendBenefits = props.member.getAscensionResults(); // const ascendBenefits = props.member.getAscensionResults();
const preAscend = props.member.getCurrentAscensionMults(); const preAscend = props.member.getCurrentAscensionMults();
const postAscend = props.member.getAscensionMultsAfterAscend(); const postAscend = props.member.getAscensionMultsAfterAscend();

View File

@ -7,4 +7,4 @@ export const Context: {
Gang: React.createContext<IGang>({} as IGang), Gang: React.createContext<IGang>({} as IGang),
}; };
export const useGang = () => useContext(Context.Gang); export const useGang = (): IGang => useContext(Context.Gang);

View File

@ -16,7 +16,6 @@ import Button from "@mui/material/Button";
import Tooltip from "@mui/material/Tooltip"; import Tooltip from "@mui/material/Tooltip";
import Box from "@mui/material/Box"; import Box from "@mui/material/Box";
import Paper from "@mui/material/Paper"; import Paper from "@mui/material/Paper";
import Grid from "@mui/material/Grid";
interface INextRevealProps { interface INextRevealProps {
upgrades: string[]; upgrades: string[];

View File

@ -6,18 +6,11 @@ import { ManagementSubpage } from "./ManagementSubpage";
import { TerritorySubpage } from "./TerritorySubpage"; import { TerritorySubpage } from "./TerritorySubpage";
import { EquipmentsSubpage } from "./EquipmentsSubpage"; import { EquipmentsSubpage } from "./EquipmentsSubpage";
import { use } from "../../ui/Context"; import { use } from "../../ui/Context";
import { Factions } from "../../Faction/Factions";
import { Context } from "./Context"; import { Context } from "./Context";
import Tabs from "@mui/material/Tabs"; import Tabs from "@mui/material/Tabs";
import Tab from "@mui/material/Tab"; import Tab from "@mui/material/Tab";
enum Page {
Management,
Equipment,
Territory,
}
export function GangRoot(): React.ReactElement { export function GangRoot(): React.ReactElement {
const player = use.Player(); const player = use.Player();
const gang = (function () { const gang = (function () {

View File

@ -5,7 +5,6 @@ import React from "react";
import { numeralWrapper } from "../../ui/numeralFormat"; import { numeralWrapper } from "../../ui/numeralFormat";
import { formatNumber } from "../../utils/StringHelperFunctions"; import { formatNumber } from "../../utils/StringHelperFunctions";
import { AllGangs } from "../AllGangs"; import { AllGangs } from "../AllGangs";
import { Gang } from "../Gang";
import { useGang } from "./Context"; import { useGang } from "./Context";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";

View File

@ -7,7 +7,6 @@ import { hasHacknetServers, hasMaxNumberHacknetServers } from "../HacknetHelpers
import { Player } from "../../Player"; import { Player } from "../../Player";
import { Money } from "../../ui/React/Money"; import { Money } from "../../ui/React/Money";
import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button"; import Button from "@mui/material/Button";
interface IProps { interface IProps {

View File

@ -23,10 +23,6 @@ type IProps = {
p: IPlayer; p: IPlayer;
}; };
type IState = {
game: GameType;
};
export function CasinoLocation(props: IProps): React.ReactElement { export function CasinoLocation(props: IProps): React.ReactElement {
const [game, setGame] = useState(GameType.None); const [game, setGame] = useState(GameType.None);

View File

@ -1,5 +1,4 @@
import React from "react"; import React from "react";
import { IPlayer } from "../../PersonObjects/IPlayer";
import { CONSTANTS } from "../../Constants"; import { CONSTANTS } from "../../Constants";
import { Money } from "../../ui/React/Money"; import { Money } from "../../ui/React/Money";
import { Modal } from "../../ui/React/Modal"; import { Modal } from "../../ui/React/Modal";

View File

@ -283,7 +283,7 @@ export const programsMetadata: IProgramCreationParams[] = [
req: bitFlumeRequirements(), req: bitFlumeRequirements(),
time: CONSTANTS.MillisecondsPerFiveMinutes / 20, time: CONSTANTS.MillisecondsPerFiveMinutes / 20,
}, },
run: (router: IRouter, terminal: ITerminal, player: IPlayer): void => { run: (): void => {
BitFlumeEvent.emit(); BitFlumeEvent.emit();
}, },
}, },

View File

@ -4,6 +4,7 @@ import Tooltip from "@mui/material/Tooltip";
type IProps = { type IProps = {
value: string; value: string;
color?: string;
variant?: variant?:
| "button" | "button"
| "caption" | "caption"
@ -39,7 +40,7 @@ export function CopyableText(props: IProps): React.ReactElement {
return ( return (
<Tooltip open={open} title={<Typography>Copied!</Typography>}> <Tooltip open={open} title={<Typography>Copied!</Typography>}>
<Typography variant={props.variant} onClick={copy}> <Typography variant={props.variant} color={props.color} onClick={copy}>
{props.value} {props.value}
</Typography> </Typography>
</Tooltip> </Tooltip>

View File

@ -1,7 +1,6 @@
import { AlertEvents } from "./AlertManager"; import { AlertEvents } from "./AlertManager";
import React from "react"; import React from "react";
import { jsx } from "@emotion/react";
export function dialogBoxCreate(txt: string | JSX.Element): void { export function dialogBoxCreate(txt: string | JSX.Element): void {
if (typeof txt !== "string") { if (typeof txt !== "string") {