unusable: trigger directly from bags module

This commit is contained in:
shagu
2024-02-26 16:48:13 +01:00
parent f6da0b200b
commit a0789f26df
2 changed files with 9 additions and 9 deletions
+4 -9
View File
@@ -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)