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

@ -1,18 +1,18 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"/> <meta charset="utf-8" />
<title>Bitburner</title> <title>Bitburner</title>
<link rel="apple-touch-icon" sizes="180x180" href="dist/apple-touch-icon.png"/> <link rel="apple-touch-icon" sizes="180x180" href="dist/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="dist/favicon-32x32.png"/> <link rel="icon" type="image/png" sizes="32x32" href="dist/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="dist/favicon-16x16.png"/> <link rel="icon" type="image/png" sizes="16x16" href="dist/favicon-16x16.png" />
<link rel="manifest" href="dist/site.webmanifest"/> <link rel="manifest" href="dist/site.webmanifest" />
<link rel="mask-icon" href="dist/safari-pinned-tab.svg" color="#000000"/> <link rel="mask-icon" href="dist/safari-pinned-tab.svg" color="#000000" />
<meta name="apple-mobile-web-app-title" content="Bitburner"/> <meta name="apple-mobile-web-app-title" content="Bitburner" />
<meta name="application-name" content="Bitburner"/> <meta name="application-name" content="Bitburner" />
<meta name="msapplication-TileColor" content="#000000"/> <meta name="msapplication-TileColor" content="#000000" />
<meta name="msapplication-config" content="dist/browserconfig.xml"/> <meta name="msapplication-config" content="dist/browserconfig.xml" />
<meta name="theme-color" content="#ffffff"/> <meta name="theme-color" content="#ffffff" />
<!-- Google Analytics --> <!-- Google Analytics -->
<script> <script>
@ -30,13 +30,16 @@
m.parentNode.insertBefore(a, m); m.parentNode.insertBefore(a, m);
})(window, document, "script", "https://www.google-analytics.com/analytics.js", "ga"); })(window, document, "script", "https://www.google-analytics.com/analytics.js", "ga");
</script> </script>
<script> <script>
ga("create", "UA-100157497-1", "auto"); ga("create", "UA-100157497-1", "auto");
ga("send", "pageview"); ga("send", "pageview");
</script> </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> <body>
<div id="entire-game-container"> <div id="entire-game-container">
<div id="mainmenu-container" style="display: flex; flex-direction: row"></div> <div id="mainmenu-container" style="display: flex; flex-direction: row"></div>
@ -47,8 +50,11 @@
</div> </div>
</div> </div>
<div id="modal-portal"></div>
<div id="unclickable" style="display: none">Click on this to upgrade your Source-File -1!</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> <script src="src/ThirdParty/raphael.min.js"></script>
</html> </html>

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

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

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

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

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

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

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

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