mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-02 19:50:02 +00:00
unusable: trigger directly from bags module
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user