mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 23:08:36 +02:00
UI: Update toolbar of in-game editor (#2551)
This commit is contained in:
@@ -19,9 +19,10 @@ type DocumentationAutocompleteProps = {
|
|||||||
* "path" is always "nsDoc/filename.md"
|
* "path" is always "nsDoc/filename.md"
|
||||||
*/
|
*/
|
||||||
onChange: (path: string, external: boolean) => void;
|
onChange: (path: string, external: boolean) => void;
|
||||||
|
width?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export function DocumentationAutocomplete({ sx, onChange }: DocumentationAutocompleteProps) {
|
export function DocumentationAutocomplete({ sx, onChange, width }: DocumentationAutocompleteProps) {
|
||||||
return (
|
return (
|
||||||
<AutoCompleteSearchBox
|
<AutoCompleteSearchBox
|
||||||
sx={sx}
|
sx={sx}
|
||||||
@@ -45,6 +46,7 @@ export function DocumentationAutocomplete({ sx, onChange }: DocumentationAutocom
|
|||||||
onChange(`nsDoc/${path}`, external);
|
onChange(`nsDoc/${path}`, external);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
width={width}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,11 @@ export function Toolbar({ editor, onSave, onRun, onBeautify }: IProps) {
|
|||||||
>
|
>
|
||||||
Beautify
|
Beautify
|
||||||
</Button>
|
</Button>
|
||||||
<Button color={isUpdatingRAM ? "secondary" : "primary"} sx={{ mx: 1 }} onClick={openRAMInfo}>
|
<Button
|
||||||
|
color={isUpdatingRAM ? "secondary" : "primary"}
|
||||||
|
sx={{ mx: 1, whiteSpace: "nowrap" }}
|
||||||
|
onClick={openRAMInfo}
|
||||||
|
>
|
||||||
{ram}
|
{ram}
|
||||||
</Button>
|
</Button>
|
||||||
<Tooltip title={parseKeyCombinationsToString(CurrentKeyBindings[ScriptEditorAction.Save])}>
|
<Tooltip title={parseKeyCombinationsToString(CurrentKeyBindings[ScriptEditorAction.Save])}>
|
||||||
@@ -105,6 +109,7 @@ export function Toolbar({ editor, onSave, onRun, onBeautify }: IProps) {
|
|||||||
}
|
}
|
||||||
openDocumentationPopUp(path);
|
openDocumentationPopUp(path);
|
||||||
}}
|
}}
|
||||||
|
width={350}
|
||||||
/>
|
/>
|
||||||
<Typography>
|
<Typography>
|
||||||
<DocumentationLink
|
<DocumentationLink
|
||||||
|
|||||||
Reference in New Issue
Block a user