mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 02:32:55 +02:00
Added recovery mode
This commit is contained in:
@@ -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>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user