mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-18 15:28:43 +02:00
prettify, sorry for the big ass commit
This commit is contained in:
@@ -9,37 +9,42 @@ import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||
import { Money } from "../React/Money";
|
||||
|
||||
type IProps = {
|
||||
p: IPlayer;
|
||||
workerScripts: Map<number, WorkerScript>;
|
||||
}
|
||||
p: IPlayer;
|
||||
workerScripts: Map<number, WorkerScript>;
|
||||
};
|
||||
|
||||
export function ScriptProduction(props: IProps): React.ReactElement {
|
||||
const prodRateSinceLastAug = props.p.scriptProdSinceLastAug / (props.p.playtimeSinceLastAug / 1000);
|
||||
const prodRateSinceLastAug =
|
||||
props.p.scriptProdSinceLastAug / (props.p.playtimeSinceLastAug / 1000);
|
||||
|
||||
let onlineProduction = 0;
|
||||
for (const ws of props.workerScripts.values()) {
|
||||
onlineProduction += (ws.scriptRef.onlineMoneyMade / ws.scriptRef.onlineRunningTime);
|
||||
}
|
||||
let onlineProduction = 0;
|
||||
for (const ws of props.workerScripts.values()) {
|
||||
onlineProduction +=
|
||||
ws.scriptRef.onlineMoneyMade / ws.scriptRef.onlineRunningTime;
|
||||
}
|
||||
|
||||
return (
|
||||
<p id="active-scripts-total-prod">
|
||||
Total online production of Active scripts:
|
||||
<span className="money-gold">
|
||||
<span id="active-scripts-total-production-active">
|
||||
<Money money={onlineProduction} />
|
||||
</span> / sec
|
||||
</span><br />
|
||||
|
||||
Total online production since last Aug installation:
|
||||
<span id="active-scripts-total-prod-aug-total" className="money-gold">
|
||||
<Money money={props.p.scriptProdSinceLastAug} />
|
||||
</span>
|
||||
|
||||
(<span className="money-gold">
|
||||
<span id="active-scripts-total-prod-aug-avg" className="money-gold">
|
||||
<Money money={prodRateSinceLastAug} />
|
||||
</span> / sec
|
||||
</span>)
|
||||
</p>
|
||||
)
|
||||
return (
|
||||
<p id="active-scripts-total-prod">
|
||||
Total online production of Active scripts:
|
||||
<span className="money-gold">
|
||||
<span id="active-scripts-total-production-active">
|
||||
<Money money={onlineProduction} />
|
||||
</span>{" "}
|
||||
/ sec
|
||||
</span>
|
||||
<br />
|
||||
Total online production since last Aug installation:
|
||||
<span id="active-scripts-total-prod-aug-total" className="money-gold">
|
||||
<Money money={props.p.scriptProdSinceLastAug} />
|
||||
</span>
|
||||
(
|
||||
<span className="money-gold">
|
||||
<span id="active-scripts-total-prod-aug-avg" className="money-gold">
|
||||
<Money money={prodRateSinceLastAug} />
|
||||
</span>{" "}
|
||||
/ sec
|
||||
</span>
|
||||
)
|
||||
</p>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user