actionbar: move state updates to own function

This commit is contained in:
shagu
2020-06-02 00:17:28 +02:00
parent bcb11e03bb
commit a0fa943ca4
+9 -1
View File
@@ -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