Tooltip doubles information and stays on screen
Painstormx opened this issue ยท 6 comments
Go to your Interface\AddOns\PokemonTrainer\Modules\WildPetTooltip.lua. Edit function module:ProcessTooltip():
function module:ProcessTooltip()
local name, unit = _G.GameTooltip:GetUnit();
local func = self.db.profile.onlywildpets and _G.UnitIsWildBattlePet or _G.UnitIsBattlePet;
if( not unit or not func(unit) ) then
return;
end
-- Remain unchaged above --
-- Add following codes to fix duplicated tooltip--
_G.GameTooltip:ClearLines();
_G.GameTooltip:SetUnit(unit);
-- Remain unchanged below --
local enemyType, enemyLevel = _G.UnitBattlePetType(unit), _G.UnitBattlePetLevel(unit)It just clears the tooltip before adding new content to avoid duplicated contents.
@JireRen Thanks for the fix, it did remove the double tooltip :)
Any idea how to fix the tooltip not fading after 1-2 second, like a normal mouseover tooltip?
The battle pet tooltip just stays up permanently until you mouse over something else.
PS! For anyone trying this fix, the code is not in the TooltipCombatDisplay.lua, it's in the WildPetTooltip.lua file.
Yeah I'm also annoyed the tooltip is not fading as the default ones. Try the following fix (this is what Claude told me ;p), it checks whether the tooltip has been modified or not by the addon. There are other more robust fix but guess we'll leave it to the author to decide.
function module:ProcessTooltip()
local name, unit = _G.GameTooltip:GetUnit();
local func = self.db.profile.onlywildpets and _G.UnitIsWildBattlePet or _G.UnitIsBattlePet;
if( not unit or not func(unit) ) then
return;
end
-- Remain unchanged above --
-- Add following codes to fix duplicated tooltip --
-- Checks if tooltip has already been modified by this addon --
local numLines = _G.GameTooltip:NumLines();
local battleLevelText = L["Battle Level"];
for i = 1, numLines do
local line = _G["GameTooltipTextLeft" .. i];
if line and line:GetText() and line:GetText():find(battleLevelText) then
-- Already processed, don't add again
return;
end
end
-- Remain unchanged below --
local enemyType, enemyLevel = _G.UnitBattlePetType(unit), _G.UnitBattlePetLevel(unit)Thank you - I'll see if I can get time to release an updated version with this fix soon ๐
