diff --git a/src/Augmentation/ui/AugmentationsRoot.tsx b/src/Augmentation/ui/AugmentationsRoot.tsx
index 7b20f0bd7..9f55c94a8 100644
--- a/src/Augmentation/ui/AugmentationsRoot.tsx
+++ b/src/Augmentation/ui/AugmentationsRoot.tsx
@@ -16,6 +16,8 @@ import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button";
import Tooltip from "@mui/material/Tooltip";
import Box from "@mui/material/Box";
+import { Settings } from "../../Settings/Settings";
+import { ConfirmationModal } from "../../ui/React/ConfirmationModal";
interface IProps {
exportGameFn: () => void;
@@ -23,6 +25,7 @@ interface IProps {
}
export function AugmentationsRoot(props: IProps): React.ReactElement {
+ const [installOpen, setInstallOpen] = useState(false);
const player = use.Player();
const setRerender = useState(false)[1];
function rerender(): void {
@@ -43,6 +46,14 @@ export function AugmentationsRoot(props: IProps): React.ReactElement {
return "";
}
+ function doInstall(): void {
+ if (!Settings.SuppressBuyAugmentationConfirmation) {
+ setInstallOpen(true);
+ } else {
+ props.installAugmentationsFn();
+ }
+ }
+
return (
<>
Augmentations
@@ -73,11 +84,36 @@ export function AugmentationsRoot(props: IProps): React.ReactElement {
'I never asked for this'}>
-
+ setInstallOpen(false)}
+ onConfirm={props.installAugmentationsFn}
+ confirmationText={
+ <>
+ Installing will reset
+
+ - money
+ - skill / experience
+ - every server except home
+ - factions and reputation
+
+
+ You will keep:
+
+ - All scripts on home
+ - home ram and cores
+
+
+ It is recommended to install several Augmentations at once. Preferably everything from any faction of your
+ chosing.
+ >
+ }
+ />
It's always a good idea to backup/export your save!}>
Backup Save {exportBonusStr()}
diff --git a/src/Exploits/loops.ts b/src/Exploits/loops.ts
index d4ded3b1e..4e066849c 100644
--- a/src/Exploits/loops.ts
+++ b/src/Exploits/loops.ts
@@ -24,9 +24,9 @@ function timeCompression(): void {
return;
}
last = now;
- window.setTimeout(minute, 1000);
+ window.setTimeout(minute, 1000 * 60);
}
- window.setTimeout(minute, 1000);
+ window.setTimeout(minute, 1000 * 60);
}
export function startExploits(): void {
diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts
index 40837a915..284023320 100644
--- a/src/NetscriptFunctions.ts
+++ b/src/NetscriptFunctions.ts
@@ -304,7 +304,10 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
const checkSingularityAccess = function (func: any, n: any): void {
if (Player.bitNodeN !== 4) {
if (SourceFileFlags[4] < n) {
- throw makeRuntimeErrorMsg(func, `This singularity function requires Source-File 4-${n} to run.`);
+ throw makeRuntimeErrorMsg(
+ func,
+ `This singularity function requires Source-File 4-${n} to run. A power up you obtain later in the game. It will be very obvious when and how you can obtain it.`,
+ );
}
}
};
@@ -1611,7 +1614,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
const cost = getPurchaseServerCost(ram);
if (cost === Infinity) {
- workerScript.log("purchaseServer", () => `Invalid argument: ram='${ram}'`);
+ workerScript.log("purchaseServer", () => `Invalid argument: ram='${ram}' must be power of 2`);
return "";
}
diff --git a/src/ui/React/ConfirmationModal.tsx b/src/ui/React/ConfirmationModal.tsx
index 337ad64d7..e58b2fa57 100644
--- a/src/ui/React/ConfirmationModal.tsx
+++ b/src/ui/React/ConfirmationModal.tsx
@@ -8,7 +8,7 @@ interface IProps {
open: boolean;
onClose: () => void;
onConfirm: () => void;
- confirmationText: string;
+ confirmationText: string | React.ReactNode;
}
export function ConfirmationModal(props: IProps): React.ReactElement {
diff --git a/src/ui/React/GameOptionsRoot.tsx b/src/ui/React/GameOptionsRoot.tsx
index 9400eb872..fac1faa4c 100644
--- a/src/ui/React/GameOptionsRoot.tsx
+++ b/src/ui/React/GameOptionsRoot.tsx
@@ -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 (
@@ -388,7 +397,7 @@ export function GameOptionsRoot(props: IProps): React.ReactElement {
}
>
- Suppress buy augmentation confirmation
+ Suppress augmentations confirmation
}
/>
@@ -428,15 +437,11 @@ export function GameOptionsRoot(props: IProps): React.ReactElement {
)}
- }
+ control={}
label={
- If this is set, there will be no "Saved Game" toast appearing after save.
-
+ If this is set, there will be no "Saved Game" toast appearing after save.
}
>
Suppress Saved Game Toast
@@ -650,8 +655,14 @@ export function GameOptionsRoot(props: IProps): React.ReactElement {
}
>
- props.softReset()}>Soft Reset
+ Soft Reset
+ setSoftResetOpen(false)}
+ onConfirm={props.softReset}
+ confirmationText={"This will perform the same action as installing Augmentations, are you sure?"}
+ />