diff --git a/src/ui/CharacterStats.tsx b/src/ui/CharacterStats.tsx
index 0ee401d47..f1b387d34 100644
--- a/src/ui/CharacterStats.tsx
+++ b/src/ui/CharacterStats.tsx
@@ -1,42 +1,23 @@
-import React, { useState, useEffect } from "react";
-
-import { numeralWrapper } from "./numeralFormat";
-import { convertTimeMsToTimeElapsedString } from "../utils/StringHelperFunctions";
-import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
-import { SourceFileFlags } from "../SourceFile/SourceFileFlags";
-import { getPurchaseServerLimit } from "../Server/ServerPurchases";
-import { HacknetServerConstants } from "../Hacknet/data/Constants";
-import { StatsTable } from "./React/StatsTable";
-import { Money } from "./React/Money";
-import { use } from "./Context";
-import { MoneySourceTracker } from "../utils/MoneySourceTracker";
-import { BitNodes } from "../BitNode/BitNode";
-
-import Typography from "@mui/material/Typography";
+import MoreHorizIcon from "@mui/icons-material/MoreHoriz";
+import { Paper, Table, TableBody } from "@mui/material";
import Box from "@mui/material/Box";
import IconButton from "@mui/material/IconButton";
-import MoreHorizIcon from "@mui/icons-material/MoreHoriz";
+import Typography from "@mui/material/Typography";
+import React, { useEffect, useState } from "react";
+import { BitNodes } from "../BitNode/BitNode";
+import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers";
+import { HacknetServerConstants } from "../Hacknet/data/Constants";
+import { getPurchaseServerLimit } from "../Server/ServerPurchases";
+import { Settings } from "../Settings/Settings";
+import { SourceFileFlags } from "../SourceFile/SourceFileFlags";
+import { MoneySourceTracker } from "../utils/MoneySourceTracker";
+import { convertTimeMsToTimeElapsedString } from "../utils/StringHelperFunctions";
+import { use } from "./Context";
+import { numeralWrapper } from "./numeralFormat";
import { Modal } from "./React/Modal";
-
-import TableBody from "@mui/material/TableBody";
-import { Table, TableCell } from "./React/Table";
-import TableRow from "@mui/material/TableRow";
-
-function LastEmployer(): React.ReactElement {
- const player = use.Player();
- if (player.companyName) {
- return Employer at which you last worked: {player.companyName};
- }
- return <>>;
-}
-
-function LastJob(): React.ReactElement {
- const player = use.Player();
- if (player.companyName !== "") {
- return Job you last worked: {player.jobs[player.companyName]};
- }
- return <>>;
-}
+import { Money } from "./React/Money";
+import { StatsRow } from "./React/StatsRow";
+import { StatsTable } from "./React/StatsTable";
function Employers(): React.ReactElement {
const player = use.Player();
@@ -55,75 +36,43 @@ function Employers(): React.ReactElement {
return <>>;
}
-function Hacknet(): React.ReactElement {
- const player = use.Player();
- // Can't import HacknetHelpers for some reason.
- if (!(player.bitNodeN === 9 || SourceFileFlags[9] > 0)) {
- return (
- <>
- {`Hacknet Nodes owned: ${player.hacknetNodes.length}`}
-
- >
- );
- } else {
- return (
- <>
- {`Hacknet Servers owned: ${player.hacknetNodes.length} / ${HacknetServerConstants.MaxServers}`}
-
- >
- );
- }
+interface MultTableProps {
+ rows: (string | number)[][];
+ color: string;
}
-function Intelligence(): React.ReactElement {
- const player = use.Player();
- if (player.intelligence > 0 && (player.bitNodeN === 5 || SourceFileFlags[5] > 0)) {
- return (
-
-
- Intelligence:
-
-
- {numeralWrapper.formatSkill(player.intelligence)}
-
-
- ({numeralWrapper.formatExp(player.intelligence_exp)} exp)
-
-
- );
- }
- return <>>;
-}
-
-function MultiplierTable(props: any): React.ReactElement {
- function bn5Stat(r: any): JSX.Element {
- if (SourceFileFlags[5] > 0 && r.length > 2 && r[1] != r[2]) {
- return (
-
- ({numeralWrapper.formatPercentage(r[2])})
-
- );
- }
- return <>>;
- }
+function MultiplierTable(props: MultTableProps): React.ReactElement {
return (
- <>
-
-
- {props.rows.map((r: any) => (
-
-
- {`${r[0]} multiplier:`}
-
-
- {numeralWrapper.formatPercentage(r[1])}
-
- {bn5Stat(r)}
-
- ))}
-
-
- >
+
+
+ {props.rows.map((data) => {
+ const mult = data[0] as string,
+ value = data[1] as number,
+ modded = data[2] as number | null;
+
+ if (modded && modded !== value && SourceFileFlags[5] > 0) {
+ return (
+
+ <>
+
+ {numeralWrapper.formatPercentage(value)}{" "}
+ {numeralWrapper.formatPercentage(modded)}
+
+ >
+
+ );
+ }
+ return (
+
+ );
+ })}
+
+
);
}
@@ -138,6 +87,7 @@ function BladeburnerMults(): React.ReactElement {
["Bladeburner Stamina Gain", player.bladeburner_stamina_gain_mult],
["Bladeburner Field Analysis", player.bladeburner_analysis_mult],
]}
+ color={Settings.theme.primary}
/>
);
}
@@ -147,14 +97,15 @@ function CurrentBitNode(): React.ReactElement {
if (player.sourceFiles.length > 0) {
const index = "BitNode" + player.bitNodeN;
return (
- <>
-
- BitNode {player.bitNodeN}: {BitNodes[index].name}
-
-
- {BitNodes[index].info}
-
- >
+
+
+
+ BitNode {player.bitNodeN}: {BitNodes[index].name} (Level {Math.min(SourceFileFlags[player.bitNodeN] + 1, 3)}
+ )
+
+ {BitNodes[index].info}
+
+
);
}
@@ -273,227 +224,276 @@ export function CharacterStats(): React.ReactElement {
}, []);
const timeRows = [
- ["Time played since last Augmentation:", convertTimeMsToTimeElapsedString(player.playtimeSinceLastAug)],
+ ["Since last Augmentation installation", convertTimeMsToTimeElapsedString(player.playtimeSinceLastAug)],
];
if (player.sourceFiles.length > 0) {
- timeRows.push([
- "Time played since last Bitnode destroyed:",
- convertTimeMsToTimeElapsedString(player.playtimeSinceLastBitnode),
- ]);
+ timeRows.push(["Since last Bitnode destroyed", convertTimeMsToTimeElapsedString(player.playtimeSinceLastBitnode)]);
}
- timeRows.push(["Total Time played:", convertTimeMsToTimeElapsedString(player.totalPlaytime)]);
+ timeRows.push(["Total", convertTimeMsToTimeElapsedString(player.totalPlaytime)]);
return (
<>
- General
-
- Current City: {player.city}
-
-
-
-
-
- Money:
- setMoneyOpen(true)}>
-
-
-
+
+
+ General
+
+
+
+
+ <>
+
+ setMoneyOpen(true)} sx={{ p: 0 }}>
+
+
+ >
+
+ {player.companyName && (
+ <>
+
+
+ >
+ )}
+
+ 0 ? "Servers" : "Nodes"} owned`}
+ color={Settings.theme.primary}
+ data={{
+ content: `${player.hacknetNodes.length}${
+ player.bitNodeN === 9 || SourceFileFlags[9] > 0 ? ` / ${HacknetServerConstants.MaxServers}` : ""
+ }`,
+ }}
+ />
+
+
+
+
+
+
+ Skills
+
+
+
+
+
+
+
+
+ {player.intelligence > 0 && (player.bitNodeN === 5 || SourceFileFlags[5] > 0) && (
+
+ )}
+
+
+
-
- Stats
-
-
-
-
-
- Hacking:
-
-
- {numeralWrapper.formatSkill(player.hacking)}
-
-
- ({numeralWrapper.formatExp(player.hacking_exp)} exp)
-
-
-
-
- Strength:
-
-
- {numeralWrapper.formatSkill(player.strength)}
-
-
- ({numeralWrapper.formatExp(player.strength_exp)} exp)
-
-
-
-
- Defense:
-
-
- {numeralWrapper.formatSkill(player.defense)}
-
-
- ({numeralWrapper.formatExp(player.defense_exp)} exp)
-
-
-
-
- Dexterity:
-
-
- {numeralWrapper.formatSkill(player.dexterity)}
-
-
- ({numeralWrapper.formatExp(player.dexterity_exp)} exp)
-
-
-
-
- Agility:
-
-
- {numeralWrapper.formatSkill(player.agility)}
-
-
- ({numeralWrapper.formatExp(player.agility_exp)} exp)
-
-
-
-
- Charisma:
-
-
- {numeralWrapper.formatSkill(player.charisma)}
-
-
- ({numeralWrapper.formatExp(player.charisma_exp)} exp)
-
-
-
-
-
-
+
+
+ Multipliers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- Multipliers
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ Time Played
+
+
+ {timeRows.map(([name, content]) => (
+
+
+
+ ))}
+
+
+
-
-
- Misc
-
- {`Servers owned: ${player.purchasedServers.length} / ${getPurchaseServerLimit()}`}
-
- {`Augmentations installed: ${player.augmentations.length}`}
-
-
-
setMoneyOpen(false)} />
>
diff --git a/src/ui/React/StatsRow.tsx b/src/ui/React/StatsRow.tsx
index eed5c7184..74241c235 100644
--- a/src/ui/React/StatsRow.tsx
+++ b/src/ui/React/StatsRow.tsx
@@ -17,9 +17,10 @@ interface IProps {
color: string;
classes?: any;
data: ITableRowData;
+ children?: React.ReactElement;
}
-export const StatsRow = ({ name, color, classes = useStyles(), data }: IProps): React.ReactElement => {
+export const StatsRow = ({ name, color, classes = useStyles(), children, data }: IProps): React.ReactElement => {
let content;
if (data.content !== undefined) {
@@ -37,6 +38,7 @@ export const StatsRow = ({ name, color, classes = useStyles(), data }: IProps):
{content}
+ {children}
);