X-Git-Url: https://www.aleksib.fi/git/wowui.git/blobdiff_plain/2d236ece61c4b9b9e4e56b90576ece5b86a88879..26c8dda69b63296b6c89a6a8485bb0d9996a22e4:/OmaAB/ActionBars.lua diff --git a/OmaAB/ActionBars.lua b/OmaAB/ActionBars.lua index 610dcf3..e6637e9 100644 --- a/OmaAB/ActionBars.lua +++ b/OmaAB/ActionBars.lua @@ -121,6 +121,7 @@ local chars = { ["Stormreaver"] = { ["Vildan"] = {1, 2, 3, 4,}, ["Gedren"] = {1, 2, 3, 4,}, + ["Gazden"] = {1, 2, 3, 4,}, }, }; @@ -170,6 +171,18 @@ local function updateCooldown(button, slot) local locstart, locduration = GetActionLossOfControlCooldown(slot); local start, duration, enable, modrate = GetActionCooldown(slot); local charges, maxcharges, chargestart, chargeduration, chargemodrate = GetActionCharges(slot); + -- avoid as many updates as possible by checking if there's changes first + if button.prev and + button.prev[1] == locstart and button.prev[2] == locduration and + button.prev[3] == start and button.prev[4] == duration and + button.prev[5] == enable and button.prev[6] == modrate and + button.prev[7] == charges and button.prev[8] == maxcharges and + button.prev[9] == chargestart and button.prev[10] == chargeduration and + button.prev[11] == chargemodrate then + return; + end + button.prev = { locstart, locduration, start, duration, enable, modrate, + charges, maxcharges, chargestart, chargeduration, chargemodrate }; if (locstart + locduration) > (start + duration) then if button.cd.currentCooldownType ~= COOLDOWN_TYPE_LOSS_OF_CONTROL then button.cd:SetEdgeTexture(locCDTexture); @@ -549,23 +562,11 @@ local function setupBindings() end local mounted = false; -local throttleCD = false; -local function throttleCDDone() - throttleCD = false - -- update CD once more to confirm newest CD change is taken in even with some throttling - for _, button in pairs(activeButtons) do - updateCooldown(button, button.slot); - end -end local events = { ["ACTIONBAR_UPDATE_COOLDOWN"] = function() - if not throttleCD then -- only update at most once/frame - throttleCD = true; - for _, button in pairs(activeButtons) do - updateCooldown(button, button.slot); - end - CTimerAfter(0.01, throttleCDDone); -- wait one frame + for _, button in pairs(activeButtons) do + updateCooldown(button, button.slot); end end, ["SPELL_UPDATE_CHARGES"] = function()