mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 14:59:16 +02:00
Framework for custom theme
This commit is contained in:
@@ -5,6 +5,7 @@ import { defaultStyles } from "../Themes/Styles";
|
||||
import { WordWrapOptions } from "../ScriptEditor/ui/Options";
|
||||
import { OverviewSettings } from "../ui/React/Overview";
|
||||
import { IStyleSettings } from "../ScriptEditor/NetscriptDefinitions";
|
||||
import { defaultMonacoTheme, IScriptEditorTheme } from "../ScriptEditor/ui/themes";
|
||||
|
||||
/**
|
||||
* Represents the default settings the player could customize.
|
||||
@@ -157,6 +158,11 @@ interface IDefaultSettings {
|
||||
* If the game's sidebar is opened
|
||||
*/
|
||||
IsSidebarOpened: boolean;
|
||||
|
||||
/**
|
||||
* Script editor theme data
|
||||
*/
|
||||
EditorTheme: IScriptEditorTheme;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -216,6 +222,8 @@ export const defaultSettings: IDefaultSettings = {
|
||||
theme: defaultTheme,
|
||||
styles: defaultStyles,
|
||||
overview: { x: 0, y: 0, opened: true },
|
||||
|
||||
EditorTheme: defaultMonacoTheme,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -258,10 +266,11 @@ export const Settings: ISettings & ISelfInitializer & ISelfLoading = {
|
||||
MonacoFontSize: 20,
|
||||
MonacoVim: false,
|
||||
MonacoWordWrap: "off",
|
||||
|
||||
|
||||
theme: { ...defaultTheme },
|
||||
styles: { ...defaultStyles },
|
||||
overview: defaultSettings.overview,
|
||||
EditorTheme: { ...defaultMonacoTheme },
|
||||
init() {
|
||||
Object.assign(Settings, defaultSettings);
|
||||
},
|
||||
@@ -273,6 +282,8 @@ export const Settings: ISettings & ISelfInitializer & ISelfLoading = {
|
||||
delete save.styles;
|
||||
Object.assign(Settings.overview, save.overview);
|
||||
delete save.overview;
|
||||
Object.assign(Settings.EditorTheme, save.EditorTheme);
|
||||
delete save.EditorTheme;
|
||||
Object.assign(Settings, save);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user