GameTooltip:OnTooltipSetUnit gone?

i used to hook into GameTooltip:OnTooltipSetUnit( ) to work out if it was a mouseover of a wild battlepet and then show an appropriate tooltip but this seems to have disappeared in dragonflight

hooking GameTooltip:SetUnit() still works but it only kicks in when you mouseover the player or target frames (maybe others as well but it seems frame bound now).

GameTooltip:SetCompanionPet() appears to only be valid from within the pet journal. not mouseover of your own summoned pet, or a wild battlepet.

anyone know what the new alternative for :OnTooltipSetUnit() is? or is it just gone?

All the tooltip stuff got reworked in 10.0.2

TooltipDataProcessor.AddTooltipPostCall(TooltipTypeEnums.Unit, YOUR_CALLBACK_FUNCTION)

ah yes, those. thanks. most of the events still work so wasnt forced to use it and forgot.

its a pity they arent all fleshed out (or im missing something again)

TooltipDataProcessor.AddTooltipPostCall( Enum.TooltipDataType.CompanionPet, myfunctionhere )

appears to not have any identifying information about the pet the tooltip is for. just type=9, no item, no spell, no hyperlink, nothing of any use.

Untested shot in the dark

TooltipDataProcessor.AddTooltipPostCall( Enum.TooltipDataType.CompanionPet, function(tooltip,data)
    if tooltip == GameTooltip then
        TooltipUtil.SurfaceArgs(data)
            for _, line in ipairs(data.lines) do
                TooltipUtil.SurfaceArgs(line)
            end
            print("Tooltip Type: ", data.type)
            print("Unit GUID: ", data.guid)

            DevTools_Dump({ data })
        end
    end
end)

yeah i do that for all of them, unfortunately its not there.

i skipped .lines as theres only ever line data in there, and all the args are in .args, which i did process with TooltipUtil.SurfaceArgs(data) but theres only the type value, no id, even if i manually check the .args table.

so far it seems to be the only one (that im using) that is missing an id of some sort, so potentially a bug.

1 Like