Wait on ContinueOnItemLoad for inbox, panel and loot history items

The inbox package border now waits for the item to load, since another
player's item may not be cached. The panel and loot history drop their
cached branch: ContinueOnItemLoad runs at once for a cached item. The
swing timer reads the off-hand inventory type from the slot instead of
parsing the item link.
This commit is contained in:
Brues
2026-10-30 21:44:37 -05:00
parent bfe1864aa1
commit 1b71ee617f
4 changed files with 29 additions and 40 deletions
+12 -7
View File
@@ -63,14 +63,19 @@ pfUI:RegisterSkin("Mailbox", function ()
SkinButton(OpenMailPackageButton, nil, nil, nil, OpenMailPackageButtonIconTexture)
hooksecurefunc("InboxFrame_OnClick", function(index)
OpenMailPackageButton:SetBackdropBorderColor(GetStringColor(pfUI_config.appearance.border.color))
-- another player's item may not be cached yet
local _, itemID = GetInboxItemLink(index)
if itemID then
local quality = C_Item.GetItemQualityByID(itemID)
local r,g,b = GetItemQualityColor(quality)
OpenMailPackageButton:SetBackdropBorderColor(r,g,b,1)
else
OpenMailPackageButton:SetBackdropBorderColor(GetStringColor(pfUI_config.appearance.border.color))
end
if not itemID then return end
local item = Item:CreateFromItemID(itemID)
item:ContinueOnItemLoad(function()
local quality = item:GetItemQuality()
if quality and InboxFrame.openMailID == index then
local r,g,b = GetItemQualityColor(quality)
OpenMailPackageButton:SetBackdropBorderColor(r,g,b,1)
end
end)
end)
end