mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-09 00:57:49 +02:00
CODEBASE: Generate display data for math notation at built time and remove runtime mathjax dependency (#2447)
This commit is contained in:
@@ -6,7 +6,8 @@ import Typography from "@mui/material/Typography";
|
||||
import { Player } from "@player";
|
||||
|
||||
import { Money } from "../../ui/React/Money";
|
||||
import { MathJax } from "better-react-mathjax";
|
||||
import MathNotation from "../../Documentation/data/MathNotation.json";
|
||||
import { MathNotationOutput } from "../../Documentation/ui/MathNotationOutput";
|
||||
|
||||
interface IProps {
|
||||
rerender: () => void;
|
||||
@@ -32,7 +33,7 @@ export function CoresButton(props: IProps): React.ReactElement {
|
||||
}
|
||||
|
||||
return (
|
||||
<Tooltip title={<MathJax>{`\\(\\large{cost = 10^9 \\cdot 7.5 ^{\\text{cores}}}\\)`}</MathJax>}>
|
||||
<Tooltip title={<MathNotationOutput notation={MathNotation.CoreCost} />}>
|
||||
<span>
|
||||
<br />
|
||||
<Typography>
|
||||
|
||||
@@ -9,9 +9,10 @@ import { purchaseRamForHomeComputer } from "../../Server/ServerPurchases";
|
||||
import { Money } from "../../ui/React/Money";
|
||||
import { formatRam } from "../../ui/formatNumber";
|
||||
|
||||
import { MathJax } from "better-react-mathjax";
|
||||
import { currentNodeMults } from "../../BitNode/BitNodeMultipliers";
|
||||
import { ServerConstants } from "../../Server/data/Constants";
|
||||
import MathNotation from "../../Documentation/data/MathNotation.json";
|
||||
import { MathNotationOutput } from "../../Documentation/ui/MathNotationOutput";
|
||||
|
||||
interface IProps {
|
||||
rerender: () => void;
|
||||
@@ -30,12 +31,13 @@ export function RamButton(props: IProps): React.ReactElement {
|
||||
props.rerender();
|
||||
}
|
||||
|
||||
const bnMult = currentNodeMults.HomeComputerRamCost === 1 ? "" : `\\cdot ${currentNodeMults.HomeComputerRamCost}`;
|
||||
|
||||
return (
|
||||
<Tooltip
|
||||
title={
|
||||
<MathJax>{`\\(\\large{cost = ram \\cdot 3.2 \\cdot 10^4 \\cdot 1.58^{log_2{(ram)}}} ${bnMult}\\)`}</MathJax>
|
||||
<>
|
||||
<Typography>HomeRamCostMult = {currentNodeMults.HomeComputerRamCost}</Typography>
|
||||
<MathNotationOutput notation={MathNotation.HomeRAMCost} />
|
||||
</>
|
||||
}
|
||||
>
|
||||
<span>
|
||||
|
||||
Reference in New Issue
Block a user