actionbar: only refresh required slot changes

This commit is contained in:
shagu
2019-12-16 10:43:04 +01:00
parent 2e9bfdd2c5
commit bf493645c1
+13 -7
View File
@@ -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"],