mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-07 22:20:00 +00:00
actionbar: only refresh required slot changes
This commit is contained in:
+13
-7
@@ -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"],
|
||||
|
||||
Reference in New Issue
Block a user