Hotfix for dragon levelup Tooltip

This commit is contained in:
Daniel van Noord
2020-12-28 12:51:50 +01:00
parent 91ebbf39b9
commit ad7d35e1ee
3 changed files with 10 additions and 8 deletions

View File

@@ -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;}
}
}

View File

@@ -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;

View File

@@ -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;}
}
}