doadin / Baggins

zlib License
6 stars 7 forks source link

Tooltip filter does not work for items in the bank #110

Closed Elberet closed 4 months ago

Elberet commented 4 months ago

In WoW Cataclysm Classic, items in the bank, i.e. bag -1, never match any category based using the tooltip filter. This is because the API has changed, and GameTooltip:SetBagItem no longer works with the player's bank. Instead, GameTooltip:SetInventoryItem must be used to generate tooltip text for items in the main bank window.

I've patched Tooltip.lua to use the newer API and the filter now works as expected:

Old: https://github.com/doadin/Baggins/blob/27fe0801dd5c5bbd06a9458401861d3336c03b93/src/filters/Tooltip.lua#L66

New:

        if bag == -1 then
            local invId = BankButtonIDToInvSlotID(slot, false)
            tip:SetInventoryItem("player", invId)
        else
            tip:SetBagItem(bag, slot)
        end
doadin commented 4 months ago

thanks for this, change is being pushed out now!