mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 07:33:12 +09:00
Added fancy settings menu
This commit is contained in:
1 parent
fedf9f6df1
commit
e801be3c77
6 files changed
+149
-3
No files matched your search
@@ -1,3 +1,23 @@
|
||||
|
||||
(function (){
|
||||
ensureSetting("Display offline slaves", "boolean", false);
|
||||
}())
|
||||
|
||||
function ensureSetting(setting, type, defaultSetting) {
|
||||
let settings
|
||||
try {
|
||||
settings = JSON.parse(localStorage.settings);
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
if(!settings) settings = {};
|
||||
if(typeof settings[setting] != type) {
|
||||
settings[setting] = defaultSetting;
|
||||
console.log("Fixed setting: " + setting + " | " + defaultSetting)
|
||||
}
|
||||
localStorage.settings = JSON.stringify(settings)
|
||||
}
|
||||
|
||||
var g = {}
|
||||
contents = {
|
||||
"iron-plate":100,
|
||||
|
||||
Reference in new issue
Block a user