1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-21 16:13:55 +00:00

Fixed issues with embedding and highlighting subtabs

This commit is contained in:
Acamaeda 2020-10-29 21:06:37 -04:00
parent ca76d130fd
commit 1a83d63711
4 changed files with 15 additions and 5 deletions

View file

@ -397,7 +397,6 @@ addLayer("f", {
"blank", ['display-image', 'https://images.beano.com/store/24ab3094eb95e5373bca1ccd6f330d4406db8d1f517fc4170b32e146f80d?auto=compress%2Cformat&dpr=1&w=390'],
["display-text", "Bork bork!"]
],
// The following are only currently used for "custom" Prestige type:
prestigeButtonText() { //Is secretly HTML
if (!this.canBuyMax()) return "Hi! I'm a <u>weird dinosaur</u> and I'll give you a Farm Point in exchange for all of your candies and lollipops! (At least " + formatWhole(tmp[this.layer].nextAt) + " candies)"

View file

@ -61,6 +61,7 @@ function getNextAt(layer, canMax=false, useType = null) {
// Return true if the layer should be highlighted. By default checks for upgrades only.
function shouldNotify(layer){
if (player.tab == layer || player.navTab == layer) return false
for (id in tmp[layer].upgrades){
if (!isNaN(id)){
if (canAffordUpgrade(layer, id) && !hasUpgrade(layer, id) && tmp[layer].upgrades[id].unlocked){
@ -69,8 +70,8 @@ function shouldNotify(layer){
}
}
if (layers[layer].shouldNotify){
return layers[layer].shouldNotify()
if (tmp[layer].shouldNotify){
return tmp[layer].shouldNotify
}
else
return false

View file

@ -609,6 +609,15 @@ function notifyLayer(name) {
player.notify[name] = 1
}
function subtabShouldNotify(layer, family, id){
let subtab = {}
if (family == "mainTabs") subtab = tmp[layer].tabFormat[id]
else subtab = tmp[layer].microtabs[family][id]
if (player.subtabs[layer][family] === id) return false
else if (subtab.embedLayer) return tmp[subtab.embedLayer].notify
else return subtab.shouldNotify
}
function nodeShown(layer) {
if (tmp[layer].layerShown) return true
switch(layer) {

View file

@ -402,7 +402,7 @@ function loadVue() {
template: `
<div class="upgRow">
<div v-for="tab in Object.keys(data)">
<button v-if="data[tab].unlocked == undefined || data[tab].unlocked" v-bind:class="{tabButton: true, notify: (data[tab].embedLayer ? tmp[data[tab].embedLayer].notify : data[tab].shouldNotify)}" v-bind:style="[{'border-color': tmp[layer].color}, tmp[layer].componentStyles['tab-button'], data[tab].buttonStyle]" v-on:click="player.subtabs[layer][name] = tab">{{tab}}</button>
<button v-if="data[tab].unlocked == undefined || data[tab].unlocked" v-bind:class="{tabButton: true, notify: subtabShouldNotify(layer, name, tab)}" v-bind:style="[{'border-color': tmp[layer].color}, tmp[layer].componentStyles['tab-button'], data[tab].buttonStyle]" v-on:click="player.subtabs[layer][name] = tab">{{tab}}</button>
</div>
</div>
`
@ -495,7 +495,8 @@ function loadVue() {
<div class="upgTable" v-bind:style="{'padding-top': '25px', 'margin-bottom': '24px'}">
<tab-buttons v-bind:style="tmp[layer].componentStyles['tab-buttons']" :layer="layer" :data="tmp[layer].tabFormat" :name="'mainTabs'"></tab-buttons>
</div>
<column :layer="layer" :data="tmp[layer].tabFormat[player.subtabs[layer].mainTabs].content"></column>
<layer-tab v-if="tmp[layer].tabFormat[player.subtabs[layer].mainTabs].embedLayer" :layer="tmp[layer].tabFormat[player.subtabs[layer].mainTabs].embedLayer"></layer-tab>
<column v-else :layer="layer" :data="tmp[layer].tabFormat[player.subtabs[layer].mainTabs].content"></column>
</div>
</div></div>
`