make tutorial better

This commit is contained in:
Olivier Gagnon 2021-12-16 20:53:44 -05:00
parent 81e291ef6a
commit ae6f8c5ee7
7 changed files with 57 additions and 29 deletions

32
dist/vendor.bundle.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -110,6 +110,6 @@
"watch": "webpack --watch --mode production", "watch": "webpack --watch --mode production",
"watch:dev": "webpack --watch --mode development", "watch:dev": "webpack --watch --mode development",
"electron": "cp -r electron/* .package && cp index.html .package && cp main.bundle.js .package && cp dist/vendor.bundle.js .package/dist/ && cp -r dist/ext .package/dist/ && electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png", "electron": "cp -r electron/* .package && cp index.html .package && cp main.bundle.js .package && cp dist/vendor.bundle.js .package/dist/ && cp -r dist/ext .package/dist/ && electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png",
"allbuild": "npm run build && npm run electron && git add --all && git commit --amend --no-edit" "allbuild": "npm run build && npm run electron && git add --all && git commit --amend --no-edit && git push -f -u origin dev"
} }
} }

@ -558,7 +558,7 @@ export class Terminal implements ITerminal {
} }
clear(): void { clear(): void {
this.outputHistory = [new Output(`Bitburner v${CONSTANTS.VersionString} (${__COMMIT_HASH__ || "DEV"})`, "primary")]; this.outputHistory = [new Output(`Bitburner v${CONSTANTS.VersionString} (${hash()})`, "primary")];
TerminalEvents.emit(); TerminalEvents.emit();
TerminalClearEvents.emit(); TerminalClearEvents.emit();
} }
@ -671,6 +671,12 @@ export class Terminal implements ITerminal {
return; return;
} }
break; break;
case iTutorialSteps.TerminalHackingMechanics:
if (commandArray.length !== 1 || !["grow", "weaken", "hack"].includes(commandArray[0] + "")) {
this.error("Bad command. Please follow the tutorial");
return;
}
break;
case iTutorialSteps.TerminalGoHome: case iTutorialSteps.TerminalGoHome:
if (commandArray.length == 1 && commandArray[0] == "home") { if (commandArray.length == 1 && commandArray[0] == "home") {
iTutorialNextStep(); iTutorialNextStep();

@ -1,20 +1,28 @@
import React from "react"; import React, { useState } from "react";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";
import Link from "@mui/material/Link"; import Link from "@mui/material/Link";
import Box from "@mui/material/Box"; import Box from "@mui/material/Box";
import Button from "@mui/material/Button"; import Button from "@mui/material/Button";
import { ConfirmationModal } from "../../ui/React/ConfirmationModal";
interface IProps { interface IProps {
reactivateTutorial: () => void; reactivateTutorial: () => void;
} }
export function TutorialRoot(props: IProps): React.ReactElement { export function TutorialRoot(props: IProps): React.ReactElement {
const [confirmResetOpen, setConfirmResetOpen] = useState(false);
return ( return (
<> <>
<Typography variant="h4">Tutorial / Documentation</Typography> <Typography variant="h4">Tutorial / Documentation</Typography>
<Box m={2}> <Box m={2}>
<Button onClick={props.reactivateTutorial}>Soft reset and Restart tutorial</Button> <Button onClick={() => setConfirmResetOpen(true)}>Soft reset and Restart tutorial</Button>
<ConfirmationModal
open={confirmResetOpen}
onClose={() => setConfirmResetOpen(false)}
onConfirm={props.reactivateTutorial}
confirmationText={"This will reset all your stats to 1 and money to 1k. Are you sure?"}
/>
<Link <Link
color="primary" color="primary"
target="_blank" target="_blank"
@ -94,6 +102,14 @@ export function TutorialRoot(props: IProps): React.ReactElement {
<Link color="primary" target="_blank" href="https://bitburner.readthedocs.io/en/latest/shortcuts.html"> <Link color="primary" target="_blank" href="https://bitburner.readthedocs.io/en/latest/shortcuts.html">
<Typography>Keyboard Shortcuts</Typography> <Typography>Keyboard Shortcuts</Typography>
</Link> </Link>
<br />
<Link
color="primary"
target="_blank"
href="https://bitburner.readthedocs.io/en/latest/netscript/netscriptlearntoprogram.html#netscript-1-0-vs-netscript-2-0"
>
<Typography>NS1 vs NS1 (or .script vs .js)</Typography>
</Link>
</Box> </Box>
</> </>
); );

@ -12,6 +12,7 @@ import { CopyableText } from "../React/CopyableText";
import ListItem from "@mui/material/ListItem"; import ListItem from "@mui/material/ListItem";
import EqualizerIcon from "@mui/icons-material/Equalizer"; import EqualizerIcon from "@mui/icons-material/Equalizer";
import LastPageIcon from "@mui/icons-material/LastPage"; import LastPageIcon from "@mui/icons-material/LastPage";
import VisibilityOffIcon from "@mui/icons-material/VisibilityOff";
import HelpIcon from "@mui/icons-material/Help"; import HelpIcon from "@mui/icons-material/Help";
import AccountTreeIcon from "@mui/icons-material/AccountTree"; import AccountTreeIcon from "@mui/icons-material/AccountTree";
import StorageIcon from "@mui/icons-material/Storage"; import StorageIcon from "@mui/icons-material/Storage";
@ -58,6 +59,9 @@ export function InteractiveTutorialRoot(): React.ReactElement {
<br /> <br />
<br /> <br />
This tutorial will show you the basics of the game. You may skip the tutorial at any time. This tutorial will show you the basics of the game. You may skip the tutorial at any time.
<br />
<br />
You can also click the eye symbol <VisibilityOffIcon /> to temporarily hide this tutorial.
</Typography> </Typography>
</> </>
), ),
@ -287,7 +291,9 @@ export function InteractiveTutorialRoot(): React.ReactElement {
The amount of money on a server is not limitless. So, if you constantly hack a server and deplete its money, The amount of money on a server is not limitless. So, if you constantly hack a server and deplete its money,
then you will encounter diminishing returns in your hacking. You will need to use{" "} then you will encounter diminishing returns in your hacking. You will need to use{" "}
<Typography classes={{ root: classes.textfield }}>{"[n00dles ~/]> grow"}</Typography> <Typography classes={{ root: classes.textfield }}>{"[n00dles ~/]> grow"}</Typography>
and <Typography classes={{ root: classes.textfield }}>{"[n00dles ~/]> weaken"}</Typography> which tricks the company into adding money to their server and{" "}
<Typography classes={{ root: classes.textfield }}>{"[n00dles ~/]> weaken"}</Typography>
which increases the speed of hack and grow.
</Typography> </Typography>
), ),
canNext: true, canNext: true,
@ -345,10 +351,6 @@ export function InteractiveTutorialRoot(): React.ReactElement {
continuously hack the n00dles server. continuously hack the n00dles server.
<br /> <br />
<br /> <br />
If you're an intermediate programmer you should use ns2 instead. It is much faster and offers more
possibilities.
<br />
<br />
To save and close the script editor, press the button in the bottom left, or press ctrl + b. To save and close the script editor, press the button in the bottom left, or press ctrl + b.
</Typography> </Typography>
</> </>
@ -447,7 +449,11 @@ export function InteractiveTutorialRoot(): React.ReactElement {
<br /> <br />
<br /> <br />
If you know even a little bit of programming it is highly recommended you use NS2 instead. You will enjoy If you know even a little bit of programming it is highly recommended you use NS2 instead. You will enjoy
the game much more. the game much more. NS1 files end with .script and are a subset of javascript. NS2 files end with .js and
are full speed native javascript.
<br />
<br />
You can learn more about the difference between them later in the documentation.
<br /> <br />
<br /> <br />
For now, let's move on to something else! For now, let's move on to something else!