From 29ba1c66cf1105ce577659e3abae27ea0c5bb3a9 Mon Sep 17 00:00:00 2001 From: Daniel van Noord Date: Sat, 23 Jan 2021 22:36:26 +0100 Subject: [PATCH 1/8] Moved most replace tooltip funcs to Main.js --- CookieMonster.js | 132 ++++++++++++++++++++++++----------------------- src/Disp.js | 56 +------------------- src/Main.js | 76 +++++++++++++++++++++++---- 3 files changed, 136 insertions(+), 128 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index e07907d..dde6bfb 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -2352,31 +2352,10 @@ CM.Disp.CreateSimpleTooltip = function(placeholder, text, minWidth) { CM.Disp[placeholder].appendChild(desc); } -/** - * This function replaces the original .onmouseover functions of buildings so that it calls CM.Disp.Tooltip() - * CM.Disp.Tooltip() sets the tooltip type to 'b' - * It is called by CM.DelayInit() - * TODO: Place all ReplaceTooltip functions either under CM.DelayInit() or CM.ReplaceNative() - * TODO: Move this code to Main.js file - */ -CM.Disp.ReplaceTooltipBuild = function() { - CM.Disp.TooltipBuildBackup = []; - for (var i in Game.Objects) { - var me = Game.Objects[i]; - if (l('product' + me.id).onmouseover != null) { - CM.Disp.TooltipBuildBackup[i] = l('product' + me.id).onmouseover; - eval('l(\'product\' + me.id).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'b\', \'' + i + '\');}, \'store\'); Game.tooltip.wobble();}'); - } - } -} - /** * This function replaces the original .onmouseover functions of upgrades so that it calls CM.Disp.Tooltip() * CM.Disp.Tooltip() sets the tooltip type to 'u' - * It is called by CM.ReplaceNative() - * TODO: Place all ReplaceTooltip functions either under CM.DelayInit() or CM.ReplaceNative() - * TODO: Move this code to Main.js file - * + * It is called by Game.RebuildUpgrades() through CM.ReplaceNative() and is therefore not permanent like the other ReplaceTooltip functions */ CM.Disp.ReplaceTooltipUpgrade = function() { CM.Disp.TooltipUpgradeBackup = []; @@ -2389,39 +2368,6 @@ CM.Disp.ReplaceTooltipUpgrade = function() { } } -/** - * This function replaces the original .onmouseover functions of the Grimoire minigame so that it calls CM.Disp.Tooltip() - * CM.Disp.Tooltip() sets the tooltip type to 'g' - * The function is called by CM.DelayInit() - * TODO: Place all ReplaceTooltip functions either under CM.DelayInit() or CM.ReplaceNative() - * TODO: Move this code to Main.js file - */ -CM.Disp.ReplaceTooltipGrimoire = function() { - if (Game.Objects['Wizard tower'].minigameLoaded) { - CM.Disp.TooltipGrimoireBackup = []; - for (var i in Game.Objects['Wizard tower'].minigame.spellsById) { - if (l('grimoireSpell' + i).onmouseover != null) { - CM.Disp.TooltipGrimoireBackup[i] = l('grimoireSpell' + i).onmouseover; - eval('l(\'grimoireSpell\' + i).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'g\', \'' + i + '\');}, \'this\'); Game.tooltip.wobble();}'); - } - } - } -} - -/** - * This function replaces the original .onmouseover functions of sugar lumps so that it calls CM.Disp.Tooltip() - * CM.Disp.Tooltip() sets the tooltip type to 's' - * The function is called by CM.DelayInit() - * TODO: Place all ReplaceTooltip functions either under CM.DelayInit() or CM.ReplaceNative() - * TODO: Move this code to Main.js file - */ -CM.Disp.ReplaceTooltipLump = function() { - if (Game.canLumps()) { - CM.Disp.TooltipLumpBackup = l('lumps').onmouseover; - eval('l(\'lumps\').onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'s\', \'Lump\');}, \'this\'); Game.tooltip.wobble();}'); - } -}; - /** * This function enhance the standard tooltips by creating and changing l('tooltip') * The function is called by .onmouseover events that have replaced original code to use CM.Disp.Tooltip() @@ -4094,12 +4040,10 @@ CM.ReplaceNative = function() { CM.Backup.scriptLoaded = Game.scriptLoaded; Game.scriptLoaded = function(who, script) { CM.Backup.scriptLoaded(who, script); - CM.Disp.ReplaceTooltipGrimoire() + CM.Main.ReplaceTooltipGrimoire() CM.ReplaceNativeGrimoire(); } - // TODO: Move this ReplaceTooltip function too other ReplaceTooltip functions - // OR: Move all other into this function CM.Backup.RebuildUpgrades = Game.RebuildUpgrades; Game.RebuildUpgrades = function() { CM.Backup.RebuildUpgrades(); @@ -4107,7 +4051,6 @@ CM.ReplaceNative = function() { Game.CalculateGains(); } - CM.Backup.DescribeDragonAura = Game.DescribeDragonAura; /** * This functions adds the function CM.Disp.AddAuraInfo() to Game.DescribeDragonAura() @@ -4171,7 +4114,7 @@ CM.ReplaceNativeGrimoireLaunch = function() { eval('CM.Backup.GrimoireLaunchMod = ' + minigame.launch.toString().split('=this').join('= Game.Objects[\'Wizard tower\'].minigame')); Game.Objects['Wizard tower'].minigame.launch = function() { CM.Backup.GrimoireLaunchMod(); - CM.Disp.ReplaceTooltipGrimoire(); + CM.Main.ReplaceTooltipGrimoire(); CM.HasReplaceNativeGrimoireDraw = false; CM.ReplaceNativeGrimoireDraw(); } @@ -4286,9 +4229,7 @@ CM.DelayInit = function() { CM.Disp.CreateSimpleTooltip(CM.Disp.TooltipText[i][0], CM.Disp.TooltipText[i][1], CM.Disp.TooltipText[i][2]); } CM.Disp.CreateWrinklerButtons(); - CM.Disp.ReplaceTooltipBuild(); - CM.Disp.ReplaceTooltipGrimoire(); - CM.Disp.ReplaceTooltipLump(); + CM.Main.ReplaceTooltips(); CM.Main.AddWrinklerAreaDetect(); CM.Cache.InitCookiesDiff(); CM.ReplaceNative(); @@ -4313,6 +4254,69 @@ CM.DelayInit = function() { Game.Win('Third-party'); } +/******** + * Section: Functions related to first initizalition of CM */ + +/** + * This function call all functions that replace Game-tooltips with CM-enhanced tooltips + * It is called by CM.DelayInit() + */ +CM.Main.ReplaceTooltips = function() { + CM.Main.ReplaceTooltipBuild(); + CM.Main.ReplaceTooltipGrimoire(); + CM.Main.ReplaceTooltipLump(); +} + +/******** + * Section: Functions related to replacing tooltips */ + + +/** + * This function replaces the original .onmouseover functions of buildings so that it calls CM.Disp.Tooltip() + * CM.Disp.Tooltip() sets the tooltip type to 'b' + * It is called by CM.Main.ReplaceTooltips() + */ +CM.Main.ReplaceTooltipBuild = function() { + CM.Main.TooltipBuildBackup = []; + for (var i in Game.Objects) { + var me = Game.Objects[i]; + if (l('product' + me.id).onmouseover != null) { + CM.Main.TooltipBuildBackup[i] = l('product' + me.id).onmouseover; + eval('l(\'product\' + me.id).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'b\', \'' + i + '\');}, \'store\'); Game.tooltip.wobble();}'); + } + } +} + +/** + * This function replaces the original .onmouseover functions of the Grimoire minigame so that it calls CM.Disp.Tooltip() + * CM.Disp.Tooltip() sets the tooltip type to 'g' + * It is called by CM.Main.ReplaceTooltips() + */ +CM.Main.ReplaceTooltipGrimoire = function() { + if (Game.Objects['Wizard tower'].minigameLoaded) { + CM.Main.TooltipGrimoireBackup = []; + for (var i in Game.Objects['Wizard tower'].minigame.spellsById) { + if (l('grimoireSpell' + i).onmouseover != null) { + CM.Main.TooltipGrimoireBackup[i] = l('grimoireSpell' + i).onmouseover; + eval('l(\'grimoireSpell\' + i).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'g\', \'' + i + '\');}, \'this\'); Game.tooltip.wobble();}'); + } + } + } +} + +/** + * This function replaces the original .onmouseover functions of sugar lumps so that it calls CM.Disp.Tooltip() + * CM.Disp.Tooltip() sets the tooltip type to 's' + * It is called by CM.Main.ReplaceTooltips() + */ +CM.Main.ReplaceTooltipLump = function() { + if (Game.canLumps()) { + CM.Main.TooltipLumpBackup = l('lumps').onmouseover; + eval('l(\'lumps\').onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'s\', \'Lump\');}, \'this\'); Game.tooltip.wobble();}'); + } +}; + + /******** * Section: Functions related to checking for changes in Minigames/GC's/Ticker * TODO: Possibly move this section */ @@ -4478,7 +4482,7 @@ CM.Main.CheckWrinklerCount = function() { * This function creates .onmouseover/out events that determine if the mouse is hovering-over a Wrinkler * It is called by CM.DelayInit * TODO: The system for displaying wrinklers should ideally use a similar system as other tooltips - * Thus, writing a CM.Disp.ReplaceTooltipWrinkler function etc. + * Thus, writing a CM.Main.ReplaceTooltipWrinkler function etc. */ CM.Main.AddWrinklerAreaDetect = function() { l('backgroundLeftCanvas').onmouseover = function() {CM.Disp.TooltipWrinklerArea = 1;}; diff --git a/src/Disp.js b/src/Disp.js index 102f600..b900572 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -1171,31 +1171,10 @@ CM.Disp.CreateSimpleTooltip = function(placeholder, text, minWidth) { CM.Disp[placeholder].appendChild(desc); } -/** - * This function replaces the original .onmouseover functions of buildings so that it calls CM.Disp.Tooltip() - * CM.Disp.Tooltip() sets the tooltip type to 'b' - * It is called by CM.DelayInit() - * TODO: Place all ReplaceTooltip functions either under CM.DelayInit() or CM.ReplaceNative() - * TODO: Move this code to Main.js file - */ -CM.Disp.ReplaceTooltipBuild = function() { - CM.Disp.TooltipBuildBackup = []; - for (var i in Game.Objects) { - var me = Game.Objects[i]; - if (l('product' + me.id).onmouseover != null) { - CM.Disp.TooltipBuildBackup[i] = l('product' + me.id).onmouseover; - eval('l(\'product\' + me.id).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'b\', \'' + i + '\');}, \'store\'); Game.tooltip.wobble();}'); - } - } -} - /** * This function replaces the original .onmouseover functions of upgrades so that it calls CM.Disp.Tooltip() * CM.Disp.Tooltip() sets the tooltip type to 'u' - * It is called by CM.ReplaceNative() - * TODO: Place all ReplaceTooltip functions either under CM.DelayInit() or CM.ReplaceNative() - * TODO: Move this code to Main.js file - * + * It is called by Game.RebuildUpgrades() through CM.ReplaceNative() and is therefore not permanent like the other ReplaceTooltip functions */ CM.Disp.ReplaceTooltipUpgrade = function() { CM.Disp.TooltipUpgradeBackup = []; @@ -1208,39 +1187,6 @@ CM.Disp.ReplaceTooltipUpgrade = function() { } } -/** - * This function replaces the original .onmouseover functions of the Grimoire minigame so that it calls CM.Disp.Tooltip() - * CM.Disp.Tooltip() sets the tooltip type to 'g' - * The function is called by CM.DelayInit() - * TODO: Place all ReplaceTooltip functions either under CM.DelayInit() or CM.ReplaceNative() - * TODO: Move this code to Main.js file - */ -CM.Disp.ReplaceTooltipGrimoire = function() { - if (Game.Objects['Wizard tower'].minigameLoaded) { - CM.Disp.TooltipGrimoireBackup = []; - for (var i in Game.Objects['Wizard tower'].minigame.spellsById) { - if (l('grimoireSpell' + i).onmouseover != null) { - CM.Disp.TooltipGrimoireBackup[i] = l('grimoireSpell' + i).onmouseover; - eval('l(\'grimoireSpell\' + i).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'g\', \'' + i + '\');}, \'this\'); Game.tooltip.wobble();}'); - } - } - } -} - -/** - * This function replaces the original .onmouseover functions of sugar lumps so that it calls CM.Disp.Tooltip() - * CM.Disp.Tooltip() sets the tooltip type to 's' - * The function is called by CM.DelayInit() - * TODO: Place all ReplaceTooltip functions either under CM.DelayInit() or CM.ReplaceNative() - * TODO: Move this code to Main.js file - */ -CM.Disp.ReplaceTooltipLump = function() { - if (Game.canLumps()) { - CM.Disp.TooltipLumpBackup = l('lumps').onmouseover; - eval('l(\'lumps\').onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'s\', \'Lump\');}, \'this\'); Game.tooltip.wobble();}'); - } -}; - /** * This function enhance the standard tooltips by creating and changing l('tooltip') * The function is called by .onmouseover events that have replaced original code to use CM.Disp.Tooltip() diff --git a/src/Main.js b/src/Main.js index caa11b2..17ac29e 100644 --- a/src/Main.js +++ b/src/Main.js @@ -45,12 +45,10 @@ CM.ReplaceNative = function() { CM.Backup.scriptLoaded = Game.scriptLoaded; Game.scriptLoaded = function(who, script) { CM.Backup.scriptLoaded(who, script); - CM.Disp.ReplaceTooltipGrimoire() + CM.Main.ReplaceTooltipGrimoire() CM.ReplaceNativeGrimoire(); } - // TODO: Move this ReplaceTooltip function too other ReplaceTooltip functions - // OR: Move all other into this function CM.Backup.RebuildUpgrades = Game.RebuildUpgrades; Game.RebuildUpgrades = function() { CM.Backup.RebuildUpgrades(); @@ -58,7 +56,6 @@ CM.ReplaceNative = function() { Game.CalculateGains(); } - CM.Backup.DescribeDragonAura = Game.DescribeDragonAura; /** * This functions adds the function CM.Disp.AddAuraInfo() to Game.DescribeDragonAura() @@ -122,7 +119,7 @@ CM.ReplaceNativeGrimoireLaunch = function() { eval('CM.Backup.GrimoireLaunchMod = ' + minigame.launch.toString().split('=this').join('= Game.Objects[\'Wizard tower\'].minigame')); Game.Objects['Wizard tower'].minigame.launch = function() { CM.Backup.GrimoireLaunchMod(); - CM.Disp.ReplaceTooltipGrimoire(); + CM.Main.ReplaceTooltipGrimoire(); CM.HasReplaceNativeGrimoireDraw = false; CM.ReplaceNativeGrimoireDraw(); } @@ -237,9 +234,7 @@ CM.DelayInit = function() { CM.Disp.CreateSimpleTooltip(CM.Disp.TooltipText[i][0], CM.Disp.TooltipText[i][1], CM.Disp.TooltipText[i][2]); } CM.Disp.CreateWrinklerButtons(); - CM.Disp.ReplaceTooltipBuild(); - CM.Disp.ReplaceTooltipGrimoire(); - CM.Disp.ReplaceTooltipLump(); + CM.Main.ReplaceTooltips(); CM.Main.AddWrinklerAreaDetect(); CM.Cache.InitCookiesDiff(); CM.ReplaceNative(); @@ -264,6 +259,69 @@ CM.DelayInit = function() { Game.Win('Third-party'); } +/******** + * Section: Functions related to first initizalition of CM */ + +/** + * This function call all functions that replace Game-tooltips with CM-enhanced tooltips + * It is called by CM.DelayInit() + */ +CM.Main.ReplaceTooltips = function() { + CM.Main.ReplaceTooltipBuild(); + CM.Main.ReplaceTooltipGrimoire(); + CM.Main.ReplaceTooltipLump(); +} + +/******** + * Section: Functions related to replacing tooltips */ + + +/** + * This function replaces the original .onmouseover functions of buildings so that it calls CM.Disp.Tooltip() + * CM.Disp.Tooltip() sets the tooltip type to 'b' + * It is called by CM.Main.ReplaceTooltips() + */ +CM.Main.ReplaceTooltipBuild = function() { + CM.Main.TooltipBuildBackup = []; + for (var i in Game.Objects) { + var me = Game.Objects[i]; + if (l('product' + me.id).onmouseover != null) { + CM.Main.TooltipBuildBackup[i] = l('product' + me.id).onmouseover; + eval('l(\'product\' + me.id).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'b\', \'' + i + '\');}, \'store\'); Game.tooltip.wobble();}'); + } + } +} + +/** + * This function replaces the original .onmouseover functions of the Grimoire minigame so that it calls CM.Disp.Tooltip() + * CM.Disp.Tooltip() sets the tooltip type to 'g' + * It is called by CM.Main.ReplaceTooltips() + */ +CM.Main.ReplaceTooltipGrimoire = function() { + if (Game.Objects['Wizard tower'].minigameLoaded) { + CM.Main.TooltipGrimoireBackup = []; + for (var i in Game.Objects['Wizard tower'].minigame.spellsById) { + if (l('grimoireSpell' + i).onmouseover != null) { + CM.Main.TooltipGrimoireBackup[i] = l('grimoireSpell' + i).onmouseover; + eval('l(\'grimoireSpell\' + i).onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'g\', \'' + i + '\');}, \'this\'); Game.tooltip.wobble();}'); + } + } + } +} + +/** + * This function replaces the original .onmouseover functions of sugar lumps so that it calls CM.Disp.Tooltip() + * CM.Disp.Tooltip() sets the tooltip type to 's' + * It is called by CM.Main.ReplaceTooltips() + */ +CM.Main.ReplaceTooltipLump = function() { + if (Game.canLumps()) { + CM.Main.TooltipLumpBackup = l('lumps').onmouseover; + eval('l(\'lumps\').onmouseover = function() {Game.tooltip.dynamic = 1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip(\'s\', \'Lump\');}, \'this\'); Game.tooltip.wobble();}'); + } +}; + + /******** * Section: Functions related to checking for changes in Minigames/GC's/Ticker * TODO: Possibly move this section */ @@ -429,7 +487,7 @@ CM.Main.CheckWrinklerCount = function() { * This function creates .onmouseover/out events that determine if the mouse is hovering-over a Wrinkler * It is called by CM.DelayInit * TODO: The system for displaying wrinklers should ideally use a similar system as other tooltips - * Thus, writing a CM.Disp.ReplaceTooltipWrinkler function etc. + * Thus, writing a CM.Main.ReplaceTooltipWrinkler function etc. */ CM.Main.AddWrinklerAreaDetect = function() { l('backgroundLeftCanvas').onmouseover = function() {CM.Disp.TooltipWrinklerArea = 1;}; From c64f42bcfae1d74061c025c8fda446dac186151b Mon Sep 17 00:00:00 2001 From: Daniel van Noord Date: Sat, 23 Jan 2021 22:55:39 +0100 Subject: [PATCH 2/8] Start work on Garden Tooltip --- CookieMonster.js | 16 ++++++++++++++++ src/Main.js | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/CookieMonster.js b/CookieMonster.js index dde6bfb..b164909 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -4265,6 +4265,7 @@ CM.Main.ReplaceTooltips = function() { CM.Main.ReplaceTooltipBuild(); CM.Main.ReplaceTooltipGrimoire(); CM.Main.ReplaceTooltipLump(); + CM.Main.ReplaceTooltipGarden(); } /******** @@ -4316,6 +4317,21 @@ CM.Main.ReplaceTooltipLump = function() { } }; +/** + * This function replaces the original .onmouseover functions of sugar lumps so that it calls CM.Disp.Tooltip() + * CM.Disp.Tooltip() sets the tooltip type to '?' + * It is called by CM.Main.ReplaceTooltips() + */ +CM.Main.ReplaceTooltipGarden = function() { + if (Game.Objects['Farm'].minigameLoaded) { + CM.Main.TooltipGardenBackup = []; + for (var i in Game.Objects['Farm'].minigame.plot) { + for (var j in i) { + //console.log(j, i) + } + } + } +}; /******** * Section: Functions related to checking for changes in Minigames/GC's/Ticker diff --git a/src/Main.js b/src/Main.js index 17ac29e..ed34fd0 100644 --- a/src/Main.js +++ b/src/Main.js @@ -270,6 +270,7 @@ CM.Main.ReplaceTooltips = function() { CM.Main.ReplaceTooltipBuild(); CM.Main.ReplaceTooltipGrimoire(); CM.Main.ReplaceTooltipLump(); + CM.Main.ReplaceTooltipGarden(); } /******** @@ -321,6 +322,21 @@ CM.Main.ReplaceTooltipLump = function() { } }; +/** + * This function replaces the original .onmouseover functions of sugar lumps so that it calls CM.Disp.Tooltip() + * CM.Disp.Tooltip() sets the tooltip type to '?' + * It is called by CM.Main.ReplaceTooltips() + */ +CM.Main.ReplaceTooltipGarden = function() { + if (Game.Objects['Farm'].minigameLoaded) { + CM.Main.TooltipGardenBackup = []; + for (var i in Game.Objects['Farm'].minigame.plot) { + for (var j in i) { + //console.log(j, i) + } + } + } +}; /******** * Section: Functions related to checking for changes in Minigames/GC's/Ticker From 23f19b4d6249f241d76b7c2b1c1366a26c56b042 Mon Sep 17 00:00:00 2001 From: Daniel van Noord Date: Tue, 26 Jan 2021 14:57:59 +0100 Subject: [PATCH 3/8] Created (empty) tooltip for garden plots --- CookieMonster.js | 29 ++++++++++++++++++++--------- src/Disp.js | 15 ++++++++++++++- src/Main.js | 14 ++++++-------- 3 files changed, 40 insertions(+), 18 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 0f8c20e..bd905c3 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -2416,9 +2416,10 @@ CM.Disp.Tooltip = function(type, name) { } else if (type === 's') l('tooltip').innerHTML = Game.lumpTooltip(); // Sugar Lumps else if (type === 'g') l('tooltip').innerHTML = Game.Objects['Wizard tower'].minigame.spellTooltip(name)(); // Grimoire + else if (type == 'p') l('tooltip').innerHTML = Game.ObjectsById[2].minigame.tileTooltip(name[0], name[1])(); // Garden plots // Adds area for extra tooltip-sections - if ((type == 'b' && Game.buyMode == 1) || type == 'u' || type == 's' || type == 'g') { + if ((type == 'b' && Game.buyMode == 1) || type == 'u' || type == 's' || type == 'g' || type == 'p') { var area = document.createElement('div'); area.id = 'CMTooltipArea'; l('tooltip').appendChild(area); @@ -2583,6 +2584,9 @@ CM.Disp.UpdateTooltip = function() { else if (CM.Disp.tooltipType === 'g') { CM.Disp.UpdateTooltipGrimoire(); } + else if (CM.Disp.tooltipType === 'p') { + CM.Disp.UpdateTooltipGardenPlots(); + } CM.Disp.UpdateTooltipWarnings(); } else if (l('CMTooltipArea') == null) { // Remove warnings if its a basic tooltip @@ -2779,6 +2783,15 @@ CM.Disp.UpdateTooltipGrimoire = function() { } } +/** + * This function adds extra info to the Garden plots tooltips + * It is called when Garden plots tooltips are created or refreshed by CM.Disp.UpdateTooltip() + * It adds to the additional information to l('CMTooltipArea') + */ +CM.Disp.UpdateTooltipGardenPlots = function() { + var minigame = Game.Objects['Farm'].minigame; +} + /** * This function updates the warnings section of the building and upgrade tooltips * It is called by CM.Disp.UpdateTooltip() @@ -4335,18 +4348,16 @@ CM.Main.ReplaceTooltipLump = function() { }; /** - * This function replaces the original .onmouseover functions of sugar lumps so that it calls CM.Disp.Tooltip() - * CM.Disp.Tooltip() sets the tooltip type to '?' + * This function replaces the original .onmouseover functions of all garden plants so that it calls CM.Disp.Tooltip() + * CM.Disp.Tooltip() sets the tooltip type to 'p' * It is called by CM.Main.ReplaceTooltips() */ CM.Main.ReplaceTooltipGarden = function() { if (Game.Objects['Farm'].minigameLoaded) { - CM.Main.TooltipGardenBackup = []; - for (var i in Game.Objects['Farm'].minigame.plot) { - for (var j in i) { - //console.log(j, i) - } - } + Array.from(l('gardenPlot').children).forEach((child, index) => { + var coords = child.id.slice(-3,); + child.onmouseover = function() {Game.tooltip.dynamic=1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip('p', [`${coords[0]}`,`${coords[2]}`]);}, 'this'); Game.tooltip.wobble();}; + }); } }; diff --git a/src/Disp.js b/src/Disp.js index 5b55a01..e96b144 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -1233,9 +1233,10 @@ CM.Disp.Tooltip = function(type, name) { } else if (type === 's') l('tooltip').innerHTML = Game.lumpTooltip(); // Sugar Lumps else if (type === 'g') l('tooltip').innerHTML = Game.Objects['Wizard tower'].minigame.spellTooltip(name)(); // Grimoire + else if (type == 'p') l('tooltip').innerHTML = Game.ObjectsById[2].minigame.tileTooltip(name[0], name[1])(); // Garden plots // Adds area for extra tooltip-sections - if ((type == 'b' && Game.buyMode == 1) || type == 'u' || type == 's' || type == 'g') { + if ((type == 'b' && Game.buyMode == 1) || type == 'u' || type == 's' || type == 'g' || type == 'p') { var area = document.createElement('div'); area.id = 'CMTooltipArea'; l('tooltip').appendChild(area); @@ -1400,6 +1401,9 @@ CM.Disp.UpdateTooltip = function() { else if (CM.Disp.tooltipType === 'g') { CM.Disp.UpdateTooltipGrimoire(); } + else if (CM.Disp.tooltipType === 'p') { + CM.Disp.UpdateTooltipGardenPlots(); + } CM.Disp.UpdateTooltipWarnings(); } else if (l('CMTooltipArea') == null) { // Remove warnings if its a basic tooltip @@ -1596,6 +1600,15 @@ CM.Disp.UpdateTooltipGrimoire = function() { } } +/** + * This function adds extra info to the Garden plots tooltips + * It is called when Garden plots tooltips are created or refreshed by CM.Disp.UpdateTooltip() + * It adds to the additional information to l('CMTooltipArea') + */ +CM.Disp.UpdateTooltipGardenPlots = function() { + var minigame = Game.Objects['Farm'].minigame; +} + /** * This function updates the warnings section of the building and upgrade tooltips * It is called by CM.Disp.UpdateTooltip() diff --git a/src/Main.js b/src/Main.js index ed34fd0..9a8e75e 100644 --- a/src/Main.js +++ b/src/Main.js @@ -323,18 +323,16 @@ CM.Main.ReplaceTooltipLump = function() { }; /** - * This function replaces the original .onmouseover functions of sugar lumps so that it calls CM.Disp.Tooltip() - * CM.Disp.Tooltip() sets the tooltip type to '?' + * This function replaces the original .onmouseover functions of all garden plants so that it calls CM.Disp.Tooltip() + * CM.Disp.Tooltip() sets the tooltip type to 'p' * It is called by CM.Main.ReplaceTooltips() */ CM.Main.ReplaceTooltipGarden = function() { if (Game.Objects['Farm'].minigameLoaded) { - CM.Main.TooltipGardenBackup = []; - for (var i in Game.Objects['Farm'].minigame.plot) { - for (var j in i) { - //console.log(j, i) - } - } + Array.from(l('gardenPlot').children).forEach((child, index) => { + var coords = child.id.slice(-3,); + child.onmouseover = function() {Game.tooltip.dynamic=1; Game.tooltip.draw(this, function() {return CM.Disp.Tooltip('p', [`${coords[0]}`,`${coords[2]}`]);}, 'this'); Game.tooltip.wobble();}; + }); } }; From a9dfcaab751bea7ff9f6f6ae0d4581823102038c Mon Sep 17 00:00:00 2001 From: Daniel van Noord Date: Tue, 26 Jan 2021 22:18:21 +0100 Subject: [PATCH 4/8] Tooltip with curr/max reward for plants #183 --- CookieMonster.js | 22 ++++++++++++++++++++++ src/Disp.js | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/CookieMonster.js b/CookieMonster.js index bd905c3..0ef00f2 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -2790,6 +2790,28 @@ CM.Disp.UpdateTooltipGrimoire = function() { */ CM.Disp.UpdateTooltipGardenPlots = function() { var minigame = Game.Objects['Farm'].minigame; + if (minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] != 0) { + var mature = minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][1] > minigame.plantsById[minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] - 1].matureBase; + var plantName = minigame.plantsById[minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] - 1].name; + l('CMTooltipBorder').appendChild(CM.Disp.TooltipCreateHeader('Reward (Current / Maximum)')); + var reward = document.createElement('div'); + reward.id = 'CMTooltipPlantReward'; + l('CMTooltipBorder').appendChild(reward); + if (plantName == "Bakeberry") { + l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 30); + } + else if (plantName == "Chocoroot" || plantName == "White chocoroot") { + l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 3); + } + else if (plantName == "Queenbeet") { + l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 60); + } + else if (plantName == "Duketater") { + l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 120); + } + else l('CMTooltipArea').style.display = "none"; + } + else l('CMTooltipArea').style.display = "none"; } /** diff --git a/src/Disp.js b/src/Disp.js index e96b144..91c757c 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -1607,6 +1607,28 @@ CM.Disp.UpdateTooltipGrimoire = function() { */ CM.Disp.UpdateTooltipGardenPlots = function() { var minigame = Game.Objects['Farm'].minigame; + if (minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] != 0) { + var mature = minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][1] > minigame.plantsById[minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] - 1].matureBase; + var plantName = minigame.plantsById[minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] - 1].name; + l('CMTooltipBorder').appendChild(CM.Disp.TooltipCreateHeader('Reward (Current / Maximum)')); + var reward = document.createElement('div'); + reward.id = 'CMTooltipPlantReward'; + l('CMTooltipBorder').appendChild(reward); + if (plantName == "Bakeberry") { + l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 30); + } + else if (plantName == "Chocoroot" || plantName == "White chocoroot") { + l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 3); + } + else if (plantName == "Queenbeet") { + l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 60); + } + else if (plantName == "Duketater") { + l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 120); + } + else l('CMTooltipArea').style.display = "none"; + } + else l('CMTooltipArea').style.display = "none"; } /** From ffa664c4762d3d9f4b21b266b390eb3c24fb27ae Mon Sep 17 00:00:00 2001 From: Daniel van Noord Date: Tue, 26 Jan 2021 22:21:17 +0100 Subject: [PATCH 5/8] Added option foor plot tooltip --- CookieMonster.js | 44 ++++++++++++++++++++++++-------------------- src/Data.js | 2 ++ src/Disp.js | 42 ++++++++++++++++++++++-------------------- 3 files changed, 48 insertions(+), 40 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 0ef00f2..bc24ec1 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -1075,6 +1075,7 @@ CM.ConfigData.ToolWarnPos = {type: 'bool', group: 'Tooltip', label: ['Tooltip Wa CM.ConfigData.TooltipGrim = {type: 'bool', group: 'Tooltip', label: ['Grimoire Tooltip Information OFF', 'Grimoire Tooltip Information ON'], desc: 'Extra information in tooltip for grimoire', toggle: true}; CM.ConfigData.ToolWrink = {type: 'bool', group: 'Tooltip', label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it', toggle: true}; CM.ConfigData.TooltipLump = {type: 'bool', group: 'Tooltip', label: ['Sugar Lump Tooltip OFF', 'Sugar Lump Tooltip ON'], desc: 'Shows the current Sugar Lump type in Sugar lump tooltip.', toggle: true}; +CM.ConfigData.TooltipPlots = {type: 'bool', group: 'Tooltip', label: ['Garden Plots Tooltip OFF', 'Garden Plots Tooltip ON'], desc: 'Shows a tooltip for plants that have a cookie reward.', toggle: true}; CM.ConfigData.DragonAuraInfo = {type: 'bool', group: 'Tooltip', label: ['Extra Dragon Aura Info OFF', 'Extra Dragon Aura Info ON'], desc: 'Shows information about changes in CPS and costs in the dragon aura interface.', toggle: true}; // Statistics @@ -1161,6 +1162,7 @@ CM.Data.ConfigDefault = { TooltipGrim:1, ToolWrink: 1, TooltipLump: 1, + TooltipPlots: 1, DragonAuraInfo: 1, Stats: 1, MissingUpgrades: 1, @@ -2789,27 +2791,29 @@ CM.Disp.UpdateTooltipGrimoire = function() { * It adds to the additional information to l('CMTooltipArea') */ CM.Disp.UpdateTooltipGardenPlots = function() { - var minigame = Game.Objects['Farm'].minigame; - if (minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] != 0) { - var mature = minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][1] > minigame.plantsById[minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] - 1].matureBase; - var plantName = minigame.plantsById[minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] - 1].name; - l('CMTooltipBorder').appendChild(CM.Disp.TooltipCreateHeader('Reward (Current / Maximum)')); - var reward = document.createElement('div'); - reward.id = 'CMTooltipPlantReward'; - l('CMTooltipBorder').appendChild(reward); - if (plantName == "Bakeberry") { - l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 30); - } - else if (plantName == "Chocoroot" || plantName == "White chocoroot") { - l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 3); + if (CM.Options.TooltipLump) { + var minigame = Game.Objects['Farm'].minigame; + if (minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] != 0) { + var mature = minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][1] > minigame.plantsById[minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] - 1].matureBase; + var plantName = minigame.plantsById[minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] - 1].name; + l('CMTooltipBorder').appendChild(CM.Disp.TooltipCreateHeader('Reward (Current / Maximum)')); + var reward = document.createElement('div'); + reward.id = 'CMTooltipPlantReward'; + l('CMTooltipBorder').appendChild(reward); + if (plantName == "Bakeberry") { + l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 30); + } + else if (plantName == "Chocoroot" || plantName == "White chocoroot") { + l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 3); + } + else if (plantName == "Queenbeet") { + l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 60); + } + else if (plantName == "Duketater") { + l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 120); + } + else l('CMTooltipArea').style.display = "none"; } - else if (plantName == "Queenbeet") { - l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 60); - } - else if (plantName == "Duketater") { - l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 120); - } - else l('CMTooltipArea').style.display = "none"; } else l('CMTooltipArea').style.display = "none"; } diff --git a/src/Data.js b/src/Data.js index 63dc624..7aa4ae2 100644 --- a/src/Data.js +++ b/src/Data.js @@ -191,6 +191,7 @@ CM.ConfigData.ToolWarnPos = {type: 'bool', group: 'Tooltip', label: ['Tooltip Wa CM.ConfigData.TooltipGrim = {type: 'bool', group: 'Tooltip', label: ['Grimoire Tooltip Information OFF', 'Grimoire Tooltip Information ON'], desc: 'Extra information in tooltip for grimoire', toggle: true}; CM.ConfigData.ToolWrink = {type: 'bool', group: 'Tooltip', label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it', toggle: true}; CM.ConfigData.TooltipLump = {type: 'bool', group: 'Tooltip', label: ['Sugar Lump Tooltip OFF', 'Sugar Lump Tooltip ON'], desc: 'Shows the current Sugar Lump type in Sugar lump tooltip.', toggle: true}; +CM.ConfigData.TooltipPlots = {type: 'bool', group: 'Tooltip', label: ['Garden Plots Tooltip OFF', 'Garden Plots Tooltip ON'], desc: 'Shows a tooltip for plants that have a cookie reward.', toggle: true}; CM.ConfigData.DragonAuraInfo = {type: 'bool', group: 'Tooltip', label: ['Extra Dragon Aura Info OFF', 'Extra Dragon Aura Info ON'], desc: 'Shows information about changes in CPS and costs in the dragon aura interface.', toggle: true}; // Statistics @@ -277,6 +278,7 @@ CM.Data.ConfigDefault = { TooltipGrim:1, ToolWrink: 1, TooltipLump: 1, + TooltipPlots: 1, DragonAuraInfo: 1, Stats: 1, MissingUpgrades: 1, diff --git a/src/Disp.js b/src/Disp.js index 91c757c..dd5d21d 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -1606,27 +1606,29 @@ CM.Disp.UpdateTooltipGrimoire = function() { * It adds to the additional information to l('CMTooltipArea') */ CM.Disp.UpdateTooltipGardenPlots = function() { - var minigame = Game.Objects['Farm'].minigame; - if (minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] != 0) { - var mature = minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][1] > minigame.plantsById[minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] - 1].matureBase; - var plantName = minigame.plantsById[minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] - 1].name; - l('CMTooltipBorder').appendChild(CM.Disp.TooltipCreateHeader('Reward (Current / Maximum)')); - var reward = document.createElement('div'); - reward.id = 'CMTooltipPlantReward'; - l('CMTooltipBorder').appendChild(reward); - if (plantName == "Bakeberry") { - l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 30); - } - else if (plantName == "Chocoroot" || plantName == "White chocoroot") { - l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 3); + if (CM.Options.TooltipLump) { + var minigame = Game.Objects['Farm'].minigame; + if (minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] != 0) { + var mature = minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][1] > minigame.plantsById[minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] - 1].matureBase; + var plantName = minigame.plantsById[minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] - 1].name; + l('CMTooltipBorder').appendChild(CM.Disp.TooltipCreateHeader('Reward (Current / Maximum)')); + var reward = document.createElement('div'); + reward.id = 'CMTooltipPlantReward'; + l('CMTooltipBorder').appendChild(reward); + if (plantName == "Bakeberry") { + l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 30)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 30); + } + else if (plantName == "Chocoroot" || plantName == "White chocoroot") { + l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.03, Game.cookiesPs * 60 * 3)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 3); + } + else if (plantName == "Queenbeet") { + l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 60); + } + else if (plantName == "Duketater") { + l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 120); + } + else l('CMTooltipArea').style.display = "none"; } - else if (plantName == "Queenbeet") { - l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.04, Game.cookiesPs * 60 * 60)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 60); - } - else if (plantName == "Duketater") { - l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 120); - } - else l('CMTooltipArea').style.display = "none"; } else l('CMTooltipArea').style.display = "none"; } From 52cfd9ddc220b5cfd8b4d52daa439d88620fb390 Mon Sep 17 00:00:00 2001 From: Daniel van Noord Date: Tue, 26 Jan 2021 22:22:32 +0100 Subject: [PATCH 6/8] Renamed ToolWrink to TooltipWrink --- CookieMonster.js | 8 ++++---- src/Data.js | 4 ++-- src/Disp.js | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index bc24ec1..d9c15ff 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -1073,7 +1073,7 @@ CM.ConfigData.ToolWarnConjureFrenzy = {type: 'bool', group: 'Tooltip', label: [' CM.ConfigData.ToolWarnEdifice = {type: 'bool', group: 'Tooltip', label: ['Tooltip Edifice Warning OFF', 'Tooltip Edifice Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for "Spontaneous Edifice" to possibly give you your most expensive building', toggle: true}; CM.ConfigData.ToolWarnPos = {type: 'bool', group: 'Tooltip', label: ['Tooltip Warning Position (Left)', 'Tooltip Warning Position (Bottom)'], desc: 'Placement of the warning boxes', toggle: false, func: function() {CM.Disp.ToggleToolWarnPos();}}; CM.ConfigData.TooltipGrim = {type: 'bool', group: 'Tooltip', label: ['Grimoire Tooltip Information OFF', 'Grimoire Tooltip Information ON'], desc: 'Extra information in tooltip for grimoire', toggle: true}; -CM.ConfigData.ToolWrink = {type: 'bool', group: 'Tooltip', label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it', toggle: true}; +CM.ConfigData.TooltipWrink = {type: 'bool', group: 'Tooltip', label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it', toggle: true}; CM.ConfigData.TooltipLump = {type: 'bool', group: 'Tooltip', label: ['Sugar Lump Tooltip OFF', 'Sugar Lump Tooltip ON'], desc: 'Shows the current Sugar Lump type in Sugar lump tooltip.', toggle: true}; CM.ConfigData.TooltipPlots = {type: 'bool', group: 'Tooltip', label: ['Garden Plots Tooltip OFF', 'Garden Plots Tooltip ON'], desc: 'Shows a tooltip for plants that have a cookie reward.', toggle: true}; CM.ConfigData.DragonAuraInfo = {type: 'bool', group: 'Tooltip', label: ['Extra Dragon Aura Info OFF', 'Extra Dragon Aura Info ON'], desc: 'Shows information about changes in CPS and costs in the dragon aura interface.', toggle: true}; @@ -1160,7 +1160,7 @@ CM.Data.ConfigDefault = { ToolWarnEdifice: 1, ToolWarnPos: 1, TooltipGrim:1, - ToolWrink: 1, + TooltipWrink: 1, TooltipLump: 1, TooltipPlots: 1, DragonAuraInfo: 1, @@ -2937,7 +2937,7 @@ CM.Disp.ToggleToolWarnPos = function() { * TODO: Change this code to be the same as other tooltips. (i.d., create tooltip with type "w") */ CM.Disp.CheckWrinklerTooltip = function() { - if (CM.Options.ToolWrink == 1 && CM.Disp.TooltipWrinklerArea == 1) { // Latter is set by CM.Main.AddWrinklerAreaDetect + if (CM.Options.TooltipWrink == 1 && CM.Disp.TooltipWrinklerArea == 1) { // Latter is set by CM.Main.AddWrinklerAreaDetect var showingTooltip = false; for (var i in Game.wrinklers) { var me = Game.wrinklers[i]; @@ -2975,7 +2975,7 @@ CM.Disp.CheckWrinklerTooltip = function() { * TODO: Change this code to be the same as other tooltips. Fit this into CM.Disp.UpdateTooltip() */ CM.Disp.UpdateWrinklerTooltip = function() { - if (CM.Options.ToolWrink == 1 && l('CMTooltipWrinkler') != null) { + if (CM.Options.TooltipWrink == 1 && l('CMTooltipWrinkler') != null) { var sucked = Game.wrinklers[CM.Disp.TooltipWrinkler].sucked; var toSuck = 1.1; if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05; diff --git a/src/Data.js b/src/Data.js index 7aa4ae2..13d9d22 100644 --- a/src/Data.js +++ b/src/Data.js @@ -189,7 +189,7 @@ CM.ConfigData.ToolWarnConjureFrenzy = {type: 'bool', group: 'Tooltip', label: [' CM.ConfigData.ToolWarnEdifice = {type: 'bool', group: 'Tooltip', label: ['Tooltip Edifice Warning OFF', 'Tooltip Edifice Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for "Spontaneous Edifice" to possibly give you your most expensive building', toggle: true}; CM.ConfigData.ToolWarnPos = {type: 'bool', group: 'Tooltip', label: ['Tooltip Warning Position (Left)', 'Tooltip Warning Position (Bottom)'], desc: 'Placement of the warning boxes', toggle: false, func: function() {CM.Disp.ToggleToolWarnPos();}}; CM.ConfigData.TooltipGrim = {type: 'bool', group: 'Tooltip', label: ['Grimoire Tooltip Information OFF', 'Grimoire Tooltip Information ON'], desc: 'Extra information in tooltip for grimoire', toggle: true}; -CM.ConfigData.ToolWrink = {type: 'bool', group: 'Tooltip', label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it', toggle: true}; +CM.ConfigData.TooltipWrink = {type: 'bool', group: 'Tooltip', label: ['Wrinkler Tooltip OFF', 'Wrinkler Tooltip ON'], desc: 'Shows the amount of cookies a wrinkler will give when popping it', toggle: true}; CM.ConfigData.TooltipLump = {type: 'bool', group: 'Tooltip', label: ['Sugar Lump Tooltip OFF', 'Sugar Lump Tooltip ON'], desc: 'Shows the current Sugar Lump type in Sugar lump tooltip.', toggle: true}; CM.ConfigData.TooltipPlots = {type: 'bool', group: 'Tooltip', label: ['Garden Plots Tooltip OFF', 'Garden Plots Tooltip ON'], desc: 'Shows a tooltip for plants that have a cookie reward.', toggle: true}; CM.ConfigData.DragonAuraInfo = {type: 'bool', group: 'Tooltip', label: ['Extra Dragon Aura Info OFF', 'Extra Dragon Aura Info ON'], desc: 'Shows information about changes in CPS and costs in the dragon aura interface.', toggle: true}; @@ -276,7 +276,7 @@ CM.Data.ConfigDefault = { ToolWarnEdifice: 1, ToolWarnPos: 1, TooltipGrim:1, - ToolWrink: 1, + TooltipWrink: 1, TooltipLump: 1, TooltipPlots: 1, DragonAuraInfo: 1, diff --git a/src/Disp.js b/src/Disp.js index dd5d21d..dc0b6a0 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -1752,7 +1752,7 @@ CM.Disp.ToggleToolWarnPos = function() { * TODO: Change this code to be the same as other tooltips. (i.d., create tooltip with type "w") */ CM.Disp.CheckWrinklerTooltip = function() { - if (CM.Options.ToolWrink == 1 && CM.Disp.TooltipWrinklerArea == 1) { // Latter is set by CM.Main.AddWrinklerAreaDetect + if (CM.Options.TooltipWrink == 1 && CM.Disp.TooltipWrinklerArea == 1) { // Latter is set by CM.Main.AddWrinklerAreaDetect var showingTooltip = false; for (var i in Game.wrinklers) { var me = Game.wrinklers[i]; @@ -1790,7 +1790,7 @@ CM.Disp.CheckWrinklerTooltip = function() { * TODO: Change this code to be the same as other tooltips. Fit this into CM.Disp.UpdateTooltip() */ CM.Disp.UpdateWrinklerTooltip = function() { - if (CM.Options.ToolWrink == 1 && l('CMTooltipWrinkler') != null) { + if (CM.Options.TooltipWrink == 1 && l('CMTooltipWrinkler') != null) { var sucked = Game.wrinklers[CM.Disp.TooltipWrinkler].sucked; var toSuck = 1.1; if (Game.Has('Sacrilegious corruption')) toSuck *= 1.05; From 80e3ac746a7f13c4e6e4fa717844e849f7d9e10e Mon Sep 17 00:00:00 2001 From: Daniel van Noord Date: Tue, 26 Jan 2021 22:26:46 +0100 Subject: [PATCH 7/8] Fixed CM.Options.TooltipBuildUpgrade #523 --- CookieMonster.js | 17 +++++++++-------- src/Data.js | 4 ++-- src/Disp.js | 13 +++++++------ 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index d9c15ff..09212f3 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -1064,7 +1064,7 @@ CM.ConfigData.WrinklerMaxSoundURL = {type: 'url', group: 'NotificationWrinkMax', CM.ConfigData.Title = {type: 'bool', group: 'Notification', label: ['Title OFF', 'Title ON', 'Title Pinned Tab Highlight'], desc: 'Update title with Golden Cookie/Season Popup timers; pinned tab highlight only changes the title when a Golden Cookie/Season Popup spawns', toggle: true}; // Tooltip -CM.ConfigData.TooltipInfo = {type: 'bool', group: 'Tooltip', label: ['Extra Tooltip Information OFF', 'Extra Tooltip Information ON'], desc: 'Extra information in tooltips', toggle: true}; +CM.ConfigData.TooltipBuildUpgrade = {type: 'bool', group: 'Tooltip', label: ['Extra Tooltip Information OFF', 'Extra Tooltip Information ON'], desc: 'Extra information in tooltips', toggle: true}; CM.ConfigData.TooltipAmor = {type: 'bool', group: 'Tooltip', label: ['Buildings Tooltip Amortization Information OFF', 'Buildings Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true}; CM.ConfigData.ToolWarnLucky = {type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Warning OFF', 'Tooltip Lucky Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards', toggle: true}; CM.ConfigData.ToolWarnLuckyFrenzy = {type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Frenzy Warning OFF', 'Tooltip Lucky Frenzy Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards', toggle: true}; @@ -1151,7 +1151,7 @@ CM.Data.ConfigDefault = { WrinklerMaxVolume: 100, WrinklerMaxSoundURL: 'https://freesound.org/data/previews/152/152743_15663-lq.mp3', Title: 1, - TooltipInfo: 1, + TooltipBuildUpgrade: 1, TooltipAmor: 0, ToolWarnLucky: 1, ToolWarnLuckyFrenzy: 1, @@ -2567,9 +2567,6 @@ CM.Disp.TooltipCreateWarningSection = function() { CM.Disp.UpdateTooltip = function() { CM.Sim.CopyData(); if (l('tooltipAnchor').style.display != 'none' && l('CMTooltipArea')) { - if (CM.Options.TooltipInfo == 0) { - l('CMTooltipArea').style.display = "none"; - } l('CMTooltipArea').innerHTML = ''; tooltipBox = CM.Disp.TooltipCreateTooltipBox(); l('CMTooltipArea').appendChild(tooltipBox); @@ -2603,7 +2600,7 @@ CM.Disp.UpdateTooltip = function() { * It is called when Building tooltips are created or refreshed by CM.Disp.UpdateTooltip() */ CM.Disp.UpdateTooltipBuilding = function() { - if (CM.Options.TooltipInfo == 1 && Game.buyMode == 1) { + if (CM.Options.TooltipBuildUpgrade == 1 && Game.buyMode == 1) { tooltipBox = l('CMTooltipBorder'); CM.Disp.TooltipCreateCalculationSection(tooltipBox); @@ -2618,7 +2615,7 @@ CM.Disp.UpdateTooltipBuilding = function() { CM.Disp.TooltipBonusIncome = CM.Cache[target][CM.Disp.tooltipName].bonus; - if (CM.Options.TooltipInfo == 1 && Game.buyMode == 1) { + if (CM.Options.TooltipBuildUpgrade == 1 && Game.buyMode == 1) { l('CMTooltipIncome').textContent = Beautify(CM.Disp.TooltipBonusIncome, 2); var increase = Math.round(CM.Disp.TooltipBonusIncome / Game.cookiesPs * 10000); if (isFinite(increase) && increase != 0) { @@ -2654,6 +2651,7 @@ CM.Disp.UpdateTooltipBuilding = function() { l('CMTooltipTime').style.marginBottom = '0px'; } } + else l('CMTooltipArea').style.display = "none"; } /** @@ -2668,7 +2666,7 @@ CM.Disp.UpdateTooltipUpgrade = function() { CM.Disp.TooltipPrice = Game.Upgrades[Game.UpgradesInStore[CM.Disp.tooltipName].name].getPrice(); CM.Disp.TooltipBonusMouse = CM.Cache.Upgrades[Game.UpgradesInStore[CM.Disp.tooltipName].name].bonusMouse - if (CM.Options.TooltipInfo == 1) { + if (CM.Options.TooltipBuildUpgrade == 1) { l('CMTooltipIncome').textContent = Beautify(CM.Disp.TooltipBonusIncome, 2); var increase = Math.round(CM.Disp.TooltipBonusIncome / Game.cookiesPs * 10000); if (isFinite(increase) && increase != 0) { @@ -2708,6 +2706,7 @@ CM.Disp.UpdateTooltipUpgrade = function() { l('CMTooltipBorder').appendChild(chocolate); } } + else l('CMTooltipArea').style.display = "none"; } /** @@ -2728,6 +2727,7 @@ CM.Disp.UpdateTooltipSugarLump = function() { lumpType.textContent = lumpColor.text; lumpType.className = CM.Disp.colorTextPre + lumpColor.color; } + else l('CMTooltipArea').style.display = "none"; } /** @@ -2783,6 +2783,7 @@ CM.Disp.UpdateTooltipGrimoire = function() { l('CMTooltipArea').appendChild(tooltipBox); } + else l('CMTooltipArea').style.display = "none"; } /** diff --git a/src/Data.js b/src/Data.js index 13d9d22..e481133 100644 --- a/src/Data.js +++ b/src/Data.js @@ -180,7 +180,7 @@ CM.ConfigData.WrinklerMaxSoundURL = {type: 'url', group: 'NotificationWrinkMax', CM.ConfigData.Title = {type: 'bool', group: 'Notification', label: ['Title OFF', 'Title ON', 'Title Pinned Tab Highlight'], desc: 'Update title with Golden Cookie/Season Popup timers; pinned tab highlight only changes the title when a Golden Cookie/Season Popup spawns', toggle: true}; // Tooltip -CM.ConfigData.TooltipInfo = {type: 'bool', group: 'Tooltip', label: ['Extra Tooltip Information OFF', 'Extra Tooltip Information ON'], desc: 'Extra information in tooltips', toggle: true}; +CM.ConfigData.TooltipBuildUpgrade = {type: 'bool', group: 'Tooltip', label: ['Building/Upgrade Tooltip Information OFF', 'Building/Upgrade Tooltip Information ON'], desc: 'Extra information in Building/Upgrade tooltips', toggle: true}; CM.ConfigData.TooltipAmor = {type: 'bool', group: 'Tooltip', label: ['Buildings Tooltip Amortization Information OFF', 'Buildings Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true}; CM.ConfigData.ToolWarnLucky = {type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Warning OFF', 'Tooltip Lucky Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards', toggle: true}; CM.ConfigData.ToolWarnLuckyFrenzy = {type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Frenzy Warning OFF', 'Tooltip Lucky Frenzy Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards', toggle: true}; @@ -267,7 +267,7 @@ CM.Data.ConfigDefault = { WrinklerMaxVolume: 100, WrinklerMaxSoundURL: 'https://freesound.org/data/previews/152/152743_15663-lq.mp3', Title: 1, - TooltipInfo: 1, + TooltipBuildUpgrade: 1, TooltipAmor: 0, ToolWarnLucky: 1, ToolWarnLuckyFrenzy: 1, diff --git a/src/Disp.js b/src/Disp.js index dc0b6a0..b424616 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -1382,9 +1382,6 @@ CM.Disp.TooltipCreateWarningSection = function() { CM.Disp.UpdateTooltip = function() { CM.Sim.CopyData(); if (l('tooltipAnchor').style.display != 'none' && l('CMTooltipArea')) { - if (CM.Options.TooltipInfo == 0) { - l('CMTooltipArea').style.display = "none"; - } l('CMTooltipArea').innerHTML = ''; tooltipBox = CM.Disp.TooltipCreateTooltipBox(); l('CMTooltipArea').appendChild(tooltipBox); @@ -1418,7 +1415,7 @@ CM.Disp.UpdateTooltip = function() { * It is called when Building tooltips are created or refreshed by CM.Disp.UpdateTooltip() */ CM.Disp.UpdateTooltipBuilding = function() { - if (CM.Options.TooltipInfo == 1 && Game.buyMode == 1) { + if (CM.Options.TooltipBuildUpgrade == 1 && Game.buyMode == 1) { tooltipBox = l('CMTooltipBorder'); CM.Disp.TooltipCreateCalculationSection(tooltipBox); @@ -1433,7 +1430,7 @@ CM.Disp.UpdateTooltipBuilding = function() { CM.Disp.TooltipBonusIncome = CM.Cache[target][CM.Disp.tooltipName].bonus; - if (CM.Options.TooltipInfo == 1 && Game.buyMode == 1) { + if (CM.Options.TooltipBuildUpgrade == 1 && Game.buyMode == 1) { l('CMTooltipIncome').textContent = Beautify(CM.Disp.TooltipBonusIncome, 2); var increase = Math.round(CM.Disp.TooltipBonusIncome / Game.cookiesPs * 10000); if (isFinite(increase) && increase != 0) { @@ -1469,6 +1466,7 @@ CM.Disp.UpdateTooltipBuilding = function() { l('CMTooltipTime').style.marginBottom = '0px'; } } + else l('CMTooltipArea').style.display = "none"; } /** @@ -1483,7 +1481,7 @@ CM.Disp.UpdateTooltipUpgrade = function() { CM.Disp.TooltipPrice = Game.Upgrades[Game.UpgradesInStore[CM.Disp.tooltipName].name].getPrice(); CM.Disp.TooltipBonusMouse = CM.Cache.Upgrades[Game.UpgradesInStore[CM.Disp.tooltipName].name].bonusMouse - if (CM.Options.TooltipInfo == 1) { + if (CM.Options.TooltipBuildUpgrade == 1) { l('CMTooltipIncome').textContent = Beautify(CM.Disp.TooltipBonusIncome, 2); var increase = Math.round(CM.Disp.TooltipBonusIncome / Game.cookiesPs * 10000); if (isFinite(increase) && increase != 0) { @@ -1523,6 +1521,7 @@ CM.Disp.UpdateTooltipUpgrade = function() { l('CMTooltipBorder').appendChild(chocolate); } } + else l('CMTooltipArea').style.display = "none"; } /** @@ -1543,6 +1542,7 @@ CM.Disp.UpdateTooltipSugarLump = function() { lumpType.textContent = lumpColor.text; lumpType.className = CM.Disp.colorTextPre + lumpColor.color; } + else l('CMTooltipArea').style.display = "none"; } /** @@ -1598,6 +1598,7 @@ CM.Disp.UpdateTooltipGrimoire = function() { l('CMTooltipArea').appendChild(tooltipBox); } + else l('CMTooltipArea').style.display = "none"; } /** From 45c3df2d4be75cd8b5e29eff6f599d022289169b Mon Sep 17 00:00:00 2001 From: Daniel van Noord Date: Tue, 26 Jan 2021 22:30:27 +0100 Subject: [PATCH 8/8] Fixed plant tooltips --- CookieMonster.js | 8 +++----- src/Disp.js | 6 ++---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/CookieMonster.js b/CookieMonster.js index 09212f3..0ec298e 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -1064,7 +1064,7 @@ CM.ConfigData.WrinklerMaxSoundURL = {type: 'url', group: 'NotificationWrinkMax', CM.ConfigData.Title = {type: 'bool', group: 'Notification', label: ['Title OFF', 'Title ON', 'Title Pinned Tab Highlight'], desc: 'Update title with Golden Cookie/Season Popup timers; pinned tab highlight only changes the title when a Golden Cookie/Season Popup spawns', toggle: true}; // Tooltip -CM.ConfigData.TooltipBuildUpgrade = {type: 'bool', group: 'Tooltip', label: ['Extra Tooltip Information OFF', 'Extra Tooltip Information ON'], desc: 'Extra information in tooltips', toggle: true}; +CM.ConfigData.TooltipBuildUpgrade = {type: 'bool', group: 'Tooltip', label: ['Building/Upgrade Tooltip Information OFF', 'Building/Upgrade Tooltip Information ON'], desc: 'Extra information in Building/Upgrade tooltips', toggle: true}; CM.ConfigData.TooltipAmor = {type: 'bool', group: 'Tooltip', label: ['Buildings Tooltip Amortization Information OFF', 'Buildings Tooltip Amortization Information ON'], desc: 'Add amortization information to buildings tooltip', toggle: true}; CM.ConfigData.ToolWarnLucky = {type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Warning OFF', 'Tooltip Lucky Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" rewards', toggle: true}; CM.ConfigData.ToolWarnLuckyFrenzy = {type: 'bool', group: 'Tooltip', label: ['Tooltip Lucky Frenzy Warning OFF', 'Tooltip Lucky Frenzy Warning ON'], desc: 'A warning when buying if it will put the bank under the amount needed for max "Lucky!" (Frenzy) rewards', toggle: true}; @@ -2792,9 +2792,8 @@ CM.Disp.UpdateTooltipGrimoire = function() { * It adds to the additional information to l('CMTooltipArea') */ CM.Disp.UpdateTooltipGardenPlots = function() { - if (CM.Options.TooltipLump) { - var minigame = Game.Objects['Farm'].minigame; - if (minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] != 0) { + var minigame = Game.Objects['Farm'].minigame; + if (CM.Options.TooltipLump && minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] != 0) { var mature = minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][1] > minigame.plantsById[minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] - 1].matureBase; var plantName = minigame.plantsById[minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] - 1].name; l('CMTooltipBorder').appendChild(CM.Disp.TooltipCreateHeader('Reward (Current / Maximum)')); @@ -2814,7 +2813,6 @@ CM.Disp.UpdateTooltipGardenPlots = function() { l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 120); } else l('CMTooltipArea').style.display = "none"; - } } else l('CMTooltipArea').style.display = "none"; } diff --git a/src/Disp.js b/src/Disp.js index b424616..019439a 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -1607,9 +1607,8 @@ CM.Disp.UpdateTooltipGrimoire = function() { * It adds to the additional information to l('CMTooltipArea') */ CM.Disp.UpdateTooltipGardenPlots = function() { - if (CM.Options.TooltipLump) { - var minigame = Game.Objects['Farm'].minigame; - if (minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] != 0) { + var minigame = Game.Objects['Farm'].minigame; + if (CM.Options.TooltipLump && minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] != 0) { var mature = minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][1] > minigame.plantsById[minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] - 1].matureBase; var plantName = minigame.plantsById[minigame.plot[CM.Disp.tooltipName[1]][CM.Disp.tooltipName[0]][0] - 1].name; l('CMTooltipBorder').appendChild(CM.Disp.TooltipCreateHeader('Reward (Current / Maximum)')); @@ -1629,7 +1628,6 @@ CM.Disp.UpdateTooltipGardenPlots = function() { l('CMTooltipPlantReward').textContent = (mature ? CM.Disp.Beautify(Math.min(Game.cookies * 0.08, Game.cookiesPs * 60 * 120)) : "0") + " / " + CM.Disp.Beautify(Game.cookiesPs * 60 * 120); } else l('CMTooltipArea').style.display = "none"; - } } else l('CMTooltipArea').style.display = "none"; }