Просмотр исходного кода

Add more options for ground elevation and change their offsets

master
Fen Dweller 4 лет назад
Родитель
Сommit
6d96b4ed32
1 измененных файлов: 20 добавлений и 8 удалений
  1. +20
    -8
      macrovision.js

+ 20
- 8
macrovision.js Просмотреть файл

@@ -617,12 +617,16 @@ function updateSizes(dirtyOnly = false) {
updateRatios();

if (config.lockYAxis) {
if (config.groundPos === "high") {
config.y = -config.height.toNumber("meters") / 2;
if (config.groundPos === "very-high") {
config.y = -config.height.toNumber("meters") / 12 * 5;
} else if (config.groundPos === "high") {
config.y = -config.height.toNumber("meters") / 12 * 4;
} else if (config.groundPos === "medium") {
config.y = -config.height.toNumber("meters") / 4;
config.y = -config.height.toNumber("meters") / 12 * 3;
} else if (config.groundPos === "low") {
config.y = -config.height.toNumber("meters") / 6;
config.y = -config.height.toNumber("meters") / 12 * 2;
} else if (config.groundPos === "very-low") {
config.y = -config.height.toNumber("meters") / 12;
} else {
config.y = 0;
}
@@ -2405,9 +2409,11 @@ const settingsData = {
type: "select",
default: "bottom",
options: [
"very-high",
"high",
"medium",
"low",
"very-low",
"bottom",
],
get value() {
@@ -3922,14 +3928,20 @@ function prepareEntities() {
let yOffset = 0;

if (config.lockYAxis) {
if (config.groundPos === "high") {
yOffset = config.height.toNumber("meters")/2;
if (config.groundPos === "very-high") {
yOffset = config.height.toNumber("meters") / 12 * 5;
}
else if (config.groundPos === "high") {
yOffset = config.height.toNumber("meters") / 12 * 4;
}
else if (config.groundPos === "medium") {
yOffset = config.height.toNumber("meters")/4;
yOffset = config.height.toNumber("meters") / 12 * 3;
}
else if (config.groundPos === "low") {
yOffset = config.height.toNumber("meters")/6;
yOffset = config.height.toNumber("meters") / 12 * 2;
}
else if (config.groundPos === "very-low") {
yOffset = config.height.toNumber("meters") / 12 * 1;
}
else if (config.groundPos === "bottom") {
yOffset = 0;


Загрузка…
Отмена
Сохранить