mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-04 04:30:01 +00:00
actionbar: move state updates to own function
This commit is contained in:
@@ -47,12 +47,12 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
|
||||
local special_events = {
|
||||
["ACTIONBAR_UPDATE_COOLDOWN"] = true,
|
||||
["ACTIONBAR_UPDATE_USABLE"] = true,
|
||||
["ACTIONBAR_UPDATE_STATE"] = true,
|
||||
}
|
||||
|
||||
-- events that are shared across all buttons
|
||||
local global_events = {
|
||||
-- slot/button updates
|
||||
["ACTIONBAR_UPDATE_STATE"] = true,
|
||||
["PLAYER_ENTERING_WORLD"] = true,
|
||||
["ACTIONBAR_SLOT_CHANGED"] = true,
|
||||
["UPDATE_BINDINGS"] = true,
|
||||
@@ -623,6 +623,14 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function ()
|
||||
end
|
||||
end
|
||||
|
||||
-- run cached action state events
|
||||
if eventcache["ACTIONBAR_UPDATE_STATE"] then
|
||||
eventcache["ACTIONBAR_UPDATE_STATE"] = nil
|
||||
for id, button in pairs(buttoncache) do
|
||||
ButtonIsActiveUpdate(button)
|
||||
end
|
||||
end
|
||||
|
||||
for id in pairs(updatecache) do
|
||||
pfUI.bars.ButtonFullUpdate(buttoncache[id])
|
||||
updatecache[id] = nil
|
||||
|
||||
Reference in New Issue
Block a user