Added recovery mode

This commit is contained in:
Olivier Gagnon
2021-11-02 17:28:19 -04:00
parent fa44b38506
commit 048ef0e69e
9 changed files with 89 additions and 26 deletions
+50
View File
@@ -0,0 +1,50 @@
import React from "react";
import Typography from "@mui/material/Typography";
import Link from "@mui/material/Link";
import Button from "@mui/material/Button";
import { Settings } from "../../Settings/Settings";
import { saveObject } from "../../SaveObject";
import { IRouter } from "../Router";
export let RecoveryMode = false;
export function ActivateRecoveryMode(): void {
RecoveryMode = true;
}
interface IProps {
router: IRouter;
}
export function RecoveryRoot({ router }: IProps): React.ReactElement {
function recover(): void {
RecoveryMode = false;
router.toTerminal();
}
Settings.AutosaveInterval = 0;
saveObject.exportGame();
return (
<>
<Typography variant="h3">RECOVERY MODE ACTIVATED</Typography>
<Typography>
There was an error loading your save file and the game went into recovery mode. In this mode saving is disabled
and the game will automatically export your save file (to prevent corruption).
</Typography>
<Typography>At this point it is recommended to alert a developer.</Typography>
<Link href="https://github.com/danielyxie/bitburner/issues/new" target="_blank">
<Typography>File an issue on github</Typography>
</Link>
<Link href="https://www.reddit.com/r/Bitburner/" target="_blank">
<Typography>Make a reddit post</Typography>
</Link>
<Link href="https://discord.gg/TFc3hKD" target="_blank">
<Typography>Post in the #bug-report channel on Discord.</Typography>
</Link>
<Typography>Please include your save file.</Typography>
<br />
<br />
<Typography>You can disable recovery mode now. But chances are the game will not work correctly.</Typography>
<Button onClick={recover}>DISABLE RECOVERY MODE</Button>
</>
);
}