Created (empty) tooltip for garden plots

This commit is contained in:
Daniel van Noord
2021-01-26 14:57:59 +01:00
parent ab08bc60e7
commit 23f19b4d62
3 changed files with 40 additions and 18 deletions

View File

@@ -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()