From a0fa943ca4f20ee57e93d367f7081f6b5cacdd07 Mon Sep 17 00:00:00 2001 From: shagu Date: Tue, 2 Jun 2020 00:17:28 +0200 Subject: [PATCH] actionbar: move state updates to own function --- modules/actionbar.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/actionbar.lua b/modules/actionbar.lua index cbc6c98b..102f68b6 100644 --- a/modules/actionbar.lua +++ b/modules/actionbar.lua @@ -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