2021-01-06 20:56:06 +00:00
|
|
|
// ************ Options ************
|
2021-06-03 05:04:56 +00:00
|
|
|
|
|
|
|
let options = {}
|
|
|
|
|
|
|
|
function getStartOptions() {
|
|
|
|
return {
|
|
|
|
autosave: true,
|
|
|
|
msDisplay: "always",
|
2021-06-07 03:45:32 +00:00
|
|
|
theme: "default",
|
2021-06-03 05:04:56 +00:00
|
|
|
hqTree: false,
|
|
|
|
offlineProd: true,
|
|
|
|
hideChallenges: false,
|
|
|
|
showStory: true,
|
|
|
|
forceOneTab: false,
|
|
|
|
oldStyle: false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-06 20:56:06 +00:00
|
|
|
function toggleOpt(name) {
|
|
|
|
if (name == "oldStyle" && styleCooldown > 0)
|
|
|
|
return;
|
|
|
|
|
2021-06-03 05:04:56 +00:00
|
|
|
options[name] = !options[name];
|
2021-01-06 20:56:06 +00:00
|
|
|
if (name == "hqTree")
|
|
|
|
changeTreeQuality();
|
|
|
|
if (name == "oldStyle")
|
|
|
|
updateStyle();
|
|
|
|
}
|
|
|
|
var styleCooldown = 0;
|
|
|
|
function updateStyle() {
|
|
|
|
styleCooldown = 1;
|
|
|
|
let css = document.getElementById("styleStuff");
|
2021-06-03 05:04:56 +00:00
|
|
|
css.href = options.oldStyle ? "oldStyle.css" : "style.css";
|
2021-01-06 20:56:06 +00:00
|
|
|
needCanvasUpdate = true;
|
|
|
|
}
|
|
|
|
function changeTreeQuality() {
|
2021-06-03 05:04:56 +00:00
|
|
|
var on = options.hqTree;
|
2021-01-06 20:56:06 +00:00
|
|
|
document.body.style.setProperty('--hqProperty1', on ? "2px solid" : "4px solid");
|
|
|
|
document.body.style.setProperty('--hqProperty2a', on ? "-4px -4px 4px rgba(0, 0, 0, 0.25) inset" : "-4px -4px 4px rgba(0, 0, 0, 0) inset");
|
|
|
|
document.body.style.setProperty('--hqProperty2b', on ? "0px 0px 20px var(--background)" : "");
|
|
|
|
document.body.style.setProperty('--hqProperty3', on ? "2px 2px 4px rgba(0, 0, 0, 0.25)" : "none");
|
|
|
|
}
|
|
|
|
function toggleAuto(toggle) {
|
2021-06-06 19:04:16 +00:00
|
|
|
Vue.set(player[toggle[0]], [toggle[1]], !player[toggle[0]][toggle[1]]);
|
2021-06-02 22:51:33 +00:00
|
|
|
needCanvasUpdate=true
|
2021-01-06 20:56:06 +00:00
|
|
|
}
|
2021-05-06 20:26:44 +00:00
|
|
|
|
|
|
|
const MS_DISPLAYS = ["ALL", "LAST, AUTO, INCOMPLETE", "AUTOMATION, INCOMPLETE", "INCOMPLETE", "NONE"];
|
|
|
|
|
|
|
|
const MS_SETTINGS = ["always", "last", "automation", "incomplete", "never"];
|
|
|
|
|
2021-01-06 20:56:06 +00:00
|
|
|
function adjustMSDisp() {
|
2021-06-03 05:04:56 +00:00
|
|
|
options.msDisplay = MS_SETTINGS[(MS_SETTINGS.indexOf(options.msDisplay) + 1) % 5];
|
2021-01-06 20:56:06 +00:00
|
|
|
}
|
|
|
|
function milestoneShown(layer, id) {
|
|
|
|
complete = player[layer].milestones.includes(id);
|
|
|
|
auto = layers[layer].milestones[id].toggles;
|
|
|
|
|
2021-06-03 05:04:56 +00:00
|
|
|
switch (options.msDisplay) {
|
2021-01-06 20:56:06 +00:00
|
|
|
case "always":
|
|
|
|
return true;
|
|
|
|
break;
|
2021-05-06 20:26:44 +00:00
|
|
|
case "last":
|
|
|
|
return (auto) || !complete || player[layer].lastMilestone === id;
|
|
|
|
break;
|
2021-01-06 20:56:06 +00:00
|
|
|
case "automation":
|
|
|
|
return (auto) || !complete;
|
|
|
|
break;
|
|
|
|
case "incomplete":
|
|
|
|
return !complete;
|
|
|
|
break;
|
|
|
|
case "never":
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|