bitburner-src/src/ui/React/GameOptionsRoot.tsx

666 lines
28 KiB
TypeScript
Raw Normal View History

2021-09-20 00:04:12 +02:00
import React, { useState, useRef } from "react";
2021-09-13 18:44:46 +02:00
2021-09-15 03:05:49 +02:00
import { IPlayer } from "../../PersonObjects/IPlayer";
2021-09-17 01:23:03 +02:00
import { Theme } from "@mui/material/styles";
import makeStyles from "@mui/styles/makeStyles";
import createStyles from "@mui/styles/createStyles";
import Typography from "@mui/material/Typography";
import Slider from "@mui/material/Slider";
import Grid from "@mui/material/Grid";
import FormControlLabel from "@mui/material/FormControlLabel";
import Switch from "@mui/material/Switch";
import Select, { SelectChangeEvent } from "@mui/material/Select";
import MenuItem from "@mui/material/MenuItem";
import Button from "@mui/material/Button";
2021-09-20 00:04:12 +02:00
2021-09-17 01:23:03 +02:00
import Box from "@mui/material/Box";
import List from "@mui/material/List";
import ListItem from "@mui/material/ListItem";
import Link from "@mui/material/Link";
import Tooltip from "@mui/material/Tooltip";
2021-11-11 23:00:36 +01:00
import TextField from "@mui/material/TextField";
2021-09-17 01:23:03 +02:00
2021-09-18 18:13:20 +02:00
import DownloadIcon from "@mui/icons-material/Download";
import UploadIcon from "@mui/icons-material/Upload";
2021-09-15 03:47:42 +02:00
import { FileDiagnosticModal } from "../../Diagnostic/FileDiagnosticModal";
2021-09-25 20:42:57 +02:00
import { dialogBoxCreate } from "./DialogBox";
import { ConfirmationModal } from "./ConfirmationModal";
2021-09-22 08:20:29 +02:00
import { ThemeEditorModal } from "./ThemeEditorModal";
2021-09-15 03:05:49 +02:00
import { Settings } from "../../Settings/Settings";
2021-09-21 22:49:38 +02:00
import { save, deleteGame } from "../../db";
2021-11-11 23:00:36 +01:00
import { formatTime } from "../../utils/helpers/formatTime";
2021-09-15 03:05:49 +02:00
const useStyles = makeStyles((theme: Theme) =>
createStyles({
root: {
2021-09-17 01:23:03 +02:00
width: 50,
2021-09-18 01:43:08 +02:00
padding: theme.spacing(2),
2021-09-15 03:05:49 +02:00
userSelect: "none",
},
}),
);
interface IProps {
player: IPlayer;
save: () => void;
export: () => void;
forceKill: () => void;
softReset: () => void;
}
2021-09-13 18:44:46 +02:00
2021-09-14 21:23:16 +02:00
export function GameOptionsRoot(props: IProps): React.ReactElement {
2021-09-15 03:05:49 +02:00
const classes = useStyles();
2021-09-20 00:04:12 +02:00
const importInput = useRef<HTMLInputElement>(null);
2021-09-13 18:44:46 +02:00
2021-09-15 03:05:49 +02:00
const [execTime, setExecTime] = useState(Settings.CodeInstructionRunTime);
const [logSize, setLogSize] = useState(Settings.MaxLogCapacity);
const [portSize, setPortSize] = useState(Settings.MaxPortCapacity);
const [terminalSize, setTerminalSize] = useState(Settings.MaxTerminalCapacity);
2021-09-15 03:05:49 +02:00
const [autosaveInterval, setAutosaveInterval] = useState(Settings.AutosaveInterval);
2021-09-13 18:44:46 +02:00
2021-09-15 03:05:49 +02:00
const [suppressMessages, setSuppressMessages] = useState(Settings.SuppressMessages);
const [suppressFactionInvites, setSuppressFactionInvites] = useState(Settings.SuppressFactionInvites);
const [suppressTravelConfirmations, setSuppressTravelConfirmations] = useState(Settings.SuppressTravelConfirmation);
const [suppressBuyAugmentationConfirmation, setSuppressBuyAugmentationConfirmation] = useState(
Settings.SuppressBuyAugmentationConfirmation,
);
2021-09-13 18:44:46 +02:00
2021-09-15 03:05:49 +02:00
const [suppressBladeburnerPopup, setSuppressBladeburnerPopup] = useState(Settings.SuppressBladeburnerPopup);
2021-09-13 18:44:46 +02:00
2021-09-15 03:05:49 +02:00
const [disableHotkeys, setDisableHotkeys] = useState(Settings.DisableHotkeys);
const [disableASCIIArt, setDisableASCIIArt] = useState(Settings.DisableASCIIArt);
const [disableTextEffects, setDisableTextEffects] = useState(Settings.DisableTextEffects);
2021-09-22 07:36:17 +02:00
const [enableBashHotkeys, setEnableBashHotkeys] = useState(Settings.EnableBashHotkeys);
2021-11-11 23:00:36 +01:00
const [timestampFormat, setTimestampFormat] = useState(Settings.TimestampsFormat);
2021-10-11 23:57:17 +02:00
const [saveGameOnFileSave, setSaveGameOnFileSave] = useState(Settings.SaveGameOnFileSave);
2021-09-22 07:36:17 +02:00
2021-09-15 03:05:49 +02:00
const [locale, setLocale] = useState(Settings.Locale);
const [diagnosticOpen, setDiagnosticOpen] = useState(false);
const [deleteGameOpen, setDeleteOpen] = useState(false);
2021-09-22 08:20:29 +02:00
const [themeEditorOpen, setThemeEditorOpen] = useState(false);
2021-09-13 18:44:46 +02:00
2021-09-15 03:05:49 +02:00
function handleExecTimeChange(event: any, newValue: number | number[]): void {
setExecTime(newValue as number);
Settings.CodeInstructionRunTime = newValue as number;
}
2021-09-13 18:44:46 +02:00
2021-09-15 03:05:49 +02:00
function handleLogSizeChange(event: any, newValue: number | number[]): void {
setLogSize(newValue as number);
Settings.MaxLogCapacity = newValue as number;
}
2021-09-13 18:44:46 +02:00
2021-09-15 03:05:49 +02:00
function handlePortSizeChange(event: any, newValue: number | number[]): void {
setPortSize(newValue as number);
Settings.MaxPortCapacity = newValue as number;
}
2021-09-13 18:44:46 +02:00
function handleTerminalSizeChange(event: any, newValue: number | number[]): void {
setTerminalSize(newValue as number);
Settings.MaxTerminalCapacity = newValue as number;
}
2021-09-15 03:05:49 +02:00
function handleAutosaveIntervalChange(event: any, newValue: number | number[]): void {
setAutosaveInterval(newValue as number);
Settings.AutosaveInterval = newValue as number;
}
2021-09-13 18:44:46 +02:00
2021-09-15 03:05:49 +02:00
function handleSuppressMessagesChange(event: React.ChangeEvent<HTMLInputElement>): void {
setSuppressMessages(event.target.checked);
Settings.SuppressMessages = event.target.checked;
}
2021-09-13 18:44:46 +02:00
2021-09-15 03:05:49 +02:00
function handleSuppressFactionInvitesChange(event: React.ChangeEvent<HTMLInputElement>): void {
setSuppressFactionInvites(event.target.checked);
Settings.SuppressFactionInvites = event.target.checked;
}
2021-09-13 18:44:46 +02:00
2021-09-15 03:05:49 +02:00
function handleSuppressTravelConfirmationsChange(event: React.ChangeEvent<HTMLInputElement>): void {
setSuppressTravelConfirmations(event.target.checked);
Settings.SuppressTravelConfirmation = event.target.checked;
}
2021-09-13 18:44:46 +02:00
2021-09-15 03:05:49 +02:00
function handleSuppressBuyAugmentationConfirmationChange(event: React.ChangeEvent<HTMLInputElement>): void {
setSuppressBuyAugmentationConfirmation(event.target.checked);
Settings.SuppressBuyAugmentationConfirmation = event.target.checked;
}
2021-09-13 18:44:46 +02:00
2021-09-15 03:05:49 +02:00
function handleSuppressBladeburnerPopupChange(event: React.ChangeEvent<HTMLInputElement>): void {
setSuppressBladeburnerPopup(event.target.checked);
Settings.SuppressBladeburnerPopup = event.target.checked;
}
2021-09-13 18:44:46 +02:00
2021-09-15 03:05:49 +02:00
function handleDisableHotkeysChange(event: React.ChangeEvent<HTMLInputElement>): void {
setDisableHotkeys(event.target.checked);
Settings.DisableHotkeys = event.target.checked;
}
2021-09-13 18:44:46 +02:00
2021-09-15 03:05:49 +02:00
function handleDisableASCIIArtChange(event: React.ChangeEvent<HTMLInputElement>): void {
setDisableASCIIArt(event.target.checked);
Settings.DisableASCIIArt = event.target.checked;
}
2021-09-13 18:44:46 +02:00
2021-09-15 03:05:49 +02:00
function handleDisableTextEffectsChange(event: React.ChangeEvent<HTMLInputElement>): void {
setDisableTextEffects(event.target.checked);
Settings.DisableTextEffects = event.target.checked;
}
2021-09-17 01:23:03 +02:00
function handleLocaleChange(event: SelectChangeEvent<string>): void {
2021-09-15 03:05:49 +02:00
setLocale(event.target.value as string);
Settings.Locale = event.target.value as string;
}
2021-09-13 18:44:46 +02:00
2021-09-22 07:36:17 +02:00
function handleEnableBashHotkeysChange(event: React.ChangeEvent<HTMLInputElement>): void {
setEnableBashHotkeys(event.target.checked);
Settings.EnableBashHotkeys = event.target.checked;
}
2021-11-11 23:00:36 +01:00
function handleTimestampFormatChange(event: React.ChangeEvent<HTMLInputElement>): void {
setTimestampFormat(event.target.value);
Settings.TimestampsFormat = event.target.value;
2021-09-22 07:36:17 +02:00
}
2021-10-11 23:57:17 +02:00
function handleSaveGameOnFile(event: React.ChangeEvent<HTMLInputElement>): void {
setSaveGameOnFileSave(event.target.checked);
Settings.SaveGameOnFileSave = event.target.checked;
}
2021-09-22 07:36:17 +02:00
2021-09-21 22:49:38 +02:00
function startImport(): void {
if (!window.File || !window.FileReader || !window.FileList || !window.Blob) return;
const ii = importInput.current;
if (ii === null) throw new Error("import input should not be null");
ii.click();
2021-09-20 00:04:12 +02:00
}
function onImport(event: React.ChangeEvent<HTMLInputElement>): void {
2021-09-21 22:49:38 +02:00
const files = event.target.files;
if (files === null) return;
const file = files[0];
if (!file) {
dialogBoxCreate("Invalid file selected");
return;
}
const reader = new FileReader();
reader.onload = function (this: FileReader, e: ProgressEvent<FileReader>) {
const target = e.target;
if (target === null) {
console.error("error importing file");
return;
}
const result = target.result;
if (typeof result !== "string" || result === null) {
console.error("FileReader event was not type string");
return;
}
const contents = result;
2021-09-24 00:47:43 +02:00
save(contents).then(() => setTimeout(() => location.reload(), 1000));
2021-09-21 22:49:38 +02:00
};
reader.readAsText(file);
2021-09-20 00:04:12 +02:00
}
2021-09-15 03:05:49 +02:00
return (
<div className={classes.root} style={{ width: "90%" }}>
<Typography variant="h4" gutterBottom>
Options
</Typography>
2021-09-13 18:44:46 +02:00
2021-09-15 03:05:49 +02:00
<Grid container spacing={3}>
<Grid item xs={12} sm={6}>
<List>
<ListItem>
<Tooltip
title={
<Typography>
The minimum number of milliseconds it takes to execute an operation in Netscript. Setting this too
low can result in poor performance if you have many scripts running.
</Typography>
}
>
<Typography>Netscript exec time (ms)</Typography>
</Tooltip>
<Slider
value={execTime}
onChange={handleExecTimeChange}
step={1}
2021-11-05 19:32:21 +01:00
min={5}
2021-09-15 03:05:49 +02:00
max={100}
valueLabelDisplay="auto"
/>
</ListItem>
<ListItem>
<Tooltip
title={
<Typography>
The maximum number of lines a script's logs can hold. Setting this too high can cause the game to
use a lot of memory if you have many scripts running.
</Typography>
}
>
<Typography>Netscript log size</Typography>
</Tooltip>
<Slider
value={logSize}
onChange={handleLogSizeChange}
step={1}
min={20}
max={100}
valueLabelDisplay="auto"
/>
</ListItem>
<ListItem>
<Tooltip
title={
<Typography>
The maximum number of entries that can be written to a port using Netscript's write() function.
Setting this too high can cause the game to use a lot of memory.
</Typography>
}
>
<Typography>Netscript port size</Typography>
</Tooltip>
<Slider
value={portSize}
onChange={handlePortSizeChange}
step={1}
min={20}
max={100}
valueLabelDisplay="auto"
/>
</ListItem>
<ListItem>
<Tooltip
title={
<Typography>
The maximum number of entries that can be written to a the terminal. Setting this too high can cause
the game to use a lot of memory.
</Typography>
}
>
<Typography>Terminal capacity</Typography>
</Tooltip>
<Slider
value={terminalSize}
onChange={handleTerminalSizeChange}
step={50}
min={50}
max={500}
valueLabelDisplay="auto"
marks
/>
</ListItem>
2021-09-15 03:05:49 +02:00
<ListItem>
<Tooltip
title={
<Typography>The time (in seconds) between each autosave. Set to 0 to disable autosave.</Typography>
}
>
<Typography>Autosave interval (s)</Typography>
</Tooltip>
<Slider
value={autosaveInterval}
onChange={handleAutosaveIntervalChange}
step={30}
min={0}
max={600}
valueLabelDisplay="auto"
marks
/>
</ListItem>
<ListItem>
<FormControlLabel
2021-09-18 06:16:02 +02:00
control={<Switch checked={suppressMessages} onChange={handleSuppressMessagesChange} />}
2021-09-15 03:05:49 +02:00
label={
<Tooltip
title={
<Typography>
If this is set, then any messages you receive will not appear as popups on the screen. They will
still get sent to your home computer as '.msg' files and can be viewed with the 'cat' Terminal
command.
</Typography>
}
>
2021-11-11 01:28:20 +01:00
<Typography>Suppress story messages</Typography>
2021-09-15 03:05:49 +02:00
</Tooltip>
}
/>
</ListItem>
<ListItem>
<FormControlLabel
2021-09-18 06:16:02 +02:00
control={<Switch checked={suppressFactionInvites} onChange={handleSuppressFactionInvitesChange} />}
2021-09-15 03:05:49 +02:00
label={
<Tooltip
title={
<Typography>
If this is set, then any faction invites you receive will not appear as popups on the screen.
Your outstanding faction invites can be viewed in the 'Factions' page.
</Typography>
}
>
2021-09-16 14:14:44 +02:00
<Typography>Suppress faction invites</Typography>
2021-09-15 03:05:49 +02:00
</Tooltip>
}
/>
</ListItem>
<ListItem>
<FormControlLabel
control={
2021-09-18 06:16:02 +02:00
<Switch checked={suppressTravelConfirmations} onChange={handleSuppressTravelConfirmationsChange} />
2021-09-15 03:05:49 +02:00
}
label={
<Tooltip
title={
<Typography>
If this is set, the confirmation message before traveling will not show up. You will
automatically be deducted the travel cost as soon as you click.
</Typography>
}
>
2021-09-16 14:14:44 +02:00
<Typography>Suppress travel confirmations</Typography>
2021-09-15 03:05:49 +02:00
</Tooltip>
}
/>
</ListItem>
<ListItem>
<FormControlLabel
control={
<Switch
checked={suppressBuyAugmentationConfirmation}
onChange={handleSuppressBuyAugmentationConfirmationChange}
/>
}
label={
<Tooltip
title={
<Typography>
If this is set, the confirmation message before buying augmentation will not show up.
</Typography>
}
>
2021-09-16 14:14:44 +02:00
<Typography>Suppress buy augmentation confirmation</Typography>
2021-09-15 03:05:49 +02:00
</Tooltip>
}
2021-09-13 18:44:46 +02:00
/>
2021-09-15 03:05:49 +02:00
</ListItem>
{!!props.player.bladeburner && (
<ListItem>
<FormControlLabel
control={
2021-09-18 06:16:02 +02:00
<Switch checked={suppressBladeburnerPopup} onChange={handleSuppressBladeburnerPopupChange} />
2021-09-15 03:05:49 +02:00
}
label={
<Tooltip
title={
<Typography>
If this is set, then having your Bladeburner actions interrupted by being busy with something
else will not display a popup message.
</Typography>
}
>
2021-09-16 14:14:44 +02:00
<Typography>Suppress bladeburner popup</Typography>
2021-09-15 03:05:49 +02:00
</Tooltip>
}
/>
</ListItem>
)}
<ListItem>
<FormControlLabel
2021-09-18 06:16:02 +02:00
control={<Switch checked={disableHotkeys} onChange={handleDisableHotkeysChange} />}
2021-09-15 03:05:49 +02:00
label={
<Tooltip
title={
<Typography>
If this is set, then most hotkeys (keyboard shortcuts) in the game are disabled. This includes
Terminal commands, hotkeys to navigate between different parts of the game, and the "Save and
Close (Ctrl + b)" hotkey in the Text Editor.
</Typography>
}
>
<Typography>Disable hotkeys</Typography>
</Tooltip>
}
/>
</ListItem>
<ListItem>
<FormControlLabel
2021-09-18 06:16:02 +02:00
control={<Switch checked={disableASCIIArt} onChange={handleDisableASCIIArtChange} />}
2021-09-15 03:05:49 +02:00
label={
<Tooltip title={<Typography>If this is set all ASCII art will be disabled.</Typography>}>
<Typography>Disable ascii art</Typography>
</Tooltip>
}
/>
</ListItem>
<ListItem>
<FormControlLabel
2021-09-18 06:16:02 +02:00
control={<Switch checked={disableTextEffects} onChange={handleDisableTextEffectsChange} />}
2021-09-15 03:05:49 +02:00
label={
<Tooltip
title={
<Typography>
If this is set, text effects will not be displayed. This can help if text is difficult to read
in certain areas.
</Typography>
}
>
<Typography>Disable text effects</Typography>
</Tooltip>
}
/>
</ListItem>
2021-09-22 07:36:17 +02:00
<ListItem>
<FormControlLabel
control={<Switch checked={enableBashHotkeys} onChange={handleEnableBashHotkeysChange} />}
label={
<Tooltip
title={
<Typography>
Improved Bash emulation mode. Setting this to 1 enables several new Terminal shortcuts and
features that more closely resemble a real Bash-style shell. Note that when this mode is
enabled, the default browser shortcuts are overriden by the new Bash shortcuts.
</Typography>
}
>
<Typography>Enable bash hotkeys</Typography>
</Tooltip>
}
/>
</ListItem>
<ListItem>
2021-11-11 23:00:36 +01:00
<Tooltip
title={
<Typography>
Terminal commands and log entries will be timestamped. See
https://date-fns.org/docs/Getting-Started/
</Typography>
2021-09-22 07:36:17 +02:00
}
2021-11-11 23:00:36 +01:00
>
<span>
<TextField
InputProps={{
startAdornment: (
2021-11-12 05:28:08 +01:00
<Typography
color={
formatTime(timestampFormat) === "format error" && timestampFormat !== ""
? "error"
: "success"
}
>
2021-11-11 23:00:36 +01:00
Timestamp&nbsp;format:&nbsp;
</Typography>
),
}}
value={timestampFormat}
onChange={handleTimestampFormatChange}
2021-11-19 20:39:38 +01:00
placeholder="yyyy-MM-dd hh:mm:ss"
2021-11-11 23:00:36 +01:00
/>
</span>
</Tooltip>
2021-09-22 07:36:17 +02:00
</ListItem>
2021-10-11 23:57:17 +02:00
<ListItem>
<FormControlLabel
control={<Switch checked={saveGameOnFileSave} onChange={handleSaveGameOnFile} />}
label={
<Tooltip
title={<Typography>Save your game any time a file is saved in the script editor.</Typography>}
>
<Typography>Save game on file save</Typography>
</Tooltip>
}
/>
</ListItem>
2021-09-15 03:05:49 +02:00
<ListItem>
<Tooltip title={<Typography>Sets the locale for displaying numbers.</Typography>}>
<Typography>Locale&nbsp;</Typography>
</Tooltip>
<Select value={locale} onChange={handleLocaleChange}>
<MenuItem value="en">en</MenuItem>
<MenuItem value="bg">bg</MenuItem>
<MenuItem value="cs">cs</MenuItem>
<MenuItem value="da-dk">da-dk</MenuItem>
<MenuItem value="de">de</MenuItem>
<MenuItem value="en-au">en-au</MenuItem>
<MenuItem value="en-gb">en-gb</MenuItem>
<MenuItem value="es">es</MenuItem>
<MenuItem value="fr">fr</MenuItem>
<MenuItem value="hu">hu</MenuItem>
<MenuItem value="it">it</MenuItem>
<MenuItem value="lv">lv</MenuItem>
<MenuItem value="no">no</MenuItem>
<MenuItem value="pl">pl</MenuItem>
<MenuItem value="ru">ru</MenuItem>
</Select>
</ListItem>
</List>
2021-11-29 05:51:01 +01:00
{!location.href.startsWith("file://") && (
<>
<ListItem>
<Typography>danielyxie / BigD (Original developer): </Typography>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_s-xclick" />
<input
type="hidden"
name="encrypted"
value="-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYA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wTzPIfPY1SI8WHe4cJbP2f2EYxIVs8D7OSirbW4yVa0+gACaLLj0rzIzNN8P/5PxgB03D+jwkcJABqng==-----END PKCS7-----"
/>
<input
type="image"
src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif"
name="submit"
alt="PayPal - The safer, easier way to pay online!"
/>
</form>
</ListItem>
<ListItem>
<Typography>
hydroflame (Current maintainer):{" "}
<Link href="https://www.google.com/search?q=Where+to+donate+blood+near+me%3F" target="_blank">
Donate blood!
</Link>{" "}
</Typography>
</ListItem>
</>
)}
2021-09-15 03:05:49 +02:00
</Grid>
<Grid item xs={12} sm={6}>
<Box>
<Button onClick={() => props.save()}>Save Game</Button>
<Button onClick={() => setDeleteOpen(true)}>Delete Game</Button>
2021-09-15 03:05:49 +02:00
</Box>
<Box>
2021-09-18 18:13:20 +02:00
<Tooltip title={<Typography>export</Typography>}>
2021-09-20 00:04:12 +02:00
<Button onClick={() => props.export()}>
2021-09-18 18:13:20 +02:00
<DownloadIcon color="primary" />
2021-09-20 07:18:20 +02:00
Export
2021-09-20 00:04:12 +02:00
</Button>
2021-09-18 18:13:20 +02:00
</Tooltip>
<Tooltip title={<Typography>import</Typography>}>
2021-09-21 22:49:38 +02:00
<Button onClick={startImport}>
2021-09-18 18:13:20 +02:00
<UploadIcon color="primary" />
2021-09-20 07:18:20 +02:00
Import
2021-09-20 00:04:12 +02:00
<input ref={importInput} id="import-game-file-selector" type="file" hidden onChange={onImport} />
</Button>
2021-09-18 18:13:20 +02:00
</Tooltip>
2021-09-15 03:05:49 +02:00
</Box>
<Box>
<Tooltip
title={
<Typography>
Forcefully kill all active running scripts, in case there is a bug or some unexpected issue with the
game. After using this, save the game and then reload the page. This is different then normal kill in
that normal kill will tell the script to shut down while force kill just removes the references to it
(and it should crash on it's own). This will not remove the files on your computer. Just forcefully
kill all running instance of all scripts.
</Typography>
}
2021-09-13 18:44:46 +02:00
>
2021-09-15 03:05:49 +02:00
<Button onClick={() => props.forceKill()}>Force kill all active scripts</Button>
</Tooltip>
</Box>
<Box>
<Tooltip
title={
<Typography>
Perform a soft reset. Resets everything as if you had just purchased an Augmentation.
</Typography>
}
>
<Button onClick={() => props.softReset()}>Soft Reset</Button>
</Tooltip>
</Box>
<Box>
<Tooltip
title={
<Typography>
If your save file is extremely big you can use this button to view a map of all the files on every
server. Be careful there might be spoilers.
</Typography>
}
>
<Button onClick={() => setDiagnosticOpen(true)}>Diagnose files</Button>
</Tooltip>
2021-09-22 08:20:29 +02:00
<Button onClick={() => setThemeEditorOpen(true)}>Theme editor</Button>
2021-09-15 03:05:49 +02:00
</Box>
<Box>
2021-09-21 22:50:33 +02:00
<Link href="https://github.com/danielyxie/bitburner/issues/new" target="_blank">
<Typography>Report bug</Typography>
</Link>
2021-09-15 03:05:49 +02:00
<Link href="https://bitburner.readthedocs.io/en/latest/changelog.html" target="_blank">
<Typography>Changelog</Typography>
</Link>
<Link href="https://bitburner.readthedocs.io/en/latest/index.html" target="_blank">
<Typography>Documentation</Typography>
</Link>
<Link href="https://discord.gg/TFc3hKD" target="_blank">
<Typography>Discord</Typography>
</Link>
<Link href="https://www.reddit.com/r/bitburner" target="_blank">
<Typography>Reddit</Typography>
</Link>
2021-10-05 05:56:24 +02:00
<Link href="https://plaza.dsolver.ca/games/bitburner" target="_blank">
<Typography>Incremental game plaza</Typography>
</Link>
2021-09-15 03:05:49 +02:00
</Box>
</Grid>
</Grid>
2021-09-15 03:47:42 +02:00
<FileDiagnosticModal open={diagnosticOpen} onClose={() => setDiagnosticOpen(false)} />
<ConfirmationModal
2021-09-17 01:23:03 +02:00
onConfirm={() => {
setDeleteOpen(false);
2021-09-21 22:49:38 +02:00
deleteGame()
2021-09-24 00:47:43 +02:00
.then(() => setTimeout(() => location.reload(), 1000))
2021-09-21 22:49:38 +02:00
.catch((r) => console.error(`Could not delete game: ${r}`));
2021-09-17 01:23:03 +02:00
}}
open={deleteGameOpen}
onClose={() => setDeleteOpen(false)}
confirmationText={"Really delete your game? (It's permanent!)"}
/>
2021-09-22 08:20:29 +02:00
<ThemeEditorModal open={themeEditorOpen} onClose={() => setThemeEditorOpen(false)} />
2021-09-15 03:05:49 +02:00
</div>
);
2021-09-13 18:44:46 +02:00
}