Create tooltip for wrinkler buttons #628

This commit is contained in:
Daniël van Noord
2021-03-15 12:51:25 +01:00
parent 71479a05e7
commit 9e9158ce81
7 changed files with 104 additions and 49 deletions

View File

@@ -1,5 +1,6 @@
import { CacheWrinklersFattest } from '../../Cache/VariablesAndData';
import PopAllNormalWrinklers from '../HelperFunctions/PopWrinklers';
import { CreateTooltip } from '../Tooltips/Tooltip';
/**
* This function creates two objects at the bottom of the left column that allowing popping of wrinklers
@@ -12,6 +13,20 @@ export default function CreateWrinklerButtons() {
popAllA.onclick = function () {
PopAllNormalWrinklers();
};
popAllA.onmouseout = function () {
Game.tooltip.shouldHide = 1;
};
popAllA.onmouseover = function () {
Game.tooltip.dynamic = 1;
Game.tooltip.draw(
this,
function () {
return CreateTooltip('wb', 'PopAll');
},
'this',
);
Game.tooltip.wobble();
};
l('sectionLeftExtra').children[0].append(popAllA);
const popFattestA = document.createElement('a');
popFattestA.id = 'PopFattestWrinklerButton';
@@ -21,5 +36,19 @@ export default function CreateWrinklerButtons() {
if (CacheWrinklersFattest[1] !== null)
Game.wrinklers[CacheWrinklersFattest[1]].hp = 0;
};
popFattestA.onmouseout = function () {
Game.tooltip.shouldHide = 1;
};
popFattestA.onmouseover = function () {
Game.tooltip.dynamic = 1;
Game.tooltip.draw(
this,
function () {
return CreateTooltip('wb', 'PopFattest');
},
'this',
);
Game.tooltip.wobble();
};
l('sectionLeftExtra').children[0].append(popFattestA);
}