Merge pull request #2876 from nickofolas/feature/monaco-theme-editor

[Feature] Script Editor Theme Customization
This commit is contained in:
hydroflame
2022-04-13 01:12:15 -04:00
committed by GitHub
6 changed files with 526 additions and 5 deletions
+11
View File
@@ -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,
};
/**
@@ -262,6 +270,7 @@ export const Settings: ISettings & ISelfInitializer & ISelfLoading = {
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);
},
};