From e326cea05ea083da31f2af9b26324e786c6c15dd Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Sun, 25 Oct 2026 20:26:45 -0500 Subject: [PATCH] Add radial sweeps to buff/debuff icon display --- api/config.lua | 2 ++ modules/buff.lua | 34 +++++++++++++++++++++++++++++++++- modules/gui.lua | 2 ++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/api/config.lua b/api/config.lua index d2e5536a..d1c3805d 100644 --- a/api/config.lua +++ b/api/config.lua @@ -71,6 +71,8 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("buffs", nil, "debuffrowsize", "16") pfUI:UpdateConfig("buffs", nil, "textinside", "0") pfUI:UpdateConfig("buffs", nil, "fontsize", "-1") + pfUI:UpdateConfig("buffs", nil, "cooldown_anim", "1") + pfUI:UpdateConfig("buffs", nil, "cooldown_reverse", "1") pfUI:UpdateConfig("buffbar", "pbuff", "enable", "0") pfUI:UpdateConfig("buffbar", "pbuff", "use_unitfonts", "0") diff --git a/modules/buff.lua b/modules/buff.lua index 73e56a0d..8a43fc27 100644 --- a/modules/buff.lua +++ b/modules/buff.lua @@ -33,7 +33,7 @@ pfUI:RegisterModule("buff", function () end local slots = buff.btype == "HELPFUL" and helpfulSlots or harmfulSlots - local name, icon, count, dispelType, _, expirationTime, _, _, _, spellId = C_UnitAuras.UnitAuraBySlot("player", slots[buff.id]) + local name, icon, count, dispelType, duration, expirationTime, _, _, _, spellId = C_UnitAuras.UnitAuraBySlot("player", slots[buff.id]) --detect weapon buffs if buff.btype == "HELPFUL" and ((C.buffs.separateweapons == "0" and buff.gid <= pfUI.buff.wepbuffs.count) or (pfUI.buff.wepbuffs.count > 0 and buff.weapon ~= nil)) then @@ -84,6 +84,28 @@ pfUI:RegisterModule("buff", function () return end + -- drive the sweep from the aura duration (weapon enchants and permanent + -- auras report no usable total, so those buttons stay text-only) + if buff.mode == buff.btype and duration and duration > 0 and expirationTime and expirationTime > 0 then + local now = GetTime() + local timeleft = expirationTime - now + if timeleft > 0 then + local effDuration = duration > timeleft and duration or timeleft + local newStart = now + timeleft - effDuration + if buff.cdStart == nil or abs(buff.cdStart - newStart) > .5 or buff.cdDuration ~= effDuration then + CooldownFrame_SetTimer(buff.cd, newStart, effDuration, 1) + buff.cdStart = newStart + buff.cdDuration = effDuration + end + else + CooldownFrame_SetTimer(buff.cd, 0, 0, 0) + buff.cdStart = nil + end + else + CooldownFrame_SetTimer(buff.cd, 0, 0, 0) + buff.cdStart = nil + end + buff:Show() end @@ -117,6 +139,14 @@ pfUI:RegisterModule("buff", function () buff.stacks:SetJustifyV("BOTTOM") buff.stacks:SetAllPoints(buff) + -- radial sweep (the template covers the button and starts hidden; + -- the cooldown hook drives it from here, text stays with buff.timer) + buff.cd = CreateFrame("Cooldown", buttonName .. "Cooldown", buff, "CooldownFrameTemplate") + buff.cd.pfCooldownType = "ALL" + buff.cd.pfCooldownStyleText = 0 + buff.cd.pfCooldownStyleAnimation = tonumber(C.buffs.cooldown_anim) or 0 + buff.cd.pfCooldownReverse = tonumber(C.buffs.cooldown_reverse) or 0 + buff:RegisterForClicks("RightButtonUp") buff.weapon = weapon @@ -307,6 +337,8 @@ pfUI:RegisterModule("buff", function () offsetY = -(rowcount) * ((C.buffs.textinside == "1" and 0 or (fontsize*1.5))+buffSize+2*buffSpacing) end buff:SetSize(buffSize, buffSize) + buff.cd.pfCooldownStyleAnimation = tonumber(C.buffs.cooldown_anim) or 0 + buff.cd.pfCooldownReverse = tonumber(C.buffs.cooldown_reverse) or 0 buff:ClearAllPoints() buff:SetPoint("TOPRIGHT", relFrame, "TOPRIGHT",offsetX, offsetY) diff --git a/modules/gui.lua b/modules/gui.lua index 9b3c82a3..24e1ebe5 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -2497,6 +2497,8 @@ pfUI:RegisterModule("gui", function () CreateConfig(U["buff"], T["Number Of Debuffs Per Row"], C.buffs, "debuffrowsize") CreateConfig(U["buff"], T["Show Duration Inside Buff"], C.buffs, "textinside", "checkbox") CreateConfig(U["buff"], T["Buff Font Size"], C.buffs, "fontsize") + CreateConfig(Reload, T["Show Timer Animation"], C.buffs, "cooldown_anim", "checkbox") + CreateConfig(Reload, T["Reverse Timer Animation"], C.buffs, "cooldown_reverse", "checkbox") end) CreateGUIEntry(T["Buffs"], T["Totem Icons"], function()