Closed filliph closed 1 year ago
Proof that the tooltip still works with this change:
Kinda weird that GameTooltip.SetBagItem
gets called when refreshing the inventory. I need to find a solution for the old method cause Wrath Classic and probably Classic also (if I want to support it) will use this one most likely. For DF indeed I need to use the proper reworked call.
Caused by calling SetBagItem
in https://www.townlong-yak.com/framexml/live/ContainerFrame.lua#1482
TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Item, ProcessItem100002);
does not easily provide bag and slot info needed for the item location now used for checking soulbound items.
The following code is working for 0.4a1:
function tooltip.Load()
if addon.IsDragonflightRetail then
TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Item, ProcessItem100002);
return;
else
hooksecurefunc(GameTooltip, "SetBagItem", function(self, bag, slot)
if addon.Options.db.Tooltip.ShowAutoSellRules then
ProcessItem(self, bag, slot);
end
end);
end
end
local function ProcessItem100002(tooltip, localData)
if localData.guid then
local itemLocation = C_Item.GetItemLocation(localData.guid);
if itemLocation and itemLocation:IsBagAndSlot() then
ProcessItem(tooltip, itemLocation.bagID, itemLocation.slotIndex);
end
end
-- if localData.guid then
-- local itemLink = C_Item.GetItemLinkByGUID(localData.guid);
-- end
-- for i, v in next, localData do
-- print(i, v)
-- end
end
The following test cases have been verified:
this should be fixed now in the latest dev
Due to the fact that you use the old method of hooking GameTooltip instead of the new Tooltip Processor, performing an operation such as selling all the blue items in my bags here:
->
Then sorting the inventory causes the game to lock up for approx. 45 seconds.
Yes, it's true that this wouldn't happen with only KV enabled, but literally no-one installing this add-on is going to use this as their only add-on.
You can restore the tooltip via this change:
I can confirm the freeze does not happen when using the above code, and the tooltip still works.