import React, { useState } from "react"; import { IPlayer } from "../../PersonObjects/IPlayer"; 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"; import IconButton from "@mui/material/IconButton"; 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"; import DownloadIcon from "@mui/icons-material/Download"; import UploadIcon from "@mui/icons-material/Upload"; import { FileDiagnosticModal } from "../../Diagnostic/FileDiagnosticModal"; import { ConfirmationModal } from "./ConfirmationModal"; import { Settings } from "../../Settings/Settings"; const useStyles = makeStyles((theme: Theme) => createStyles({ root: { width: 50, padding: theme.spacing(2), userSelect: "none", }, }), ); interface IProps { player: IPlayer; save: () => void; delete: () => void; export: () => void; import: () => void; forceKill: () => void; softReset: () => void; } export function GameOptionsRoot(props: IProps): React.ReactElement { const classes = useStyles(); const [execTime, setExecTime] = useState(Settings.CodeInstructionRunTime); const [logSize, setLogSize] = useState(Settings.MaxLogCapacity); const [portSize, setPortSize] = useState(Settings.MaxPortCapacity); const [terminalSize, setTerminalSize] = useState(Settings.MaxTerminalCapacity); const [autosaveInterval, setAutosaveInterval] = useState(Settings.AutosaveInterval); const [suppressMessages, setSuppressMessages] = useState(Settings.SuppressMessages); const [suppressFactionInvites, setSuppressFactionInvites] = useState(Settings.SuppressFactionInvites); const [suppressTravelConfirmations, setSuppressTravelConfirmations] = useState(Settings.SuppressTravelConfirmation); const [suppressBuyAugmentationConfirmation, setSuppressBuyAugmentationConfirmation] = useState( Settings.SuppressBuyAugmentationConfirmation, ); const [suppressHospitalizationPopup, setSuppressHospitalizationPopup] = useState( Settings.SuppressHospitalizationPopup, ); const [suppressBladeburnerPopup, setSuppressBladeburnerPopup] = useState(Settings.SuppressBladeburnerPopup); const [disableHotkeys, setDisableHotkeys] = useState(Settings.DisableHotkeys); const [disableASCIIArt, setDisableASCIIArt] = useState(Settings.DisableASCIIArt); const [disableTextEffects, setDisableTextEffects] = useState(Settings.DisableTextEffects); const [locale, setLocale] = useState(Settings.Locale); const [diagnosticOpen, setDiagnosticOpen] = useState(false); const [deleteGameOpen, setDeleteOpen] = useState(false); function handleExecTimeChange(event: any, newValue: number | number[]): void { setExecTime(newValue as number); Settings.CodeInstructionRunTime = newValue as number; } function handleLogSizeChange(event: any, newValue: number | number[]): void { setLogSize(newValue as number); Settings.MaxLogCapacity = newValue as number; } function handlePortSizeChange(event: any, newValue: number | number[]): void { setPortSize(newValue as number); Settings.MaxPortCapacity = newValue as number; } function handleTerminalSizeChange(event: any, newValue: number | number[]): void { setTerminalSize(newValue as number); Settings.MaxTerminalCapacity = newValue as number; } function handleAutosaveIntervalChange(event: any, newValue: number | number[]): void { setAutosaveInterval(newValue as number); Settings.AutosaveInterval = newValue as number; } function handleSuppressMessagesChange(event: React.ChangeEvent): void { setSuppressMessages(event.target.checked); Settings.SuppressMessages = event.target.checked; } function handleSuppressFactionInvitesChange(event: React.ChangeEvent): void { setSuppressFactionInvites(event.target.checked); Settings.SuppressFactionInvites = event.target.checked; } function handleSuppressTravelConfirmationsChange(event: React.ChangeEvent): void { setSuppressTravelConfirmations(event.target.checked); Settings.SuppressTravelConfirmation = event.target.checked; } function handleSuppressBuyAugmentationConfirmationChange(event: React.ChangeEvent): void { setSuppressBuyAugmentationConfirmation(event.target.checked); Settings.SuppressBuyAugmentationConfirmation = event.target.checked; } function handleSuppressHospitalizationPopupChange(event: React.ChangeEvent): void { setSuppressHospitalizationPopup(event.target.checked); Settings.SuppressHospitalizationPopup = event.target.checked; } function handleSuppressBladeburnerPopupChange(event: React.ChangeEvent): void { setSuppressBladeburnerPopup(event.target.checked); Settings.SuppressBladeburnerPopup = event.target.checked; } function handleDisableHotkeysChange(event: React.ChangeEvent): void { setDisableHotkeys(event.target.checked); Settings.DisableHotkeys = event.target.checked; } function handleDisableASCIIArtChange(event: React.ChangeEvent): void { setDisableASCIIArt(event.target.checked); Settings.DisableASCIIArt = event.target.checked; } function handleDisableTextEffectsChange(event: React.ChangeEvent): void { setDisableTextEffects(event.target.checked); Settings.DisableTextEffects = event.target.checked; } function handleLocaleChange(event: SelectChangeEvent): void { setLocale(event.target.value as string); Settings.Locale = event.target.value as string; } return (
Options 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. } > Netscript exec time (ms) 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. } > Netscript log size 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. } > Netscript port size 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. } > Terminal capacity The time (in seconds) between each autosave. Set to 0 to disable autosave. } > Autosave interval (s) } label={ 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. } > Suppress messages } /> } label={ 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. } > Suppress faction invites } /> } label={ 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. } > Suppress travel confirmations } /> } label={ If this is set, the confirmation message before buying augmentation will not show up. } > Suppress buy augmentation confirmation } /> } label={ If this is set, a popup message will no longer be shown when you are hospitalized after taking too much damage. } > Suppress hospitalization popup } /> {!!props.player.bladeburner && ( } label={ If this is set, then having your Bladeburner actions interrupted by being busy with something else will not display a popup message. } > Suppress bladeburner popup } /> )} } label={ 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. } > Disable hotkeys } /> } label={ If this is set all ASCII art will be disabled.}> Disable ascii art } /> } label={ If this is set, text effects will not be displayed. This can help if text is difficult to read in certain areas. } > Disable text effects } /> Sets the locale for displaying numbers.}> Locale 

export}> props.export()}> import}> props.import()}> 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. } > Perform a soft reset. Resets everything as if you had just purchased an Augmentation. } > 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. } > Changelog Documentation Changelog Discord Reddit
setDiagnosticOpen(false)} /> { props.delete(); setDeleteOpen(false); }} open={deleteGameOpen} onClose={() => setDeleteOpen(false)} confirmationText={"Really delete your game? (It's permanent!)"} />
); }