From 6d96b4ed329d13f1cc83fc45bf5a6c4ce4ef4d36 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Wed, 8 Sep 2021 19:07:06 -0400 Subject: [PATCH] Add more options for ground elevation and change their offsets --- macrovision.js | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/macrovision.js b/macrovision.js index fd4e5dcf..825fdcac 100644 --- a/macrovision.js +++ b/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;