This commit is contained in:
Olivier Gagnon 2021-09-25 13:31:42 -04:00
parent f7aa393a8f
commit ef17f0d617
9 changed files with 38 additions and 24 deletions

@ -36,7 +36,10 @@
ga("send", "pageview");
</script>
<link rel="shortcut icon" href="favicon.ico"><link href="dist/vendor.css" rel="stylesheet"><link href="main.css" rel="stylesheet"></head>
<link rel="shortcut icon" href="favicon.ico" />
<link href="dist/vendor.css" rel="stylesheet" />
<link href="main.css" rel="stylesheet" />
</head>
<body>
<div id="entire-game-container">
<div id="mainmenu-container" style="display: flex; flex-direction: row"></div>
@ -47,8 +50,11 @@
</div>
</div>
<div id="modal-portal"></div>
<div id="unclickable" style="display: none">Click on this to upgrade your Source-File -1!</div>
<script type="text/javascript" src="dist/vendor.bundle.js"></script><script type="text/javascript" src="main.bundle.js"></script></body>
<script type="text/javascript" src="dist/vendor.bundle.js"></script>
<script type="text/javascript" src="main.bundle.js"></script>
</body>
<script src="src/ThirdParty/raphael.min.js"></script>
</html>

@ -2,7 +2,7 @@
* Root React component for the Augmentations UI page that display all of your
* owned and purchased Augmentations and Source-Files.
*/
import React, { useState } from "react";
import React, { useState, useEffect } from "react";
import { InstalledAugmentations } from "./InstalledAugmentations";
import { PlayerMultipliers } from "./PlayerMultipliers";
@ -23,10 +23,17 @@ interface IProps {
export function AugmentationsRoot(props: IProps): React.ReactElement {
const setRerender = useState(false)[1];
function rerender(): void {
setRerender((o) => !o);
}
useEffect(() => {
const id = setInterval(rerender, 200);
return () => clearInterval(id);
}, []);
function doExport(): void {
props.exportGameFn();
setRerender((o) => !o);
rerender();
}
function exportBonusStr(): string {

@ -24,7 +24,7 @@ export function FactionsRoot(props: IProps): React.ReactElement {
setRerender((old) => !old);
}
useEffect(() => {
const id = setInterval(rerender, 1000);
const id = setInterval(rerender, 200);
return () => clearInterval(id);
}, []);
function openFaction(faction: Faction): void {

@ -38,7 +38,7 @@ export function Info(props: IProps): React.ReactElement {
}
useEffect(() => {
const id = setInterval(rerender, 1000);
const id = setInterval(rerender, 200);
return () => clearInterval(id);
}, []);

@ -42,7 +42,7 @@ export function HacknetRoot(props: IProps): React.ReactElement {
const [purchaseMultiplier, setPurchaseMultiplier] = useState<number | string>(PurchaseMultipliers.x1);
useEffect(() => {
const id = setInterval(rerender, 1000);
const id = setInterval(rerender, 200);
return () => clearInterval(id);
}, []);

@ -14,7 +14,7 @@ export function ProgramsRoot(): React.ReactElement {
}
useEffect(() => {
const id = setInterval(rerender, 1000);
const id = setInterval(rerender, 200);
return () => clearInterval(id);
}, []);
@ -33,7 +33,7 @@ export function ProgramsRoot(): React.ReactElement {
return (
<React.Fragment key={program.name}>
<Tooltip title={create.tooltip}>
<Tooltip title={create.tooltip} disableInteractive>
<Button
sx={{ my: 1 }}
onClick={(event) => {

@ -47,6 +47,7 @@
</div>
</div>
<div id="modal-portal"></div>
<div id="unclickable" style="display: none">Click on this to upgrade your Source-File -1!</div>
</body>

@ -22,7 +22,7 @@ export function ActiveScriptsRoot(props: IProps): React.ReactElement {
}
useEffect(() => {
const id = setInterval(rerender, 20);
const id = setInterval(rerender, 200);
return () => clearInterval(id);
}, []);

@ -253,7 +253,7 @@ export function CharacterStats(): React.ReactElement {
}
useEffect(() => {
const id = setInterval(rerender, 20);
const id = setInterval(rerender, 200);
return () => clearInterval(id);
}, []);