mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-21 16:13:55 +00:00
PrestigeNotify in subtabs
This commit is contained in:
parent
e18f1bdd47
commit
192d36d42a
4 changed files with 20 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
# The Modding Tree changelog:
|
||||
|
||||
## v2.4: Rationalized Edition
|
||||
## v2.4: Rationalized Edition -
|
||||
- Completely reworked tooltips. Shift-click a node to force its tooltip to stay displayed. (And hopefully finally fixed flickering!)
|
||||
- Added text-input and slider components.
|
||||
- Added the ability to toggle respec confirmations.
|
||||
|
@ -10,8 +10,10 @@
|
|||
- You no longer need to supply 'rows' and 'cols' for any Big Features.
|
||||
- Node symbols can use HTML.
|
||||
- Added documentation for the respec button.
|
||||
- Added prestigeNotify to subtabs, and prestigeNotify in subtabs also highlights the layer node.
|
||||
- The version number no longer contains special characters or irrational numbers.
|
||||
|
||||
|
||||
# v2.π.1 - 4/7/21
|
||||
- Fixed formatting for some larger numbers.
|
||||
- Upgrades will expand if there is too much text to display.
|
||||
|
|
|
@ -50,7 +50,7 @@ Normal subtabs and microtab subtabs both use the same features:
|
|||
|
||||
- unlocked(): **optional**. a function to determine if the button for this subtab should be visible. By default, a subtab is always unlocked. You can't use the "this" keyword in this function.
|
||||
|
||||
- shouldNotify(): **optional**, if true, the tab button will be highlighted to notify the player that there is something there.
|
||||
- shouldNotify()/prestigeNotify(): **optional**, if true, the tab button will be highlighted to notify the player that there is something there.
|
||||
|
||||
- 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.
|
|
@ -304,6 +304,7 @@ addLayer("c", {
|
|||
"h-line", "milestones", "blank", "upgrades", "challenges"],
|
||||
},
|
||||
thingies: {
|
||||
prestigeNotify: true,
|
||||
style() {return {'background-color': '#222222'}},
|
||||
buttonStyle() {return {'border-color': 'orange'}},
|
||||
content:[
|
||||
|
|
17
js/utils.js
17
js/utils.js
|
@ -219,7 +219,20 @@ function layOver(obj1, obj2) {
|
|||
|
||||
function prestigeNotify(layer) {
|
||||
if (layers[layer].prestigeNotify) return layers[layer].prestigeNotify()
|
||||
else if (tmp[layer].autoPrestige || tmp[layer].passiveGeneration) return false
|
||||
|
||||
if (isPlainObject(tmp[layer].tabFormat)) {
|
||||
for (subtab in tmp[layer].tabFormat){
|
||||
if (subtabResetNotify(layer, 'mainTabs', subtab))
|
||||
return true
|
||||
}
|
||||
}
|
||||
for (family in tmp[layer].microtabs) {
|
||||
for (subtab in tmp[layer].microtabs[family]){
|
||||
if (subtabResetNotify(layer, family, subtab))
|
||||
return true
|
||||
}
|
||||
}
|
||||
if (tmp[layer].autoPrestige || tmp[layer].passiveGeneration) return false
|
||||
else if (tmp[layer].type == "static") return tmp[layer].canReset
|
||||
else if (tmp[layer].type == "normal") return (tmp[layer].canReset && (tmp[layer].resetGain.gte(player[layer].points.div(10))))
|
||||
else return false
|
||||
|
@ -244,7 +257,7 @@ function subtabResetNotify(layer, family, id) {
|
|||
if (family == "mainTabs") subtab = tmp[layer].tabFormat[id]
|
||||
else subtab = tmp[layer].microtabs[family][id]
|
||||
if (subtab.embedLayer) return tmp[subtab.embedLayer].prestigeNotify
|
||||
else return false
|
||||
else return subtab.prestigeNotify
|
||||
}
|
||||
|
||||
function nodeShown(layer) {
|
||||
|
|
Loading…
Reference in a new issue