From 46fe8cc94cd0e3b1cffcf430a531c00c8ad2ef0d Mon Sep 17 00:00:00 2001 From: Martin Fournier Date: Wed, 5 Jan 2022 14:56:28 -0500 Subject: [PATCH] Change SuppressSaveToast to only work on auto-save Before this, this setting also suppressed the toast for the manual clicks. --- src/SaveObject.tsx | 4 ++-- src/engine.tsx | 2 +- src/ui/React/GameOptionsRoot.tsx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SaveObject.tsx b/src/SaveObject.tsx index 4cfc8efb8..906241609 100755 --- a/src/SaveObject.tsx +++ b/src/SaveObject.tsx @@ -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); } }) diff --git a/src/engine.tsx b/src/engine.tsx index a741d9641..d3afec3b7 100644 --- a/src/engine.tsx +++ b/src/engine.tsx @@ -186,7 +186,7 @@ const Engine: { Engine.Counters.autoSaveCounter = Infinity; } else { Engine.Counters.autoSaveCounter = Settings.AutosaveInterval * 5; - saveObject.saveGame(); + saveObject.saveGame(!Settings.SuppressSavedGameToast); } } diff --git a/src/ui/React/GameOptionsRoot.tsx b/src/ui/React/GameOptionsRoot.tsx index e96f8ce41..2085fe62c 100644 --- a/src/ui/React/GameOptionsRoot.tsx +++ b/src/ui/React/GameOptionsRoot.tsx @@ -504,10 +504,10 @@ export function GameOptionsRoot(props: IProps): React.ReactElement { label={ If this is set, there will be no "Saved Game" toast appearing after save. + If this is set, there will be no "Game Saved!" toast appearing after an auto-save. } > - Suppress Saved Game Toast + Suppress Auto-Save Game Toast } />