Merge pull request #480 from DanielNoord/tooltip
Hotfix for dragon levelup Tooltip
This commit is contained in:
@@ -348,7 +348,7 @@ CM.Cache.CacheDragonCost = function() {
|
||||
cost += price;
|
||||
CM.Sim.Objects[target].amount--;
|
||||
}
|
||||
CM.Cache.CostDragonUpgrade = CM.Disp.Beautify(cost);
|
||||
CM.Cache.CostDragonUpgrade = "Cost to rebuy: " + CM.Disp.Beautify(cost);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -358,6 +358,7 @@ CM.Cache.CacheDragonCost = function() {
|
||||
target = j;
|
||||
if (Game.Objects[target].amount < amount) {
|
||||
CM.Cache.CostDragonUpgrade = "Not enough buildings to sell";
|
||||
break
|
||||
}
|
||||
else {
|
||||
for (var i = 0; i < amount; i++) {
|
||||
@@ -368,8 +369,8 @@ CM.Cache.CacheDragonCost = function() {
|
||||
CM.Sim.Objects[target].amount--;
|
||||
}
|
||||
}
|
||||
CM.Cache.CostDragonUpgrade = "Cost to rebuy: " + CM.Disp.Beautify(cost);
|
||||
}
|
||||
CM.Cache.CostDragonUpgrade = CM.Disp.Beautify(cost);
|
||||
}
|
||||
}
|
||||
CM.Cache.lastDragonLevel = Game.dragonLevel;
|
||||
@@ -3023,7 +3024,7 @@ CM.Disp.AddDragonLevelUpTooltip = function() {
|
||||
if ((l('specialPopup').className.match(/onScreen/) && l('specialPopup').children[0].style.background.match(/dragon/)) != null) {
|
||||
for (let i = 0; i < l('specialPopup').childNodes.length; i++) {
|
||||
if (l('specialPopup').childNodes[i].className == "optionBox") {
|
||||
l('specialPopup').children[i].onmouseover = function() {CM.Cache.CacheDragonCost(); Game.tooltip.dynamic = 1; Game.tooltip.draw(this, CM.Cache.CostDragonUpgrade, 'this'); Game.tooltip.wobble();}
|
||||
l('specialPopup').children[i].onmouseover = function() {CM.Cache.CacheDragonCost(); Game.tooltip.dynamic = 1; Game.tooltip.draw(l('specialPopup'), `<div style="min-width:200px;text-align:center;">${CM.Cache.CostDragonUpgrade}</div>`, 'this'); Game.tooltip.wobble();}
|
||||
l('specialPopup').children[i].onmouseout = function() {Game.tooltip.shouldHide = 1;}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ CM.Cache.CacheDragonCost = function() {
|
||||
cost += price;
|
||||
CM.Sim.Objects[target].amount--;
|
||||
}
|
||||
CM.Cache.CostDragonUpgrade = CM.Disp.Beautify(cost);
|
||||
CM.Cache.CostDragonUpgrade = "Cost to rebuy: " + CM.Disp.Beautify(cost);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -327,6 +327,7 @@ CM.Cache.CacheDragonCost = function() {
|
||||
target = j;
|
||||
if (Game.Objects[target].amount < amount) {
|
||||
CM.Cache.CostDragonUpgrade = "Not enough buildings to sell";
|
||||
break
|
||||
}
|
||||
else {
|
||||
for (var i = 0; i < amount; i++) {
|
||||
@@ -337,8 +338,8 @@ CM.Cache.CacheDragonCost = function() {
|
||||
CM.Sim.Objects[target].amount--;
|
||||
}
|
||||
}
|
||||
CM.Cache.CostDragonUpgrade = "Cost to rebuy: " + CM.Disp.Beautify(cost);
|
||||
}
|
||||
CM.Cache.CostDragonUpgrade = CM.Disp.Beautify(cost);
|
||||
}
|
||||
}
|
||||
CM.Cache.lastDragonLevel = Game.dragonLevel;
|
||||
|
||||
@@ -1847,7 +1847,7 @@ CM.Disp.AddDragonLevelUpTooltip = function() {
|
||||
if ((l('specialPopup').className.match(/onScreen/) && l('specialPopup').children[0].style.background.match(/dragon/)) != null) {
|
||||
for (let i = 0; i < l('specialPopup').childNodes.length; i++) {
|
||||
if (l('specialPopup').childNodes[i].className == "optionBox") {
|
||||
l('specialPopup').children[i].onmouseover = function() {CM.Cache.CacheDragonCost(); Game.tooltip.dynamic = 1; Game.tooltip.draw(this, CM.Cache.CostDragonUpgrade, 'this'); Game.tooltip.wobble();}
|
||||
l('specialPopup').children[i].onmouseover = function() {CM.Cache.CacheDragonCost(); Game.tooltip.dynamic = 1; Game.tooltip.draw(l('specialPopup'), `<div style="min-width:200px;text-align:center;">${CM.Cache.CostDragonUpgrade}</div>`, 'this'); Game.tooltip.wobble();}
|
||||
l('specialPopup').children[i].onmouseout = function() {Game.tooltip.shouldHide = 1;}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user