From a721f788a9559664a3fb79a4f61f0ccf75bb097d Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Fri, 30 Oct 2026 10:45:51 -0500 Subject: [PATCH] Let each cooldown frame apply its own sweep settings The sweep options reached the frames only through the cooldown module's CooldownFrame_SetTimer hook, which set alpha 0 for a hidden animation and SetReverse(true) for a reversed one. With that module disabled, Show Timer Animation and Reverse did nothing, and reverse never turned back off without a reload. The player buff sweeps had no other path at all. Each owner now configures its own frame. Player buffs drive their Cooldown with SetCooldown and Clear, and only while Show Timer Animation is on. Unit frame auras, raid aura indicators and nameplate debuffs hide the sweep with SetDrawSwipe and SetDrawBling. Every frame with a reverse option calls SetReverse. The hook keeps the timer text and Hide Foreign Cooldown Animations. Nameplate debuffs hid the sweep with alpha, which the plate's SetAlpha copied down on every target change (ClassicAPI keeps 1.12's alpha under default plates), so hidden sweeps came back. Their settings now come from UpdateDebuffConfig alone. Bag slots get a native Cooldown like bank slots, in place of the template's indicator Model, so Reverse Cooldown Animation covers bags and Hide Foreign Cooldown Animations no longer hides them. The buff, unit frame, nameplate and totem options apply without a reload. Fixes #72. --- api/unitframes.lua | 14 +++++++++----- modules/actionbar.lua | 2 +- modules/bags.lua | 23 +++++++++-------------- modules/buff.lua | 21 +++++++++------------ modules/cooldown.lua | 13 +++---------- modules/gui.lua | 14 +++++++------- modules/nameplates.lua | 36 ++++++++++-------------------------- modules/totems.lua | 2 +- 8 files changed, 49 insertions(+), 76 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index 8f959d4b..91ad2251 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -500,7 +500,7 @@ function pfUI.uf:UpdateConfig() local cooldown_text = tonumber(f.config.cooldown_text) local cooldown_anim = tonumber(f.config.cooldown_anim) - local cooldown_reverse = tonumber(f.config.cooldown_reverse) or 0 + local cooldown_reverse = f.config.cooldown_reverse == "1" local relative_point = "BOTTOM" if f.config.panchor == "TOPLEFT" then @@ -862,8 +862,9 @@ function pfUI.uf:UpdateConfig() f.buffs[i].cd.pfCooldownType = "ALL" f.buffs[i].cd.pfCooldownStyleText = cooldown_text f.buffs[i].cd.pfCooldownStyleAnimation = cooldown_anim - f.buffs[i].cd.pfCooldownReverse = cooldown_reverse - f.buffs[i].cd:SetAlpha(cooldown_anim == 1 and 1 or 0) + f.buffs[i].cd:SetDrawSwipe(cooldown_anim == 1) + f.buffs[i].cd:SetDrawBling(cooldown_anim == 1) + f.buffs[i].cd:SetReverse(cooldown_reverse) -- immediately show/hide existing cooldown text if f.buffs[i].cd.pfCooldownText then @@ -923,8 +924,9 @@ function pfUI.uf:UpdateConfig() f.debuffs[i].cd.pfCooldownType = "ALL" f.debuffs[i].cd.pfCooldownStyleText = cooldown_text f.debuffs[i].cd.pfCooldownStyleAnimation = cooldown_anim - f.debuffs[i].cd.pfCooldownReverse = cooldown_reverse - f.debuffs[i].cd:SetAlpha(cooldown_anim == 1 and 1 or 0) + f.debuffs[i].cd:SetDrawSwipe(cooldown_anim == 1) + f.debuffs[i].cd:SetDrawBling(cooldown_anim == 1) + f.debuffs[i].cd:SetReverse(cooldown_reverse) -- immediately show/hide existing cooldown text if f.debuffs[i].cd.pfCooldownText then @@ -2269,6 +2271,8 @@ function pfUI.uf:AddIcon(frame, pos, icon, timeleft, stacks, start, duration) frame.icon[pos].cd = CreateFrame("Cooldown", nil, frame.icon[pos], "CooldownFrameTemplate") frame.icon[pos].cd.pfCooldownStyleAnimation = 0 + frame.icon[pos].cd:SetDrawSwipe(false) + frame.icon[pos].cd:SetDrawBling(false) frame.icon[pos].cd.pfCooldownType = "ALL" frame.icon[pos].cd:SetFrameLevel(48) end diff --git a/modules/actionbar.lua b/modules/actionbar.lua index 1dd1de95..bd12bbc3 100644 --- a/modules/actionbar.lua +++ b/modules/actionbar.lua @@ -1035,7 +1035,7 @@ pfUI:RegisterModule("actionbar", function () -- cooldown f.cd = CreateFrame("Cooldown", f:GetName() .. "Cooldown", f, "CooldownFrameTemplate") f.cd.pfCooldownStyleAnimation = 1 - f.cd.pfCooldownReverse = tonumber(C.bars.cooldown_reverse) or 0 + f.cd:SetReverse(C.bars.cooldown_reverse == "1") f.cd.pfCooldownType = "NOGCD" f.cd.pfCooldownSize = cd_size diff --git a/modules/bags.lua b/modules/bags.lua index fe6f2f4f..8510f715 100644 --- a/modules/bags.lua +++ b/modules/bags.lua @@ -415,20 +415,15 @@ pfUI:RegisterModule("bags", function () pfUI.bags[bag].slots[slot].slot = slot pfUI.bags[bag].slots[slot].frame:SetID(slot) - -- add cooldown frame to bankslots - if tpl == "BankItemButtonGenericTemplate" then - local bankslot = pfUI.bags[bag].slots[slot].frame - local name = "pfBag" .. bag .. "item" .. slot .. "Cooldown" - bankslot.cd = CreateFrame("Cooldown", name, bankslot, "CooldownFrameTemplate") - bankslot.cd.pfCooldownStyleAnimation = 1 - bankslot.cd.pfCooldownReverse = tonumber(C.appearance.bags.cooldown_reverse) or 0 - bankslot.cd.pfCooldownType = "NOGCD" - else - local bagslot = pfUI.bags[bag].slots[slot].frame - bagslot.cd = _G[bagslot:GetName().."Cooldown"] - bagslot.cd.pfCooldownType = "NOGCD" - bagslot.cd.pfCooldownReverse = tonumber(C.appearance.bags.cooldown_reverse) or 0 - end + -- native cooldown frame: the bank template has none and the bag + -- template's is 1.12's indicator Model, which can't reverse. Taking the + -- "