mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 16:22:56 +02:00
Add confirmation to installing
This commit is contained in:
@@ -83,6 +83,7 @@ export function GameOptionsRoot(props: IProps): React.ReactElement {
|
||||
const [diagnosticOpen, setDiagnosticOpen] = useState(false);
|
||||
const [deleteGameOpen, setDeleteOpen] = useState(false);
|
||||
const [themeEditorOpen, setThemeEditorOpen] = useState(false);
|
||||
const [softResetOpen, setSoftResetOpen] = useState(false);
|
||||
|
||||
function handleExecTimeChange(event: any, newValue: number | number[]): void {
|
||||
setExecTime(newValue as number);
|
||||
@@ -210,6 +211,14 @@ export function GameOptionsRoot(props: IProps): React.ReactElement {
|
||||
reader.readAsText(file);
|
||||
}
|
||||
|
||||
function doSoftReset(): void {
|
||||
if (!Settings.SuppressBuyAugmentationConfirmation) {
|
||||
setSoftResetOpen(true);
|
||||
} else {
|
||||
props.softReset();
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={classes.root} style={{ width: "90%" }}>
|
||||
<Typography variant="h4" gutterBottom>
|
||||
@@ -388,7 +397,7 @@ export function GameOptionsRoot(props: IProps): React.ReactElement {
|
||||
</Typography>
|
||||
}
|
||||
>
|
||||
<Typography>Suppress buy augmentation confirmation</Typography>
|
||||
<Typography>Suppress augmentations confirmation</Typography>
|
||||
</Tooltip>
|
||||
}
|
||||
/>
|
||||
@@ -428,15 +437,11 @@ export function GameOptionsRoot(props: IProps): React.ReactElement {
|
||||
)}
|
||||
<ListItem>
|
||||
<FormControlLabel
|
||||
control={
|
||||
<Switch checked={suppressSavedGameToast} onChange={handleSuppressSavedGameToastChange} />
|
||||
}
|
||||
control={<Switch checked={suppressSavedGameToast} onChange={handleSuppressSavedGameToastChange} />}
|
||||
label={
|
||||
<Tooltip
|
||||
title={
|
||||
<Typography>
|
||||
If this is set, there will be no "Saved Game" toast appearing after save.
|
||||
</Typography>
|
||||
<Typography>If this is set, there will be no "Saved Game" toast appearing after save.</Typography>
|
||||
}
|
||||
>
|
||||
<Typography>Suppress Saved Game Toast</Typography>
|
||||
@@ -650,8 +655,14 @@ export function GameOptionsRoot(props: IProps): React.ReactElement {
|
||||
</Typography>
|
||||
}
|
||||
>
|
||||
<Button onClick={() => props.softReset()}>Soft Reset</Button>
|
||||
<Button onClick={doSoftReset}>Soft Reset</Button>
|
||||
</Tooltip>
|
||||
<ConfirmationModal
|
||||
open={softResetOpen}
|
||||
onClose={() => setSoftResetOpen(false)}
|
||||
onConfirm={props.softReset}
|
||||
confirmationText={"This will perform the same action as installing Augmentations, are you sure?"}
|
||||
/>
|
||||
</Box>
|
||||
<Box>
|
||||
<Tooltip
|
||||
|
||||
Reference in New Issue
Block a user