mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 01:32:55 +02:00
v0.51.9
This commit is contained in:
@@ -233,19 +233,25 @@ class AceEditorWrapper extends ScriptEditor {
|
||||
|
||||
// Highlight Active line
|
||||
const highlightActiveChkBox = safeClearEventListeners("script-editor-option-highlightactiveline", "Active Line Checkbox");
|
||||
highlightActiveChkBox.checked = Settings.EditorHighlightActiveLine;
|
||||
highlightActiveChkBox.onchange = () => {
|
||||
Settings.EditorHighlightActiveLine = highlightActiveChkBox.checked;
|
||||
this.editor.setHighlightActiveLine(highlightActiveChkBox.checked);
|
||||
};
|
||||
|
||||
// Show Invisibles
|
||||
const showInvisiblesChkBox = safeClearEventListeners("script-editor-option-showinvisibles", "Show Invisible Checkbox");
|
||||
showInvisiblesChkBox.checked = Settings.EditorShowInvisibles;
|
||||
showInvisiblesChkBox.onchange = () => {
|
||||
Settings.EditorShowInvisibles = showInvisiblesChkBox.checked;
|
||||
this.editor.setShowInvisibles(showInvisiblesChkBox.checked);
|
||||
};
|
||||
|
||||
// Use Soft Tab
|
||||
const softTabChkBox = safeClearEventListeners("script-editor-option-usesofttab", "Soft Tab Checkbox");
|
||||
softTabChkBox.checked = Settings.EditorUseSoftTab;
|
||||
softTabChkBox.onchange = () => {
|
||||
Settings.EditorUseSoftTab = softTabChkBox.checked;
|
||||
this.editor.getSession().setUseSoftTabs(softTabChkBox.checked);
|
||||
};
|
||||
|
||||
|
||||
@@ -375,14 +375,18 @@ class CodeMirrorEditorWrapper extends ScriptEditor {
|
||||
|
||||
// Highlight Active line
|
||||
const highlightActiveChkBox = safeClearEventListeners("script-editor-option-highlightactiveline", "Active Line Checkbox");
|
||||
highlightActiveChkBox.checked = Settings.EditorHighlightActiveLine;
|
||||
highlightActiveChkBox.onchange = () => {
|
||||
Settings.EditorHighlightActiveLine = highlightActiveChkBox.checked;
|
||||
this.editor.setOption("styleActiveLine", highlightActiveChkBox.checked);
|
||||
};
|
||||
highlightActiveChkBox.onchange();
|
||||
|
||||
// Show Invisibles
|
||||
const showInvisiblesChkBox = safeClearEventListeners("script-editor-option-showinvisibles", "Show Invisible Checkbox");
|
||||
showInvisiblesChkBox.checked = Settings.EditorShowInvisibles;
|
||||
showInvisiblesChkBox.onchange = () => {
|
||||
Settings.EditorShowInvisibles = showInvisiblesChkBox.checked;
|
||||
const overlayMode = {
|
||||
name: 'invisibles',
|
||||
token: function(stream) {
|
||||
@@ -428,7 +432,9 @@ class CodeMirrorEditorWrapper extends ScriptEditor {
|
||||
|
||||
//Use Soft Tab
|
||||
const softTabChkBox = safeClearEventListeners("script-editor-option-usesofttab", "Soft Tab Checkbox");
|
||||
softTabChkBox.checked = Settings.EditorUseSoftTab;
|
||||
softTabChkBox.onchange = () => {
|
||||
Settings.EditorUseSoftTab = softTabChkBox.checked;
|
||||
this.editor.setOption("indentWithTabs", !softTabChkBox.checked);
|
||||
if (softTabChkBox.checked) {
|
||||
this.editor.addKeyMap({
|
||||
@@ -482,13 +488,14 @@ class CodeMirrorEditorWrapper extends ScriptEditor {
|
||||
}));
|
||||
|
||||
const flex1Checkbox = createElement("input", {
|
||||
checked: true,
|
||||
checked: Settings.EditorAutoCloseBrackets,
|
||||
id: flex1Id,
|
||||
name: flex1Id,
|
||||
type: "checkbox",
|
||||
});
|
||||
flex1Fieldset.appendChild(flex1Checkbox);
|
||||
flex1Checkbox.onchange = () => {
|
||||
Settings.EditorAutoCloseBrackets = flex1Checkbox.checked;
|
||||
this.editor.setOption("autoCloseBrackets", flex1Checkbox.checked);
|
||||
};
|
||||
flex1Checkbox.onchange();
|
||||
@@ -502,7 +509,7 @@ class CodeMirrorEditorWrapper extends ScriptEditor {
|
||||
}));
|
||||
|
||||
const flex2Checkbox = createElement("input", {
|
||||
checked: true,
|
||||
checked: Settings.EditorEnableLinting,
|
||||
id: flex2Id,
|
||||
name: flex2Id,
|
||||
type: "checkbox",
|
||||
@@ -510,8 +517,10 @@ class CodeMirrorEditorWrapper extends ScriptEditor {
|
||||
flex2Fieldset.appendChild(flex2Checkbox);
|
||||
flex2Checkbox.onchange = () => {
|
||||
if (flex2Checkbox.checked) {
|
||||
Settings.EditorEnableLinting = true;
|
||||
this.editor.setOption("lint", CodeMirror.lint.netscript);
|
||||
} else {
|
||||
Settings.EditorEnableLinting = false;
|
||||
this.editor.setOption("lint", false);
|
||||
}
|
||||
}
|
||||
@@ -526,13 +535,14 @@ class CodeMirrorEditorWrapper extends ScriptEditor {
|
||||
}));
|
||||
|
||||
const flex3Checkbox = createElement("input", {
|
||||
checked: true,
|
||||
checked: Settings.EditorContinueComments,
|
||||
id: flex3Id,
|
||||
name: flex3Id,
|
||||
type: "checkbox",
|
||||
});
|
||||
flex3Fieldset.appendChild(flex3Checkbox);
|
||||
flex3Checkbox.onchange = () => {
|
||||
Settings.EditorContinueComments = flex3Checkbox.checked;
|
||||
this.editor.setOption("continueComments", flex3Checkbox.checked);
|
||||
}
|
||||
flex3Checkbox.onchange();
|
||||
|
||||
Reference in New Issue
Block a user