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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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