PetTracker addon overlapping tooltip text for AH / Caged pets

I’m having issues with pet tooltips having overlapping text making some of them (especially ones with multiple sources like the covenant feature pets) absolutely unreadable. I’ve tracked it down and it seems to be an issue with PetTracker.

Unfortunately, this issue has been reported multiple times on their own GitHub page dating back to at least May 2020 - over two years ago.

The addon itself has been updated multiple times since then, with the most recent being in April 2022. Comments are disabled on the curseforge page so I can’t ask there, and the github posts have no acknowledgement by the owner/creator.

I’m not a dev, but I’ve edited some addons minimally in the past to tweak little settings here and there, but looking at the PetTracker folders…I can’t even begin to figure out which one would even have the file responsible for tooltips on caged/AH pets.

Anyone have any idea how to possibly fix this?

PetTracker appears to be using an old method of adding text to the battle pet tooltip.

imho a better approach than creating a fontstring and setting a height is to use the Blizzard-provided BattlePetTooltipTemplate_AddTextLine.

I can’t guarantee this will work (especially if other addons are doing that), but in PetTracker/main/features/tooltip, try replacing the Tooltips:Init() function with this:

function Tooltips:Init(tip)
  tip.Source = true
  hooksecurefunc("BattlePetToolTip_Show",function(speciesID)
    if type(speciesID)=="number" then
      local data = self.Data[tip]
      local specie = Addon.Specie(data.speciesID)
      local breed = Addon.Predict:Breed(data.speciesID, data.level, data.breedQuality + 1, data.maxHealth, data.power, data.speed)
      tip.Owned:SetText(specie:GetOwnedText() or tip.Owned:GetText())
      tip.Name:SetText((tip.Name:GetText() or '') .. Addon.Breeds:Icon(breed, .8, 5,0))      
      local text = select(5,C_PetJournal.GetPetInfoBySpeciesID(speciesID))
      if text and text:len()>0 then
        BattlePetTooltipTemplate_AddTextLine(tip, "\n"..text, 1,1,1,true)
      end
    end
  end)
end

edit: after some testing there’s some cases where the parent frame isn’t quite tall enough due to the god-awful breed icons. Text should be readable (or maybe not! I don’t use PetTracker except for testing, so don’t run into this issue) but you can comment out the tip.Owner:SetText() and tip.Name:SetText() to make it not overrun the bottom. Though you’ll lose the breed information so maybe the above is sufficient.)

3 Likes

Oh my gosh, thank you so much this seems to have worked perfectly!

I have a few other pet addons installed (I knew your name sounded familiar!!) and this seems to play nicely with all of them.