From 919f30906efb28bdf31032e3c4fc5bb436acc588 Mon Sep 17 00:00:00 2001 From: Harley White Date: Tue, 20 Apr 2021 10:44:40 -0400 Subject: [PATCH] Fixed pre-unlock highlighting and day length --- changelog.md | 2 ++ js/technical/systemComponents.js | 2 +- js/utils/NumberFormating.js | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 911159c..0b665d2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ # The Modding Tree changelog: +- The red layer highlight will not appear before a layer is unlocked. + # v2.π.1 - 4/7/21 - Fixed formatting for some larger numbers. - Upgrades will expand if there is too much text to display. diff --git a/js/technical/systemComponents.js b/js/technical/systemComponents.js index 4579ab1..eca6285 100644 --- a/js/technical/systemComponents.js +++ b/js/technical/systemComponents.js @@ -38,7 +38,7 @@ var systemComponents = { ghost: tmp[layer].layerShown == 'ghost', hidden: !tmp[layer].layerShown, locked: tmp[layer].isLayer ? !(player[layer].unlocked || tmp[layer].canReset) : !(tmp[layer].canClick), - notify: tmp[layer].notify, + notify: tmp[layer].notify && player[layer].unlocked, resetNotify: tmp[layer].prestigeNotify, can: ((player[layer].unlocked || tmp[layer].isLayer) && tmp[layer].isLayer) || (!tmp[layer].isLayer && tmp[layer].canClick), }" diff --git a/js/utils/NumberFormating.js b/js/utils/NumberFormating.js index 0bd5265..bf33a88 100644 --- a/js/utils/NumberFormating.js +++ b/js/utils/NumberFormating.js @@ -65,8 +65,8 @@ function formatWhole(decimal) { function formatTime(s) { if (s < 60) return format(s) + "s" else if (s < 3600) return formatWhole(Math.floor(s / 60)) + "m " + format(s % 60) + "s" - else if (s < 84600) return formatWhole(Math.floor(s / 3600)) + "h " + formatWhole(Math.floor(s / 60) % 60) + "m " + format(s % 60) + "s" - else if (s < 31536000) return formatWhole(Math.floor(s / 84600) % 365) + "d " + formatWhole(Math.floor(s / 3600) % 24) + "h " + formatWhole(Math.floor(s / 60) % 60) + "m " + format(s % 60) + "s" + else if (s < 86400) return formatWhole(Math.floor(s / 3600)) + "h " + formatWhole(Math.floor(s / 60) % 60) + "m " + format(s % 60) + "s" + else if (s < 31536000) return formatWhole(Math.floor(s / 86400) % 365) + "d " + formatWhole(Math.floor(s / 3600) % 24) + "h " + formatWhole(Math.floor(s / 60) % 60) + "m " + format(s % 60) + "s" else return formatWhole(Math.floor(s / 31536000)) + "y " + formatWhole(Math.floor(s / 84600) % 365) + "d " + formatWhole(Math.floor(s / 3600) % 24) + "h " + formatWhole(Math.floor(s / 60) % 60) + "m " + format(s % 60) + "s" }