mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 06:18:42 +02:00
UI: Add option to disable minimap in script editor (#2504)
This commit is contained in:
@@ -5,6 +5,7 @@ export type WordWrapOptions = "on" | "off" | "bounded" | "wordWrapColumn";
|
||||
export type CursorStyle = editor.IEditorOptions["cursorStyle"];
|
||||
export type CursorBlinking = editor.IEditorOptions["cursorBlinking"];
|
||||
export type StickyScroll = editor.IEditorOptions["stickyScroll"];
|
||||
export type Minimap = editor.IEditorOptions["minimap"];
|
||||
|
||||
export interface Options {
|
||||
theme: string;
|
||||
@@ -19,4 +20,5 @@ export interface Options {
|
||||
cursorBlinking: CursorBlinking;
|
||||
beautifyOnSave: boolean;
|
||||
stickyScroll: StickyScroll;
|
||||
minimap: Minimap;
|
||||
}
|
||||
|
||||
@@ -158,6 +158,14 @@ export function OptionsModal(props: OptionsModalProps): ReactElement {
|
||||
checked={props.options.stickyScroll?.enabled}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div style={{ display: "flex", alignItems: "center" }}>
|
||||
<Typography marginRight={"auto"}>Enable Minimap: </Typography>
|
||||
<Switch
|
||||
onChange={(e) => props.onOptionChange("minimap", { enabled: e.target.checked })}
|
||||
checked={props.options.minimap?.enabled}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ export function ScriptEditorContextProvider({ children }: { children: React.Reac
|
||||
cursorBlinking: Settings.MonacoCursorBlinking,
|
||||
beautifyOnSave: Settings.MonacoBeautifyOnSave,
|
||||
stickyScroll: Settings.MonacoStickyScroll,
|
||||
minimap: Settings.MonacoMinimap,
|
||||
});
|
||||
|
||||
function saveOptions(options: Options) {
|
||||
@@ -109,6 +110,7 @@ export function ScriptEditorContextProvider({ children }: { children: React.Reac
|
||||
Settings.MonacoWordWrap = options.wordWrap;
|
||||
Settings.MonacoBeautifyOnSave = options.beautifyOnSave;
|
||||
Settings.MonacoStickyScroll = options.stickyScroll;
|
||||
Settings.MonacoMinimap = options.minimap;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { OwnedAugmentationsOrderSetting, PurchaseAugmentationsOrderSetting } from "./SettingEnums";
|
||||
import { defaultTheme } from "../Themes/Themes";
|
||||
import { defaultStyles } from "../Themes/Styles";
|
||||
import { CursorStyle, CursorBlinking, WordWrapOptions, StickyScroll } from "../ScriptEditor/ui/Options";
|
||||
import type { CursorStyle, CursorBlinking, WordWrapOptions, StickyScroll, Minimap } from "../ScriptEditor/ui/Options";
|
||||
import { defaultMonacoTheme } from "../ScriptEditor/ui/themes";
|
||||
import { assertObject } from "../utils/TypeAssertion";
|
||||
import type { Result } from "@nsdefs";
|
||||
@@ -186,6 +186,8 @@ export const Settings = {
|
||||
MonacoCursorBlinking: "blink" as CursorBlinking,
|
||||
/** Toggle use of Sticky Scroll in the Script Editor */
|
||||
MonacoStickyScroll: { enabled: false } as StickyScroll,
|
||||
/** Whether to show minimap in the script editor */
|
||||
MonacoMinimap: { enabled: true } as Minimap,
|
||||
/** Whether to hide trailing zeroes on fractional part of decimal */
|
||||
hideTrailingDecimalZeros: false,
|
||||
/** Whether to hide thousands separators. */
|
||||
|
||||
Reference in New Issue
Block a user