diff --git a/changelog.md b/changelog.md index 6afc4aa..387d83f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ # The Modding Tree changelog: +# v2.5.2 - 5/7/21 +- Added glowColor for subtabs. - Improved the display for extremely small numbers. - Fixed issues in the buyable docs. diff --git a/docs/subtabs-and-microtabs.md b/docs/subtabs-and-microtabs.md index 6b1fb34..7382396 100644 --- a/docs/subtabs-and-microtabs.md +++ b/docs/subtabs-and-microtabs.md @@ -52,5 +52,8 @@ Normal subtabs and microtab subtabs both use the same features: - shouldNotify()/prestigeNotify(): **optional**, if true, the tab button will be highlighted to notify the player that there is something there. +- glowColor: **optional**, specifies the color that the subtab glows. If this subtab is causing the main layer to node glow + (and it would't otherwise) the node also glows this color. Is NOT overridden by embedding a layer. + - embedLayer: **SIGNIFICANT**, the id of another layer. If you have this, it will override "content", "style" and "shouldNotify", instead displaying the entire layer in the subtab. \ No newline at end of file diff --git a/js/Demo/demoLayers.js b/js/Demo/demoLayers.js index 4f79516..e1b75ff 100644 --- a/js/Demo/demoLayers.js +++ b/js/Demo/demoLayers.js @@ -302,6 +302,8 @@ addLayer("c", { function() {return 'I have ' + format(player.points) + ' ' + player.c.thingy + ' points!'}, {"color": "red", "font-size": "32px", "font-family": "Comic Sans MS"}], "h-line", "milestones", "blank", "upgrades", "challenges"], + glowColor: "blue", + }, thingies: { prestigeNotify: true, diff --git a/js/game.js b/js/game.js index 52f4a56..4707584 100644 --- a/js/game.js +++ b/js/game.js @@ -88,21 +88,27 @@ function shouldNotify(layer){ return true } + if (tmp[layer].shouldNotify) + return true + if (isPlainObject(tmp[layer].tabFormat)) { for (subtab in tmp[layer].tabFormat){ - if (subtabShouldNotify(layer, 'mainTabs', subtab)) + if (subtabShouldNotify(layer, 'mainTabs', subtab)) { + tmp[layer].trueGlowColor = tmp[layer].tabFormat[subtab].glowColor return true + } } } for (family in tmp[layer].microtabs) { for (subtab in tmp[layer].microtabs[family]){ if (subtabShouldNotify(layer, family, subtab)) + tmp[layer].trueGlowColor = tmp[layer].microtabs[family][subtab].glowColor return true } } - return tmp[layer].shouldNotify + return false } diff --git a/js/technical/displays.js b/js/technical/displays.js index 6bd4f08..81fc146 100644 --- a/js/technical/displays.js +++ b/js/technical/displays.js @@ -18,8 +18,8 @@ function constructNodeStyle(layer){ style.push({'background-color': tmp[layer].color}) if (tmp[layer].image !== undefined) style.push({'background-image': 'url("' + tmp[layer].image + '")'}) - if(tmp[layer].glowColor !== undefined && tmp[layer].notify && player[layer].unlocked) - style.push({'box-shadow': 'var(--hqProperty2a), 0 0 20px ' + tmp[layer].glowColor}) + if(tmp[layer].notify && player[layer].unlocked) + style.push({'box-shadow': 'var(--hqProperty2a), 0 0 20px ' + tmp[layer].trueGlowColor}) style.push(tmp[layer].nodeStyle) return style } diff --git a/js/technical/layerSupport.js b/js/technical/layerSupport.js index 2748399..ce3f738 100644 --- a/js/technical/layerSupport.js +++ b/js/technical/layerSupport.js @@ -174,6 +174,7 @@ function setupLayer(layer){ if(layers[layer].displayRow === undefined) layers[layer].displayRow = layers[layer].row if(layers[layer].name === undefined) layers[layer].name = layer if(layers[layer].layerShown === undefined) layers[layer].layerShown = true + if(layers[layer].glowColor === undefined) layers[layer].glowColor = "#ff0000" let row = layers[layer].row diff --git a/js/technical/systemComponents.js b/js/technical/systemComponents.js index 0aee64e..3e8c62a 100644 --- a/js/technical/systemComponents.js +++ b/js/technical/systemComponents.js @@ -4,7 +4,8 @@ var systemComponents = { template: `
-
diff --git a/js/technical/temp.js b/js/technical/temp.js index bab63cc..df0eae0 100644 --- a/js/technical/temp.js +++ b/js/technical/temp.js @@ -37,6 +37,7 @@ function setupTemp() { tmp[layer].computedNodeStyle = [] setupBarStyles(layer) setupBuyables(layer) + tmp[layer].trueGlowColor = [] } tmp.other = { @@ -98,6 +99,7 @@ function updateTemp() { tmp[layer].nextAt = getNextAt(layer) tmp[layer].nextAtDisp = getNextAt(layer, true) tmp[layer].canReset = canReset(layer) + tmp[layer].trueGlowColor = tmp[layer].glowColor tmp[layer].notify = shouldNotify(layer) tmp[layer].prestigeNotify = prestigeNotify(layer) constructBarStyles(layer)