diff --git a/modules/actionbar.lua b/modules/actionbar.lua index 0edd1cb0..eb1fda58 100644 --- a/modules/actionbar.lua +++ b/modules/actionbar.lua @@ -240,6 +240,13 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function () end end + -- helper function to update by slot + local function RefreshSlot(slot) + local bar, button = ceil(slot/12), mod(slot, 12) + button = button == 0 and 12 or button + table.insert(updatecache, pfUI.bars[bar][button]) + end + local usable, oom, start, duration, enable, castable, autocast, token local id, bar, active, texture local function ButtonRefresh(self) @@ -573,6 +580,12 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function () return end + -- refresh only specific slots + if event == "ACTIONBAR_SLOT_CHANGED" and arg1 and arg1 ~= 0 then + RefreshSlot(arg1) + return + end + -- handle global events for id, button in pairs(buttoncache) do ButtonRefresh(button) @@ -1043,13 +1056,6 @@ pfUI:RegisterModule("actionbar", "vanilla:tbc", function () pfUI.bars:UpdateConfig() - -- helper function to update by slot - local function RefreshSlot(slot) - local bar, button = ceil(slot/12), mod(slot, 12) - button = button == 0 and 12 or button - table.insert(updatecache, bars[bar][button]) - end - -- Localize custom keybinds for additional actionbars (see Bindings.xml) local names = { ["PAGING"] = T["Paging Actionbar"],