mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-02 00:46:57 +00:00
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:
+12
-7
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user