From 1a83d637113511b17dd6656158dffb833fd2ea34 Mon Sep 17 00:00:00 2001 From: Acamaeda Date: Thu, 29 Oct 2020 21:06:37 -0400 Subject: [PATCH] Fixed issues with embedding and highlighting subtabs --- js/Demo/demoLayers.js | 1 - js/game.js | 5 +++-- js/utils.js | 9 +++++++++ js/v.js | 5 +++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/js/Demo/demoLayers.js b/js/Demo/demoLayers.js index 94003c7..bfaedd4 100644 --- a/js/Demo/demoLayers.js +++ b/js/Demo/demoLayers.js @@ -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 weird dinosaur 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)" diff --git a/js/game.js b/js/game.js index 4414b2e..560dd1c 100644 --- a/js/game.js +++ b/js/game.js @@ -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 diff --git a/js/utils.js b/js/utils.js index d294910..58bc3e8 100644 --- a/js/utils.js +++ b/js/utils.js @@ -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) { diff --git a/js/v.js b/js/v.js index 1997f6a..3286e9f 100644 --- a/js/v.js +++ b/js/v.js @@ -402,7 +402,7 @@ function loadVue() { template: `
- +
` @@ -495,7 +495,8 @@ function loadVue() {
- + + `