mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-05 07:07:50 +02:00
moved over to player stats
* added new augmentations
This commit is contained in:
@@ -3,6 +3,7 @@ import React, { useState, useEffect } from "react";
|
||||
import withStyles from "@mui/styles/withStyles";
|
||||
import { Theme } from "@mui/material/styles";
|
||||
import Grid from "@mui/material/Grid";
|
||||
import { use } from "../../ui/Context";
|
||||
|
||||
const TimerProgress = withStyles((theme: Theme) => ({
|
||||
root: {
|
||||
@@ -20,14 +21,16 @@ interface IProps {
|
||||
}
|
||||
|
||||
export function GameTimer(props: IProps): React.ReactElement {
|
||||
const player = use.Player();
|
||||
const [v, setV] = useState(100);
|
||||
const totalMillis = player.infiltration_timer_mult * props.millis;
|
||||
|
||||
const tick = 200;
|
||||
useEffect(() => {
|
||||
const intervalId = setInterval(() => {
|
||||
setV((old) => {
|
||||
if (old <= 0) props.onExpire();
|
||||
return old - (tick / props.millis) * 100;
|
||||
return old - (tick / totalMillis) * 100;
|
||||
});
|
||||
}, tick);
|
||||
return () => {
|
||||
|
||||
Reference in New Issue
Block a user