mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 09:33:49 +01:00
Merge pull request #2736 from MartinFournier/feature/sleeve-bonus-time
Display bonus time in sleeve detailed stats panel
This commit is contained in:
commit
6e33417399
@ -8,6 +8,7 @@ import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
|
|||||||
import Button from "@mui/material/Button";
|
import Button from "@mui/material/Button";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
import { IPlayer } from "../../PersonObjects/IPlayer";
|
import { IPlayer } from "../../PersonObjects/IPlayer";
|
||||||
|
import { Adjuster } from "./Adjuster";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
player: IPlayer;
|
player: IPlayer;
|
||||||
@ -38,6 +39,12 @@ export function Sleeves(props: IProps): React.ReactElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sleeveSetStoredCycles(cycles: number): void {
|
||||||
|
for (let i = 0; i < props.player.sleeves.length; ++i) {
|
||||||
|
props.player.sleeves[i].storedCycles = cycles;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Accordion TransitionProps={{ unmountOnExit: true }}>
|
<Accordion TransitionProps={{ unmountOnExit: true }}>
|
||||||
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
|
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
|
||||||
@ -68,6 +75,18 @@ export function Sleeves(props: IProps): React.ReactElement {
|
|||||||
<Button onClick={sleeveSyncClearAll}>Clear all</Button>
|
<Button onClick={sleeveSyncClearAll}>Clear all</Button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colSpan={3}>
|
||||||
|
<Adjuster
|
||||||
|
label="Stored Cycles"
|
||||||
|
placeholder="cycles"
|
||||||
|
tons={() => sleeveSetStoredCycles(10000000)}
|
||||||
|
add={sleeveSetStoredCycles}
|
||||||
|
subtract={sleeveSetStoredCycles}
|
||||||
|
reset={() => sleeveSetStoredCycles(0)}
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</AccordionDetails>
|
</AccordionDetails>
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
import { Sleeve } from "../Sleeve";
|
import { Sleeve } from "../Sleeve";
|
||||||
import { numeralWrapper } from "../../../ui/numeralFormat";
|
import { numeralWrapper } from "../../../ui/numeralFormat";
|
||||||
|
import { convertTimeMsToTimeElapsedString } from "../../../utils/StringHelperFunctions";
|
||||||
|
import { CONSTANTS } from "../../../Constants";
|
||||||
|
import { Typography } from "@mui/material";
|
||||||
import { StatsTable } from "../../../ui/React/StatsTable";
|
import { StatsTable } from "../../../ui/React/StatsTable";
|
||||||
import { Modal } from "../../../ui/React/Modal";
|
import { Modal } from "../../../ui/React/Modal";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
@ -80,6 +83,13 @@ export function MoreStatsModal(props: IProps): React.ReactElement {
|
|||||||
]}
|
]}
|
||||||
title="Multipliers:"
|
title="Multipliers:"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{/* Check for storedCycles to be a bit over 0 to prevent jittering */}
|
||||||
|
{props.sleeve.storedCycles > 10 && (
|
||||||
|
<Typography sx={{ py: 2 }}>
|
||||||
|
Bonus Time: {convertTimeMsToTimeElapsedString(props.sleeve.storedCycles * CONSTANTS.MilliPerCycle)}
|
||||||
|
</Typography>
|
||||||
|
)}
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user