diff --git a/changelog.md b/changelog.md index 4f0d84d..f107419 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ # The Modding Tree changelog: +- Respec confirmation settings are now kept on resets. + # v2.5.2.1 - 5/7/21 - Fixed microtabs making layers highlight incorrectly. diff --git a/js/components.js b/js/components.js index d597d68..bd27909 100644 --- a/js/components.js +++ b/js/components.js @@ -377,15 +377,15 @@ function loadVue() { Vue.component('bar', { props: ['layer', 'data'], computed: { - style() {return constructBarStyle(layer, data)} + style() {return constructBarStyle(this.layer, this.data)} }, template: ` -
-
+
+
-
-
+
+
` @@ -513,6 +513,7 @@ function loadVue() { subtabResetNotify, challengeStyle, challengeButtonText, + constructBarStyle, VERSION, LAYERS, hotkeys, diff --git a/js/game.js b/js/game.js index a8a3cfa..96b0a29 100644 --- a/js/game.js +++ b/js/game.js @@ -138,7 +138,7 @@ function rowReset(row, layer) { } function layerDataReset(layer, keep = []) { - let storedData = {unlocked: player[layer].unlocked, forceTooltip: player[layer].forceTooltip} // Always keep these + let storedData = {unlocked: player[layer].unlocked, forceTooltip: player[layer].forceTooltip, noRespecConfirm: player[layer].noRespecConfirm} // Always keep these for (thing in keep) { if (player[layer][keep[thing]] !== undefined) diff --git a/js/technical/temp.js b/js/technical/temp.js index df0eae0..a65e4aa 100644 --- a/js/technical/temp.js +++ b/js/technical/temp.js @@ -102,7 +102,6 @@ function updateTemp() { tmp[layer].trueGlowColor = tmp[layer].glowColor tmp[layer].notify = shouldNotify(layer) tmp[layer].prestigeNotify = prestigeNotify(layer) - constructBarStyles(layer) } tmp.pointGen = getPointGen() @@ -158,39 +157,34 @@ function updateClickableTemp(layer) } -function constructBarStyles(layer){ - if (layers[layer].bars === undefined) - return - for (id in layers[layer].bars){ - if (id !== "layer") { - let bar = tmp[layer].bars[id] - if (bar.progress instanceof Decimal) - bar.progress = bar.progress.toNumber() - bar.progress = (1 -Math.min(Math.max(bar.progress, 0), 1)) * 100 - bar.dims = {'width': bar.width + "px", 'height': bar.height + "px"} - let dir = bar.direction - bar.fillDims = {'width': (bar.width + 0.5) + "px", 'height': (bar.height + 0.5) + "px"} - if (dir !== undefined) - { - bar.fillDims['clip-path'] = 'inset(0% 50% 0% 0%)' - if(dir == UP){ - bar.fillDims['clip-path'] = 'inset(' + bar.progress + '% 0% 0% 0%)' - } - else if(dir == DOWN){ - bar.fillDims['clip-path'] = 'inset(0% 0% ' + bar.progress + '% 0%)' - } - else if(dir == RIGHT){ - bar.fillDims['clip-path'] = 'inset(0% ' + bar.progress + '% 0% 0%)' - } - else if(dir == LEFT){ - bar.fillDims['clip-path'] = 'inset(0% 0% 0% ' + bar.progress + '%)' - } +function constructBarStyle(layer, id) { + let bar = tmp[layer].bars[id] + let style = {} + if (bar.progress instanceof Decimal) + bar.progress = bar.progress.toNumber() + bar.progress = (1 -Math.min(Math.max(bar.progress, 0), 1)) * 100 - } + style.dims = {'width': bar.width + "px", 'height': bar.height + "px"} + let dir = bar.direction + style.fillDims = {'width': (bar.width + 0.5) + "px", 'height': (bar.height + 0.5) + "px"} + if (dir !== undefined) + { + style.fillDims['clip-path'] = 'inset(0% 50% 0% 0%)' + if(dir == UP){ + style.fillDims['clip-path'] = 'inset(' + bar.progress + '% 0% 0% 0%)' + } + else if(dir == DOWN){ + style.fillDims['clip-path'] = 'inset(0% 0% ' + bar.progress + '% 0%)' + } + else if(dir == RIGHT){ + style.fillDims['clip-path'] = 'inset(0% ' + bar.progress + '% 0% 0%)' + } + else if(dir == LEFT){ + style.fillDims['clip-path'] = 'inset(0% 0% 0% ' + bar.progress + '%)' } - } + return style } function setupBarStyles(layer){