From 1022f0746ec148a1077acda0bb162077ffa7e2d3 Mon Sep 17 00:00:00 2001 From: CatLover <152669316+catloversg@users.noreply.github.com> Date: Tue, 10 Dec 2024 13:21:00 +0700 Subject: [PATCH 1/3] UI: Make minor changes in buttons and error messages of tutorial --- src/Terminal/Terminal.ts | 33 ++++++++++--------- .../InteractiveTutorialRoot.tsx | 2 +- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/Terminal/Terminal.ts b/src/Terminal/Terminal.ts index 235be962d9..81297ffe7d 100644 --- a/src/Terminal/Terminal.ts +++ b/src/Terminal/Terminal.ts @@ -636,12 +636,13 @@ export class Terminal { if (n00dlesServ == null) { throw new Error("Could not get n00dles server"); } + const errorMessageForBadCommand = "Bad command. Please follow the tutorial."; switch (ITutorial.currStep) { case iTutorialSteps.TerminalHelp: if (commandArray.length === 1 && commandArray[0] == "help") { iTutorialNextStep(); } else { - this.error("Bad command. Please follow the tutorial"); + this.error(errorMessageForBadCommand); return; } break; @@ -649,7 +650,7 @@ export class Terminal { if (commandArray.length === 1 && commandArray[0] == "ls") { iTutorialNextStep(); } else { - this.error("Bad command. Please follow the tutorial"); + this.error(errorMessageForBadCommand); return; } break; @@ -657,7 +658,7 @@ export class Terminal { if (commandArray.length === 1 && commandArray[0] == "scan") { iTutorialNextStep(); } else { - this.error("Bad command. Please follow the tutorial"); + this.error(errorMessageForBadCommand); return; } break; @@ -665,7 +666,7 @@ export class Terminal { if (commandArray.length == 1 && commandArray[0] == "scan-analyze") { iTutorialNextStep(); } else { - this.error("Bad command. Please follow the tutorial"); + this.error(errorMessageForBadCommand); return; } break; @@ -673,7 +674,7 @@ export class Terminal { if (commandArray.length == 2 && commandArray[0] == "scan-analyze" && commandArray[1] === 2) { iTutorialNextStep(); } else { - this.error("Bad command. Please follow the tutorial"); + this.error(errorMessageForBadCommand); return; } break; @@ -689,7 +690,7 @@ export class Terminal { return; } } else { - this.error("Bad command. Please follow the tutorial"); + this.error(errorMessageForBadCommand); return; } break; @@ -697,7 +698,7 @@ export class Terminal { if (commandArray.length === 1 && commandArray[0] === "analyze") { iTutorialNextStep(); } else { - this.error("Bad command. Please follow the tutorial"); + this.error(errorMessageForBadCommand); return; } break; @@ -705,7 +706,7 @@ export class Terminal { if (commandArray.length == 2 && commandArray[0] == "run" && commandArray[1] == "NUKE.exe") { iTutorialNextStep(); } else { - this.error("Bad command. Please follow the tutorial"); + this.error(errorMessageForBadCommand); return; } break; @@ -713,13 +714,13 @@ export class Terminal { if (commandArray.length == 1 && commandArray[0] == "hack") { iTutorialNextStep(); } else { - this.error("Bad command. Please follow the tutorial"); + this.error(errorMessageForBadCommand); return; } break; case iTutorialSteps.TerminalHackingMechanics: if (commandArray.length !== 1 || !["grow", "weaken", "hack"].includes(commandArray[0] + "")) { - this.error("Bad command. Please follow the tutorial"); + this.error(errorMessageForBadCommand); return; } break; @@ -727,7 +728,7 @@ export class Terminal { if (commandArray.length == 1 && commandArray[0] == "home") { iTutorialNextStep(); } else { - this.error("Bad command. Please follow the tutorial"); + this.error(errorMessageForBadCommand); return; } break; @@ -739,7 +740,7 @@ export class Terminal { ) { iTutorialNextStep(); } else { - this.error("Bad command. Please follow the tutorial"); + this.error(errorMessageForBadCommand); return; } break; @@ -747,7 +748,7 @@ export class Terminal { if (commandArray.length == 1 && commandArray[0] == "free") { iTutorialNextStep(); } else { - this.error("Bad command. Please follow the tutorial"); + this.error(errorMessageForBadCommand); return; } break; @@ -759,7 +760,7 @@ export class Terminal { ) { iTutorialNextStep(); } else { - this.error("Bad command. Please follow the tutorial"); + this.error(errorMessageForBadCommand); return; } break; @@ -771,12 +772,12 @@ export class Terminal { ) { iTutorialNextStep(); } else { - this.error("Bad command. Please follow the tutorial"); + this.error(errorMessageForBadCommand); return; } break; default: - this.error("Please follow the tutorial, or click 'EXIT' if you'd like to skip it"); + this.error("Please follow the tutorial or click 'Skip Tutorial' if you'd like to skip it"); return; } } diff --git a/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx b/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx index 62d670af8e..5818cae77d 100644 --- a/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx +++ b/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx @@ -593,7 +593,7 @@ export async function main(ns) {

From 448a0a9ba8ce3932500e72bbd48e539a0d48157e Mon Sep 17 00:00:00 2001 From: CatLover <152669316+catloversg@users.noreply.github.com> Date: Wed, 11 Dec 2024 10:59:48 +0700 Subject: [PATCH 2/3] Update --- src/Terminal/Terminal.ts | 3 ++- src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Terminal/Terminal.ts b/src/Terminal/Terminal.ts index 81297ffe7d..7704dc187d 100644 --- a/src/Terminal/Terminal.ts +++ b/src/Terminal/Terminal.ts @@ -636,7 +636,8 @@ export class Terminal { if (n00dlesServ == null) { throw new Error("Could not get n00dles server"); } - const errorMessageForBadCommand = "Bad command. Please follow the tutorial."; + const errorMessageForBadCommand = + "Bad command. Please follow the tutorial or click 'Skip Tutorial' if you'd like to skip it."; switch (ITutorial.currStep) { case iTutorialSteps.TerminalHelp: if (commandArray.length === 1 && commandArray[0] == "help") { diff --git a/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx b/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx index 5818cae77d..d890c08948 100644 --- a/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx +++ b/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx @@ -60,6 +60,9 @@ export function InteractiveTutorialRoot(): React.ReactElement { This tutorial will show you the basics of the game. You may skip the tutorial at any time.

+ You can replay this tutorial by going to the Options tab and pressing "Reset tutorial". +
+
You can also collapse this panel to temporarily hide this tutorial. From 9d3be5bde3d808494292aeb19489071f8f4b7e44 Mon Sep 17 00:00:00 2001 From: CatLover <152669316+catloversg@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:26:00 +0700 Subject: [PATCH 3/3] Change "Skip Tutorial" to "Exit Tutorial" --- src/Terminal/Terminal.ts | 4 ++-- src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Terminal/Terminal.ts b/src/Terminal/Terminal.ts index 7704dc187d..6d9929a315 100644 --- a/src/Terminal/Terminal.ts +++ b/src/Terminal/Terminal.ts @@ -637,7 +637,7 @@ export class Terminal { throw new Error("Could not get n00dles server"); } const errorMessageForBadCommand = - "Bad command. Please follow the tutorial or click 'Skip Tutorial' if you'd like to skip it."; + "Bad command. Please follow the tutorial or click 'Exit Tutorial' if you'd like to skip it."; switch (ITutorial.currStep) { case iTutorialSteps.TerminalHelp: if (commandArray.length === 1 && commandArray[0] == "help") { @@ -778,7 +778,7 @@ export class Terminal { } break; default: - this.error("Please follow the tutorial or click 'Skip Tutorial' if you'd like to skip it"); + this.error("Please follow the tutorial or click 'Exit Tutorial' if you'd like to skip it"); return; } } diff --git a/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx b/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx index d890c08948..ef08c8ac76 100644 --- a/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx +++ b/src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx @@ -596,7 +596,7 @@ export async function main(ns) {