From c64f42bcfae1d74061c025c8fda446dac186151b Mon Sep 17 00:00:00 2001 From: Daniel van Noord Date: Sat, 23 Jan 2021 22:55:39 +0100 Subject: [PATCH] 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