Added tooltip with costs for Dragon Levels (#65)

This commit is contained in:
Daniel van Noord
2020-12-28 12:41:01 +01:00
parent a8b874f37d
commit 91ebbf39b9
5 changed files with 180 additions and 11 deletions

View File

@@ -1808,7 +1808,7 @@ CM.Disp.UpdateWrinklerTooltip = function() {
}
/********
* Section: Functions related to the dragon aura interface */
* Section: Functions related to the Dragon */
/**
* This functions adds the two extra lines about CPS and time to recover to the aura picker infoscreen
@@ -1838,6 +1838,22 @@ CM.Disp.AddAuraInfo = function(aura) {
}
}
/**
* This functions adds a tooltip to the level up button displaying the cost of rebuying all
* It is called by Game.ToggleSpecialMenu() after CM.ReplaceNative()
*/
CM.Disp.AddDragonLevelUpTooltip = function() {
// Check if it is the dragon popup that is on screen
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].onmouseout = function() {Game.tooltip.shouldHide=1;}
}
}
}
}
/********
* Section: General functions related to the Options/Stats pages
@@ -2400,7 +2416,7 @@ CM.Disp.CreateStatsMissDisp = function(theMissDisp) {
* @returns {object} section The object contating the Lucky section
*/
CM.Disp.CreateStatsLuckySection = function() {
// TODO: Remove this and creater better tooltip!!
// This sets which tooltip to display for certain stats
var goldCookTooltip = CM.Sim.auraMult('Dragon\'s Fortune') ? 'GoldCookDragonsFortuneTooltipPlaceholder' : 'GoldCookTooltipPlaceholder';
var section = document.createElement('div');
@@ -2465,7 +2481,7 @@ CM.Disp.CreateStatsLuckySection = function() {
* @returns {object} section The object contating the Chain section
*/
CM.Disp.CreateStatsChainSection = function() {
// TODO: Remove this and creater better tooltip!!
// This sets which tooltip to display for certain stats
var goldCookTooltip = CM.Sim.auraMult('Dragon\'s Fortune') ? 'GoldCookDragonsFortuneTooltipPlaceholder' : 'GoldCookTooltipPlaceholder';
var section = document.createElement('div');