|
|
|
@@ -2617,6 +2617,15 @@ const settingsCategories = { |
|
|
|
"visuals": "Visuals" |
|
|
|
} |
|
|
|
|
|
|
|
const groundPosChoices = [ |
|
|
|
"very-high", |
|
|
|
"high", |
|
|
|
"medium", |
|
|
|
"low", |
|
|
|
"very-low", |
|
|
|
"bottom", |
|
|
|
]; |
|
|
|
|
|
|
|
const settingsData = { |
|
|
|
"show-vertical-scale": { |
|
|
|
name: "Vertical Scale", |
|
|
|
@@ -2682,14 +2691,9 @@ const settingsData = { |
|
|
|
}, |
|
|
|
set value(param) { |
|
|
|
config.lockYAxis = param; |
|
|
|
updateScrollButtons(); |
|
|
|
if (param) { |
|
|
|
config.y = 0; |
|
|
|
updateSizes(); |
|
|
|
document.querySelector("#scroll-up").disabled = true; |
|
|
|
document.querySelector("#scroll-down").disabled = true; |
|
|
|
} else { |
|
|
|
document.querySelector("#scroll-up").disabled = false; |
|
|
|
document.querySelector("#scroll-down").disabled = false; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
@@ -2756,19 +2760,13 @@ const settingsData = { |
|
|
|
desc: "How high the ground is if the y-axis is locked", |
|
|
|
type: "select", |
|
|
|
default: "bottom", |
|
|
|
options: [ |
|
|
|
"very-high", |
|
|
|
"high", |
|
|
|
"medium", |
|
|
|
"low", |
|
|
|
"very-low", |
|
|
|
"bottom", |
|
|
|
], |
|
|
|
options: groundPosChoices, |
|
|
|
get value() { |
|
|
|
return config.groundPos; |
|
|
|
}, |
|
|
|
set value(param) { |
|
|
|
config.groundPos = param; |
|
|
|
updateScrollButtons(); |
|
|
|
updateSizes(); |
|
|
|
} |
|
|
|
}, |
|
|
|
@@ -3090,7 +3088,7 @@ function prepareSettings(userSettings) { |
|
|
|
entry.value = input.checked; |
|
|
|
} |
|
|
|
|
|
|
|
update(); |
|
|
|
setTimeout(update); |
|
|
|
|
|
|
|
input.addEventListener("change", update); |
|
|
|
} else if (entry.type == "select") { |
|
|
|
@@ -3763,31 +3761,47 @@ document.addEventListener("DOMContentLoaded", () => { |
|
|
|
|
|
|
|
|
|
|
|
document.querySelector("#scroll-up").addEventListener("mousedown", e => { |
|
|
|
scrollDirection = 1; |
|
|
|
clearInterval(scrollHandle); |
|
|
|
scrollHandle = setInterval(doYScroll, 1000 / 20); |
|
|
|
e.stopPropagation(); |
|
|
|
if (config.lockYAxis) { |
|
|
|
moveGround(true); |
|
|
|
} else { |
|
|
|
scrollDirection = 1; |
|
|
|
clearInterval(scrollHandle); |
|
|
|
scrollHandle = setInterval(doYScroll, 1000 / 20); |
|
|
|
e.stopPropagation(); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
document.querySelector("#scroll-down").addEventListener("mousedown", e => { |
|
|
|
scrollDirection = -1; |
|
|
|
clearInterval(scrollHandle); |
|
|
|
scrollHandle = setInterval(doYScroll, 1000 / 20); |
|
|
|
e.stopPropagation(); |
|
|
|
if (config.lockYAxis) { |
|
|
|
moveGround(false); |
|
|
|
} else { |
|
|
|
scrollDirection = -1; |
|
|
|
clearInterval(scrollHandle); |
|
|
|
scrollHandle = setInterval(doYScroll, 1000 / 20); |
|
|
|
e.stopPropagation(); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
document.querySelector("#scroll-up").addEventListener("touchstart", e => { |
|
|
|
scrollDirection = 1; |
|
|
|
clearInterval(scrollHandle); |
|
|
|
scrollHandle = setInterval(doYScroll, 1000 / 20); |
|
|
|
e.stopPropagation(); |
|
|
|
if (config.lockYAxis) { |
|
|
|
moveGround(true); |
|
|
|
} else { |
|
|
|
scrollDirection = 1; |
|
|
|
clearInterval(scrollHandle); |
|
|
|
scrollHandle = setInterval(doYScroll, 1000 / 20); |
|
|
|
e.stopPropagation(); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
document.querySelector("#scroll-down").addEventListener("touchstart", e => { |
|
|
|
scrollDirection = -1; |
|
|
|
clearInterval(scrollHandle); |
|
|
|
scrollHandle = setInterval(doYScroll, 1000 / 20); |
|
|
|
e.stopPropagation(); |
|
|
|
if (config.lockYAxis) { |
|
|
|
moveGround(false); |
|
|
|
} else { |
|
|
|
scrollDirection = -1; |
|
|
|
clearInterval(scrollHandle); |
|
|
|
scrollHandle = setInterval(doYScroll, 1000 / 20); |
|
|
|
e.stopPropagation(); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
document.addEventListener("mouseup", e => { |
|
|
|
@@ -5316,4 +5330,42 @@ function getVerticalOffset() { |
|
|
|
} else { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function moveGround(down) { |
|
|
|
const index = groundPosChoices.indexOf(config.groundPos); |
|
|
|
|
|
|
|
if (down) { |
|
|
|
if (index < groundPosChoices.length - 1) { |
|
|
|
config.groundPos = groundPosChoices[index + 1] |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (index > 0) { |
|
|
|
config.groundPos = groundPosChoices[index - 1] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
updateScrollButtons(); |
|
|
|
updateSizes(); |
|
|
|
} |
|
|
|
|
|
|
|
function updateScrollButtons() { |
|
|
|
const up = document.querySelector("#scroll-up") |
|
|
|
const down = document.querySelector("#scroll-down") |
|
|
|
|
|
|
|
up.disabled = false; |
|
|
|
down.disabled = false; |
|
|
|
|
|
|
|
document.querySelector("#setting-ground-pos").value = config.groundPos; |
|
|
|
|
|
|
|
if (config.lockYAxis) { |
|
|
|
const index = groundPosChoices.indexOf(config.groundPos); |
|
|
|
|
|
|
|
if (index == 0) { |
|
|
|
down.disabled = true; |
|
|
|
} |
|
|
|
if (index == groundPosChoices.length - 1) { |
|
|
|
up.disabled = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |