diff --git a/modules/bags.lua b/modules/bags.lua index ebb9a9e7..b6afdd6e 100644 --- a/modules/bags.lua +++ b/modules/bags.lua @@ -492,6 +492,11 @@ pfUI:RegisterModule("bags", "vanilla:tbc", function () end end + -- update red color on unusable items + if pfUI.unusable then + pfUI.unusable:UpdateSlot(bag, slot) + end + pfUI.bags[bag].slots[slot].frame:Show() end diff --git a/modules/unusable.lua b/modules/unusable.lua index bf532076..764476db 100644 --- a/modules/unusable.lua +++ b/modules/unusable.lua @@ -67,18 +67,13 @@ pfUI:RegisterModule("unusable", "vanilla:tbc", function () end pfUI.unusable:SetScript("OnEvent", function() + -- update all caches if event == "PLAYERBANKSLOTS_CHANGED" or event == "BANKFRAME_OPENED" then - QueueFunction(this.UpdateCache,this) -- BankFrameItemButton_OnUpdate fires after UpdateSlot overriding changes + -- BankFrameItemButton_OnUpdate fires after UpdateSlot overriding changes + QueueFunction(this.UpdateCache,this) else + -- regular update this:UpdateCache() end end) - - -- manual post hook update slot, hooksecurefunc won't work; _G[] doesn't like keys with periods. - local bagUpdateSlot = pfUI.bag.UpdateSlot - pfUI.bag.UpdateSlot = function(_, bag, slot) - bagUpdateSlot(pfUI.bag, bag, slot) - pfUI.unusable:UpdateSlot(bag, slot) - end - end)