mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-22 09:13:07 +02:00
UI: Search and read NS API docs in editor tab and documentation tab (#2163)
This commit is contained in:
@@ -186,7 +186,7 @@ function Root(props: IProps): React.ReactElement {
|
||||
return;
|
||||
}
|
||||
// this is duplicate code with saving later.
|
||||
if (ITutorial.isRunning && ITutorial.currStep === iTutorialSteps.TerminalTypeScript) {
|
||||
if (ITutorial.isRunning && ITutorial.currStep === iTutorialSteps.TerminalEditScript) {
|
||||
//Make sure filename + code properly follow tutorial
|
||||
if (currentScript.path !== "n00dles.js") {
|
||||
dialogBoxCreate("Don't change the script name for now.");
|
||||
|
||||
@@ -23,6 +23,9 @@ import { OptionsModal, OptionsModalProps } from "./OptionsModal";
|
||||
import { useScriptEditorContext } from "./ScriptEditorContext";
|
||||
import { NsApiDocumentationLink } from "../../ui/React/NsApiDocumentationLink";
|
||||
import { CurrentKeyBindings, parseKeyCombinationsToString, ScriptEditorAction } from "../../utils/KeyBindingUtils";
|
||||
import { DocumentationAutocomplete } from "../../Documentation/ui/DocumentationAutocomplete";
|
||||
import { openDocumentationPopUp } from "../../Documentation/root";
|
||||
import { openDocExternally } from "../../ui/React/Documentation";
|
||||
|
||||
type IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor;
|
||||
|
||||
@@ -82,6 +85,16 @@ export function Toolbar({ editor, onSave, onRun }: IProps) {
|
||||
Run
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<DocumentationAutocomplete
|
||||
sx={{ marginRight: "10px" }}
|
||||
onChange={(path, external) => {
|
||||
if (external) {
|
||||
openDocExternally(path);
|
||||
return;
|
||||
}
|
||||
openDocumentationPopUp(path);
|
||||
}}
|
||||
/>
|
||||
<Typography>
|
||||
<NsApiDocumentationLink />
|
||||
</Typography>
|
||||
|
||||
Reference in New Issue
Block a user