From 069d76df25e3f3fe62f430059c58ef28f52fa6b9 Mon Sep 17 00:00:00 2001 From: Adraxas Date: Fri, 17 Dec 2021 18:40:00 -0800 Subject: [PATCH 1/3] Fix NS.exec signature --- src/ScriptEditor/NetscriptDefinitions.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index 8172e733a..68b1c94c2 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -4378,7 +4378,7 @@ export interface NS extends Singularity { * @param args - Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the third argument numThreads must be filled in with a value. * @returns Returns the PID of a successfully started script, and 0 otherwise. */ - exec(script: string, host: string, numThreads?: number, ...args: string[]): number; + exec(script: string, host: string, numThreads?: number, ...args: Array): number; /** * Terminate current script and start another in 10s. From 5e5e2c60aacb38adf535fa715c7c0c1bcaf5c1a8 Mon Sep 17 00:00:00 2001 From: Jared Jolton <2PacIsAlive@users.noreply.github.com> Date: Fri, 17 Dec 2021 21:58:05 -0700 Subject: [PATCH 2/3] Fix typo in AutolinkProgram description --- src/DarkWeb/DarkWebItems.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DarkWeb/DarkWebItems.ts b/src/DarkWeb/DarkWebItems.ts index a341ff54a..ff9161f9e 100644 --- a/src/DarkWeb/DarkWebItems.ts +++ b/src/DarkWeb/DarkWebItems.ts @@ -15,6 +15,6 @@ export const DarkWebItems: IMap = { ), DeepscanV1: new DarkWebItem(Programs.DeepscanV1.name, 500000, "Enables 'scan-analyze' with a depth up to 5."), DeepscanV2: new DarkWebItem(Programs.DeepscanV2.name, 25e6, "Enables 'scan-analyze' with a depth up to 10."), - AutolinkProgram: new DarkWebItem(Programs.AutoLink.name, 1e6, "Enables direct connect via 'scan-analyze."), + AutolinkProgram: new DarkWebItem(Programs.AutoLink.name, 1e6, "Enables direct connect via 'scan-analyze'."), FormulasProgram: new DarkWebItem(Programs.Formulas.name, 5e9, "Unlock access to the formulas API."), }; From 733f04c3439d736864b995c6e545b28e4926523a Mon Sep 17 00:00:00 2001 From: Martin Fournier Date: Sat, 18 Dec 2021 08:01:15 -0500 Subject: [PATCH 3/3] Add an option to suppress the 'Saved Game' toast --- src/SaveObject.tsx | 6 +++++- src/Settings/Settings.ts | 7 +++++++ src/ui/React/GameOptionsRoot.tsx | 24 ++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/src/SaveObject.tsx b/src/SaveObject.tsx index 6a15fbb11..8e9cd4737 100755 --- a/src/SaveObject.tsx +++ b/src/SaveObject.tsx @@ -67,7 +67,11 @@ class BitburnerSaveObject { const saveString = this.getSaveString(); save(saveString) - .then(() => SnackbarEvents.emit("Game Saved!", "info")) + .then(() => { + if (!Settings.SuppressSavedGameToast) { + SnackbarEvents.emit("Game Saved!", "info") + } + }) .catch((err) => console.error(err)); } diff --git a/src/Settings/Settings.ts b/src/Settings/Settings.ts index 09bd06031..8a4cbdd31 100644 --- a/src/Settings/Settings.ts +++ b/src/Settings/Settings.ts @@ -103,6 +103,11 @@ interface IDefaultSettings { */ SuppressTIXPopup: boolean; + /** + * Whether the user should be displayed a toast alert when the game is saved. + */ + SuppressSavedGameToast: boolean; + /* * Theme colors */ @@ -186,6 +191,7 @@ export const defaultSettings: IDefaultSettings = { SuppressTravelConfirmation: false, SuppressBladeburnerPopup: false, SuppressTIXPopup: false, + SuppressSavedGameToast: false, theme: { primarylight: "#0f0", @@ -251,6 +257,7 @@ export const Settings: ISettings & ISelfInitializer & ISelfLoading = { SuppressTravelConfirmation: defaultSettings.SuppressTravelConfirmation, SuppressBladeburnerPopup: defaultSettings.SuppressBladeburnerPopup, SuppressTIXPopup: defaultSettings.SuppressTIXPopup, + SuppressSavedGameToast: defaultSettings.SuppressSavedGameToast, MonacoTheme: "monokai", MonacoInsertSpaces: false, MonacoFontSize: 20, diff --git a/src/ui/React/GameOptionsRoot.tsx b/src/ui/React/GameOptionsRoot.tsx index 9d6ce9e10..9400eb872 100644 --- a/src/ui/React/GameOptionsRoot.tsx +++ b/src/ui/React/GameOptionsRoot.tsx @@ -70,6 +70,7 @@ export function GameOptionsRoot(props: IProps): React.ReactElement { ); const [suppressTIXPopup, setSuppressTIXPopup] = useState(Settings.SuppressTIXPopup); const [suppressBladeburnerPopup, setSuppressBladeburnerPopup] = useState(Settings.SuppressBladeburnerPopup); + const [suppressSavedGameToast, setSuppresSavedGameToast] = useState(Settings.SuppressSavedGameToast); const [disableHotkeys, setDisableHotkeys] = useState(Settings.DisableHotkeys); const [disableASCIIArt, setDisableASCIIArt] = useState(Settings.DisableASCIIArt); @@ -138,6 +139,11 @@ export function GameOptionsRoot(props: IProps): React.ReactElement { Settings.SuppressBladeburnerPopup = event.target.checked; } + function handleSuppressSavedGameToastChange(event: React.ChangeEvent): void { + setSuppresSavedGameToast(event.target.checked); + Settings.SuppressSavedGameToast = event.target.checked; + } + function handleDisableHotkeysChange(event: React.ChangeEvent): void { setDisableHotkeys(event.target.checked); Settings.DisableHotkeys = event.target.checked; @@ -420,6 +426,24 @@ export function GameOptionsRoot(props: IProps): React.ReactElement { /> )} + + + } + label={ + + If this is set, there will be no "Saved Game" toast appearing after save. + + } + > + Suppress Saved Game Toast + + } + /> + }