mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 02:32:55 +02:00
All 0.28.0 Changes - Bitnodes 4 and 11 and webpack migration
This commit is contained in:
+43
-11
@@ -1,5 +1,5 @@
|
||||
/* Settings.js */
|
||||
Settings = {
|
||||
let Settings = {
|
||||
CodeInstructionRunTime: 100,
|
||||
MaxLogCapacity: 50,
|
||||
MaxPortCapacity: 50,
|
||||
@@ -7,6 +7,10 @@ Settings = {
|
||||
SuppressFactionInvites: false,
|
||||
}
|
||||
|
||||
function loadSettings(saveString) {
|
||||
Settings = JSON.parse(saveString);
|
||||
}
|
||||
|
||||
function initSettings() {
|
||||
Settings.CodeInstructionRunTime = 100;
|
||||
Settings.MaxLogCapacity = 50;
|
||||
@@ -16,14 +20,42 @@ function initSettings() {
|
||||
}
|
||||
|
||||
function setSettingsLabels() {
|
||||
document.getElementById("settingsNSExecTimeRangeValLabel").innerHTML
|
||||
= Settings.CodeInstructionRunTime + "ms";
|
||||
document.getElementById("settingsNSLogRangeValLabel").innerHTML
|
||||
= Settings.MaxLogCapacity;
|
||||
document.getElementById("settingsNSPortRangeValLabel").innerHTML
|
||||
= Settings.MaxPortCapacity;
|
||||
document.getElementById("settingsSuppressMessages").checked
|
||||
= Settings.SuppressMessages;
|
||||
document.getElementById("settingsSuppressFactionInvites").checked
|
||||
= Settings.SuppressFactionInvites;
|
||||
var nsExecTime = document.getElementById("settingsNSExecTimeRangeValLabel");
|
||||
var nsLogLimit = document.getElementById("settingsNSLogRangeValLabel");
|
||||
var nsPortLimit = document.getElementById("settingsNSPortRangeValLabel");
|
||||
var suppressMsgs = document.getElementById("settingsSuppressMessages");
|
||||
var suppressFactionInv = document.getElementById("settingsSuppressFactionInvites")
|
||||
|
||||
//Initialize values on labels
|
||||
nsExecTime.innerHTML = Settings.CodeInstructionRunTime + "ms";
|
||||
nsLogLimit.innerHTML = Settings.MaxLogCapacity;
|
||||
nsPortLimit.innerHTML = Settings.MaxPortCapacity;
|
||||
suppressMsgs.checked = Settings.SuppressMessages;
|
||||
suppressFactionInv.checked = Settings.SuppressFactionInvites;
|
||||
|
||||
//Set handlers for when input changes
|
||||
document.getElementById("settingsNSExecTimeRangeVal").oninput = function() {
|
||||
nsExecTime.innerHTML = this.value + 'ms';
|
||||
Settings.CodeInstructionRunTime = this.value;
|
||||
};
|
||||
|
||||
document.getElementById("settingsNSLogRangeVal").oninput = function() {
|
||||
nsLogLimit.innerHTML = this.value;
|
||||
Settings.MaxLogCapacity = this.value;
|
||||
};
|
||||
|
||||
document.getElementById("settingsNSPortRangeVal").oninput = function() {
|
||||
nsPortLimit.innerHTML = this.value;
|
||||
Settings.MaxPortCapacity = this.value;
|
||||
};
|
||||
|
||||
document.getElementById("settingsSuppressMessages").onclick = function() {
|
||||
Settings.SuppressMessages = this.checked;
|
||||
};
|
||||
|
||||
document.getElementById("settingsSuppressFactionInvites").onclick = function() {
|
||||
Settings.SuppressFactionInvites = this.checked;
|
||||
};
|
||||
}
|
||||
|
||||
export {Settings, initSettings, setSettingsLabels, loadSettings};
|
||||
|
||||
Reference in New Issue
Block a user