mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-22 17:23:00 +02:00
MISC: Improve tutorial, documentation and discoverability of NS API documentation (#1697)
This commit is contained in:
@@ -87,7 +87,7 @@ function Root(props: IProps): React.ReactElement {
|
||||
}
|
||||
const cleanCode = currentScript.code.replace(/\s/g, "");
|
||||
const ns1 = "while(true){hack('n00dles');}";
|
||||
const ns2 = `exportasyncfunctionmain(ns){while(true){awaitns.hack('n00dles');}}`;
|
||||
const ns2 = `/**@param{NS}ns*/exportasyncfunctionmain(ns){while(true){awaitns.hack("n00dles");}}`;
|
||||
if (!cleanCode.includes(ns1) && !cleanCode.includes(ns2)) {
|
||||
dialogBoxCreate("Please copy and paste the code from the tutorial!");
|
||||
return;
|
||||
|
||||
@@ -3,7 +3,6 @@ import * as monaco from "monaco-editor";
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import Button from "@mui/material/Button";
|
||||
import Link from "@mui/material/Link";
|
||||
import Table from "@mui/material/Table";
|
||||
import TableCell from "@mui/material/TableCell";
|
||||
import TableRow from "@mui/material/TableRow";
|
||||
@@ -22,7 +21,7 @@ import { useBoolean } from "../../ui/React/hooks";
|
||||
import { Settings } from "../../Settings/Settings";
|
||||
import { OptionsModal, OptionsModalProps } from "./OptionsModal";
|
||||
import { useScriptEditorContext } from "./ScriptEditorContext";
|
||||
import { getNsApiDocumentationUrl } from "../../utils/StringHelperFunctions";
|
||||
import { NsApiDocumentationLink } from "../../ui/React/NsApiDocumentationLink";
|
||||
|
||||
type IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor;
|
||||
|
||||
@@ -71,9 +70,7 @@ export function Toolbar({ editor, onSave }: IProps) {
|
||||
Terminal (Ctrl/Cmd + b)
|
||||
</Button>
|
||||
<Typography>
|
||||
<Link target="_blank" href={getNsApiDocumentationUrl()} fontSize="1.2rem">
|
||||
NS API documentation
|
||||
</Link>
|
||||
<NsApiDocumentationLink />
|
||||
</Typography>
|
||||
</Box>
|
||||
<OptionsModal
|
||||
|
||||
Reference in New Issue
Block a user