Merge pull request #2366 from MartinFournier/fix/autosave-toast-setting

Change SuppressSaveToast to only work on auto-save
This commit is contained in:
hydroflame 2022-01-06 11:25:57 -05:00 committed by GitHub
commit b39c00e64f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

@ -64,12 +64,12 @@ class BitburnerSaveObject {
return saveString;
}
saveGame(): void {
saveGame(emitToastEvent = true): void {
const saveString = this.getSaveString();
save(saveString)
.then(() => {
if (!Settings.SuppressSavedGameToast) {
if (emitToastEvent) {
SnackbarEvents.emit("Game Saved!", "info", 2000);
}
})

@ -186,7 +186,7 @@ const Engine: {
Engine.Counters.autoSaveCounter = Infinity;
} else {
Engine.Counters.autoSaveCounter = Settings.AutosaveInterval * 5;
saveObject.saveGame();
saveObject.saveGame(!Settings.SuppressSavedGameToast);
}
}

@ -504,10 +504,10 @@ export function GameOptionsRoot(props: IProps): React.ReactElement {
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 "Game Saved!" toast appearing after an auto-save.</Typography>
}
>
<Typography>Suppress Saved Game Toast</Typography>
<Typography>Suppress Auto-Save Game Toast</Typography>
</Tooltip>
}
/>