mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-19 12:45:45 +01:00
parent
becca87224
commit
606b4bee95
@ -102,7 +102,6 @@ export class Terminal {
|
||||
if (this.action === null) return;
|
||||
this.action.timeLeft -= (CONSTANTS.MilliPerCycle * cycles) / 1000;
|
||||
if (this.action.timeLeft < 0.01) this.finishAction(false);
|
||||
TerminalEvents.emit();
|
||||
}
|
||||
|
||||
append(item: Output | Link | RawOutput): void {
|
||||
|
11
src/Terminal/ui/TerminalActionTimer.tsx
Normal file
11
src/Terminal/ui/TerminalActionTimer.tsx
Normal file
@ -0,0 +1,11 @@
|
||||
import React from "react";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import { useRerender } from "../../ui/React/hooks";
|
||||
import { Terminal } from "../../Terminal";
|
||||
|
||||
export function TerminalActionTimer(): React.ReactElement {
|
||||
useRerender(200);
|
||||
|
||||
return <Typography color="primary">{Terminal.action && Terminal.getProgressText()}</Typography>;
|
||||
}
|
@ -7,6 +7,8 @@ import { Theme } from "@mui/material/styles";
|
||||
import makeStyles from "@mui/styles/makeStyles";
|
||||
import createStyles from "@mui/styles/createStyles";
|
||||
import Box from "@mui/material/Box";
|
||||
import _ from "lodash";
|
||||
|
||||
import { Output, Link, RawOutput } from "../OutputTypes";
|
||||
import { Terminal } from "../../Terminal";
|
||||
import { TerminalInput } from "./TerminalInput";
|
||||
@ -14,17 +16,9 @@ import { TerminalEvents, TerminalClearEvents } from "../TerminalEvents";
|
||||
import { BitFlumeModal } from "../../BitNode/ui/BitFlumeModal";
|
||||
import { CodingContractModal } from "../../ui/React/CodingContractModal";
|
||||
|
||||
import _ from "lodash";
|
||||
import { ANSIITypography } from "../../ui/React/ANSIITypography";
|
||||
import { useRerender } from "../../ui/React/hooks";
|
||||
|
||||
function ActionTimer(): React.ReactElement {
|
||||
return (
|
||||
<Typography color={"primary"} paragraph={false}>
|
||||
{Terminal.getProgressText()}
|
||||
</Typography>
|
||||
);
|
||||
}
|
||||
import { TerminalActionTimer } from "./TerminalActionTimer";
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) =>
|
||||
createStyles({
|
||||
@ -116,7 +110,7 @@ export function TerminalRoot(): React.ReactElement {
|
||||
|
||||
{Terminal.action !== null && (
|
||||
<ListItem classes={{ root: classes.nopadding }}>
|
||||
<ActionTimer />{" "}
|
||||
<TerminalActionTimer />{" "}
|
||||
</ListItem>
|
||||
)}
|
||||
</List>
|
||||
|
Loading…
Reference in New Issue
Block a user