Add per-frame reverse toggle for cooldown sweeps

This commit is contained in:
Brues
2026-10-25 20:24:12 -05:00
parent 0e428de74c
commit d9e74b3bc5
8 changed files with 29 additions and 1 deletions
+5
View File
@@ -174,6 +174,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("appearance", "bags", "abovechat", "0") pfUI:UpdateConfig("appearance", "bags", "abovechat", "0")
pfUI:UpdateConfig("appearance", "bags", "hidechat", "0") pfUI:UpdateConfig("appearance", "bags", "hidechat", "0")
pfUI:UpdateConfig("appearance", "bags", "icon_size", "-1") pfUI:UpdateConfig("appearance", "bags", "icon_size", "-1")
pfUI:UpdateConfig("appearance", "bags", "cooldown_reverse", "0")
pfUI:UpdateConfig("appearance", "bags", "bagrowlength", "10") pfUI:UpdateConfig("appearance", "bags", "bagrowlength", "10")
pfUI:UpdateConfig("appearance", "bags", "bankrowlength", "10") pfUI:UpdateConfig("appearance", "bags", "bankrowlength", "10")
pfUI:UpdateConfig("appearance", "bags", "autoSortOnOpen", "0") pfUI:UpdateConfig("appearance", "bags", "autoSortOnOpen", "0")
@@ -516,6 +517,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", unit, "pspace", "-3") pfUI:UpdateConfig("unitframes", unit, "pspace", "-3")
pfUI:UpdateConfig("unitframes", unit, "cooldown_text", "1") pfUI:UpdateConfig("unitframes", unit, "cooldown_text", "1")
pfUI:UpdateConfig("unitframes", unit, "cooldown_anim", "0") pfUI:UpdateConfig("unitframes", unit, "cooldown_anim", "0")
pfUI:UpdateConfig("unitframes", unit, "cooldown_reverse", "1")
pfUI:UpdateConfig("unitframes", unit, "buffs", "TOPLEFT") pfUI:UpdateConfig("unitframes", unit, "buffs", "TOPLEFT")
pfUI:UpdateConfig("unitframes", unit, "buffsize", "20") pfUI:UpdateConfig("unitframes", unit, "buffsize", "20")
pfUI:UpdateConfig("unitframes", unit, "bufflimit", "32") pfUI:UpdateConfig("unitframes", unit, "bufflimit", "32")
@@ -682,6 +684,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("bars", nil, "bind_size", "8") pfUI:UpdateConfig("bars", nil, "bind_size", "8")
pfUI:UpdateConfig("bars", nil, "bind_color", "1,1,0,1") pfUI:UpdateConfig("bars", nil, "bind_color", "1,1,0,1")
pfUI:UpdateConfig("bars", nil, "cd_size", "12") pfUI:UpdateConfig("bars", nil, "cd_size", "12")
pfUI:UpdateConfig("bars", nil, "cooldown_reverse", "0")
pfUI:UpdateConfig("bars", "gryphons", "texture", "None") pfUI:UpdateConfig("bars", "gryphons", "texture", "None")
pfUI:UpdateConfig("bars", "gryphons", "color", ".6,.6,.6,1") pfUI:UpdateConfig("bars", "gryphons", "color", ".6,.6,.6,1")
@@ -695,6 +698,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("totems", nil, "iconsize", "26") pfUI:UpdateConfig("totems", nil, "iconsize", "26")
pfUI:UpdateConfig("totems", nil, "spacing", "3") pfUI:UpdateConfig("totems", nil, "spacing", "3")
pfUI:UpdateConfig("totems", nil, "showbg", "0") pfUI:UpdateConfig("totems", nil, "showbg", "0")
pfUI:UpdateConfig("totems", nil, "cooldown_reverse", "1")
pfUI:UpdateConfig("panel", nil, "use_unitfonts", "0") pfUI:UpdateConfig("panel", nil, "use_unitfonts", "0")
pfUI:UpdateConfig("panel", nil, "hide_leftchat", "0") pfUI:UpdateConfig("panel", nil, "hide_leftchat", "0")
@@ -942,6 +946,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("nameplates", nil, "debufftimers", "1") pfUI:UpdateConfig("nameplates", nil, "debufftimers", "1")
pfUI:UpdateConfig("nameplates", nil, "debufftext", "1") pfUI:UpdateConfig("nameplates", nil, "debufftext", "1")
pfUI:UpdateConfig("nameplates", nil, "debuffanim", "0") pfUI:UpdateConfig("nameplates", nil, "debuffanim", "0")
pfUI:UpdateConfig("nameplates", nil, "debreverse", "1")
pfUI:UpdateConfig("abuttons", nil, "enable", "1") pfUI:UpdateConfig("abuttons", nil, "enable", "1")
pfUI:UpdateConfig("abuttons", nil, "position", "bottom") pfUI:UpdateConfig("abuttons", nil, "position", "bottom")
+3
View File
@@ -470,6 +470,7 @@ function pfUI.uf:UpdateConfig()
local cooldown_text = tonumber(f.config.cooldown_text) local cooldown_text = tonumber(f.config.cooldown_text)
local cooldown_anim = tonumber(f.config.cooldown_anim) local cooldown_anim = tonumber(f.config.cooldown_anim)
local cooldown_reverse = tonumber(f.config.cooldown_reverse) or 0
local relative_point = "BOTTOM" local relative_point = "BOTTOM"
if f.config.panchor == "TOPLEFT" then if f.config.panchor == "TOPLEFT" then
@@ -829,6 +830,7 @@ function pfUI.uf:UpdateConfig()
f.buffs[i].cd.pfCooldownType = "ALL" f.buffs[i].cd.pfCooldownType = "ALL"
f.buffs[i].cd.pfCooldownStyleText = cooldown_text f.buffs[i].cd.pfCooldownStyleText = cooldown_text
f.buffs[i].cd.pfCooldownStyleAnimation = cooldown_anim 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:SetAlpha(cooldown_anim == 1 and 1 or 0)
-- immediately show/hide existing cooldown text -- immediately show/hide existing cooldown text
@@ -889,6 +891,7 @@ function pfUI.uf:UpdateConfig()
f.debuffs[i].cd.pfCooldownType = "ALL" f.debuffs[i].cd.pfCooldownType = "ALL"
f.debuffs[i].cd.pfCooldownStyleText = cooldown_text f.debuffs[i].cd.pfCooldownStyleText = cooldown_text
f.debuffs[i].cd.pfCooldownStyleAnimation = cooldown_anim 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:SetAlpha(cooldown_anim == 1 and 1 or 0)
-- immediately show/hide existing cooldown text -- immediately show/hide existing cooldown text
+1
View File
@@ -1045,6 +1045,7 @@ pfUI:RegisterModule("actionbar", function ()
-- cooldown -- cooldown
f.cd = CreateFrame("Cooldown", f:GetName() .. "Cooldown", f, "CooldownFrameTemplate") f.cd = CreateFrame("Cooldown", f:GetName() .. "Cooldown", f, "CooldownFrameTemplate")
f.cd.pfCooldownStyleAnimation = 1 f.cd.pfCooldownStyleAnimation = 1
f.cd.pfCooldownReverse = tonumber(C.bars.cooldown_reverse) or 0
f.cd.pfCooldownType = "NOGCD" f.cd.pfCooldownType = "NOGCD"
f.cd.pfCooldownSize = cd_size f.cd.pfCooldownSize = cd_size
+2
View File
@@ -398,11 +398,13 @@ pfUI:RegisterModule("bags", function ()
local name = "pfBag" .. bag .. "item" .. slot .. "Cooldown" local name = "pfBag" .. bag .. "item" .. slot .. "Cooldown"
bankslot.cd = CreateFrame("Cooldown", name, bankslot, "CooldownFrameTemplate") bankslot.cd = CreateFrame("Cooldown", name, bankslot, "CooldownFrameTemplate")
bankslot.cd.pfCooldownStyleAnimation = 1 bankslot.cd.pfCooldownStyleAnimation = 1
bankslot.cd.pfCooldownReverse = tonumber(C.appearance.bags.cooldown_reverse) or 0
bankslot.cd.pfCooldownType = "NOGCD" bankslot.cd.pfCooldownType = "NOGCD"
else else
local bagslot = pfUI.bags[bag].slots[slot].frame local bagslot = pfUI.bags[bag].slots[slot].frame
bagslot.cd = _G[bagslot:GetName().."Cooldown"] bagslot.cd = _G[bagslot:GetName().."Cooldown"]
bagslot.cd.pfCooldownType = "NOGCD" bagslot.cd.pfCooldownType = "NOGCD"
bagslot.cd.pfCooldownReverse = tonumber(C.appearance.bags.cooldown_reverse) or 0
end end
if not pfUI.bags[bag].slots[slot].frame.backdrop then if not pfUI.bags[bag].slots[slot].frame.backdrop then
+6
View File
@@ -142,6 +142,12 @@ pfUI:RegisterModule("cooldown", function ()
this:SetAlpha(0) this:SetAlpha(0)
end end
-- reversed sweep direction (ClassicAPI backports SetReverse with the
-- modern Cooldown frame; stock Model swipes don't have it, so guard it)
if this.pfCooldownReverse == 1 and this.SetReverse then
this:SetReverse(true)
end
-- print time as text on cooldown frames -- print time as text on cooldown frames
if ( not this.pfCooldownStyleText or this.pfCooldownStyleText == 1) if ( not this.pfCooldownStyleText or this.pfCooldownStyleText == 1)
and start > 0 and duration > 0 and (not enable or enable > 0) then and start > 0 and duration > 0 and (not enable or enable > 0) then
+5
View File
@@ -2341,6 +2341,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(U[c], T["Timer"], nil, nil, "header") CreateConfig(U[c], T["Timer"], nil, nil, "header")
CreateConfig(U[c], T["Show Timer Text"], C.unitframes[c], "cooldown_text", "checkbox") CreateConfig(U[c], T["Show Timer Text"], C.unitframes[c], "cooldown_text", "checkbox")
CreateConfig(Reload, T["Show Timer Animation"], C.unitframes[c], "cooldown_anim", "checkbox") CreateConfig(Reload, T["Show Timer Animation"], C.unitframes[c], "cooldown_anim", "checkbox")
CreateConfig(Reload, T["Reverse Timer Animation"], C.unitframes[c], "cooldown_reverse", "checkbox")
CreateConfig(U[c], T["Buffs"], nil, nil, "header") CreateConfig(U[c], T["Buffs"], nil, nil, "header")
CreateConfig(U[c], T["Buff Position"], C.unitframes[c], "buffs", "dropdown", pfUI.gui.dropdowns.uf_buff_position) CreateConfig(U[c], T["Buff Position"], C.unitframes[c], "buffs", "dropdown", pfUI.gui.dropdowns.uf_buff_position)
@@ -2445,6 +2446,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(nil, T["Bankslots Per Row"], C.appearance.bags, "bankrowlength") CreateConfig(nil, T["Bankslots Per Row"], C.appearance.bags, "bankrowlength")
CreateConfig(nil, T["Enable Full-Text Search"], C.appearance.bags, "fulltext") CreateConfig(nil, T["Enable Full-Text Search"], C.appearance.bags, "fulltext")
CreateConfig(nil, T["Item Slot Size"], C.appearance.bags, "icon_size") CreateConfig(nil, T["Item Slot Size"], C.appearance.bags, "icon_size")
CreateConfig(Reload, T["Reverse Cooldown Animation"], C.appearance.bags, "cooldown_reverse", "checkbox")
CreateConfig(nil, T["Auto Sell Grey Items"], C.global, "autosell", "checkbox") CreateConfig(nil, T["Auto Sell Grey Items"], C.global, "autosell", "checkbox")
CreateConfig(nil, T["Auto Repair Items"], C.global, "autorepair", "checkbox") CreateConfig(nil, T["Auto Repair Items"], C.global, "autorepair", "checkbox")
CreateConfig(nil, T["Auto Sort When Opening Bags"], C.appearance.bags, "autoSortOnOpen", "checkbox") CreateConfig(nil, T["Auto Sort When Opening Bags"], C.appearance.bags, "autoSortOnOpen", "checkbox")
@@ -2502,6 +2504,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(U["totems"], T["Icon Size"], C.totems, "iconsize") CreateConfig(U["totems"], T["Icon Size"], C.totems, "iconsize")
CreateConfig(U["totems"], T["Spacing"], C.totems, "spacing", "dropdown", pfUI.gui.dropdowns.spacing) CreateConfig(U["totems"], T["Spacing"], C.totems, "spacing", "dropdown", pfUI.gui.dropdowns.spacing)
CreateConfig(U["totems"], T["Show Background"], C.totems, "showbg", "checkbox") CreateConfig(U["totems"], T["Show Background"], C.totems, "showbg", "checkbox")
CreateConfig(Reload, T["Reverse Cooldown Animation"], C.totems, "cooldown_reverse", "checkbox")
end) end)
CreateGUIEntry(T["Buffs"], T["Player Buff Bar"], function() CreateGUIEntry(T["Buffs"], T["Player Buff Bar"], function()
@@ -2591,6 +2594,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(U["bars"], T["Keybind Text Size"], C.bars, "bind_size") CreateConfig(U["bars"], T["Keybind Text Size"], C.bars, "bind_size")
CreateConfig(U["bars"], T["Keybind Text Color"], C.bars, "bind_color", "color") CreateConfig(U["bars"], T["Keybind Text Color"], C.bars, "bind_color", "color")
CreateConfig(nil, T["Cooldown Text Size"], C.bars, "cd_size") CreateConfig(nil, T["Cooldown Text Size"], C.bars, "cd_size")
CreateConfig(Reload, T["Reverse Cooldown Animation"], C.bars, "cooldown_reverse", "checkbox")
CreateConfig(nil, T["Auto Paging"], nil, nil, "header") CreateConfig(nil, T["Auto Paging"], nil, nil, "header")
CreateConfig(U["bars"], T["Switch Pages On Alt Key Press"], C.bars, "pagemasteralt", "checkbox") CreateConfig(U["bars"], T["Switch Pages On Alt Key Press"], C.bars, "pagemasteralt", "checkbox")
@@ -2960,6 +2964,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(U["nameplates"], T["Enable Debuff Timers"], C.nameplates, "debufftimers", "checkbox") CreateConfig(U["nameplates"], T["Enable Debuff Timers"], C.nameplates, "debufftimers", "checkbox")
CreateConfig(U["nameplates"], T["Show Timer Text"], C.nameplates, "debufftext", "checkbox") CreateConfig(U["nameplates"], T["Show Timer Text"], C.nameplates, "debufftext", "checkbox")
CreateConfig(Reload, T["Show Timer Animation"], C.nameplates, "debuffanim", "checkbox") CreateConfig(Reload, T["Show Timer Animation"], C.nameplates, "debuffanim", "checkbox")
CreateConfig(Reload, T["Reverse Timer Animation"], C.nameplates, "debreverse", "checkbox")
CreateConfig(U["nameplates"], T["Filter Mode"], C.nameplates.debuffs, "filter", "dropdown", pfUI.gui.dropdowns.buffbarfilter) CreateConfig(U["nameplates"], T["Filter Mode"], C.nameplates.debuffs, "filter", "dropdown", pfUI.gui.dropdowns.buffbarfilter)
CreateConfig(U["nameplates"], T["Blacklist"], C.nameplates.debuffs, "blacklist", "list") CreateConfig(U["nameplates"], T["Blacklist"], C.nameplates.debuffs, "blacklist", "list")
+6 -1
View File
@@ -159,6 +159,7 @@ pfUI:RegisterModule("nameplates", function ()
cfg.debufftimers = C.nameplates.debufftimers == "1" cfg.debufftimers = C.nameplates.debufftimers == "1"
cfg.debuffanim = tonumber(C.nameplates.debuffanim) or 0 cfg.debuffanim = tonumber(C.nameplates.debuffanim) or 0
cfg.debufftext = tonumber(C.nameplates.debufftext) or 1 cfg.debufftext = tonumber(C.nameplates.debufftext) or 1
cfg.debreverse = tonumber(C.nameplates.debreverse) or 0
-- Throttle delays, resolved once instead of per plate per tick. -- Throttle delays, resolved once instead of per plate per tick.
-- libthrottle:Get walks the saved-variable table, a defaults fallback and a -- libthrottle:Get walks the saved-variable table, a defaults fallback and a
@@ -445,6 +446,7 @@ pfUI:RegisterModule("nameplates", function ()
-- Set initial config flags (will be cached per-cooldown later) -- Set initial config flags (will be cached per-cooldown later)
plate.debuffs[index].cd.pfCooldownStyleAnimation = cfg.debuffanim plate.debuffs[index].cd.pfCooldownStyleAnimation = cfg.debuffanim
plate.debuffs[index].cd.pfCooldownReverse = cfg.debreverse or 0
plate.debuffs[index].cd.pfCooldownStyleText = cfg.debufftext plate.debuffs[index].cd.pfCooldownStyleText = cfg.debufftext
plate.debuffs[index].cd.pfCooldownType = "ALL" plate.debuffs[index].cd.pfCooldownType = "ALL"
end end
@@ -486,6 +488,7 @@ pfUI:RegisterModule("nameplates", function ()
local cooldown_anim = tonumber(C.nameplates.debuffanim) or 0 local cooldown_anim = tonumber(C.nameplates.debuffanim) or 0
nameplate.debuffs[i].cd.pfCooldownStyleText = cooldown_text nameplate.debuffs[i].cd.pfCooldownStyleText = cooldown_text
nameplate.debuffs[i].cd.pfCooldownStyleAnimation = cooldown_anim nameplate.debuffs[i].cd.pfCooldownStyleAnimation = cooldown_anim
nameplate.debuffs[i].cd.pfCooldownReverse = tonumber(C.nameplates.debreverse) or 0
end end
end end
@@ -1396,12 +1399,14 @@ nameplates:RegisterUnitEvent("UNIT_SPELLCAST_NOT_INTERRUPTIBLE", "target", "focu
local cd = plate.debuffs[index].cd local cd = plate.debuffs[index].cd
cd:Show() cd:Show()
if not cachedStart or abs(cachedStart - newStart) > 0.5 then if not cachedStart or abs(cachedStart - newStart) > 0.5 then
if not cd.configCached or cd.cachedAnim ~= cfg.debuffanim or cd.cachedText ~= cfg.debufftext then if not cd.configCached or cd.cachedAnim ~= cfg.debuffanim or cd.cachedText ~= cfg.debufftext or cd.cachedReverse ~= cfg.debreverse then
cd.pfCooldownStyleAnimation = cfg.debuffanim cd.pfCooldownStyleAnimation = cfg.debuffanim
cd.pfCooldownStyleText = cfg.debufftext cd.pfCooldownStyleText = cfg.debufftext
cd.pfCooldownReverse = cfg.debreverse or 0
cd:SetAlpha(cfg.debuffanim == 1 and 1 or 0) cd:SetAlpha(cfg.debuffanim == 1 and 1 or 0)
cd.cachedAnim = cfg.debuffanim cd.cachedAnim = cfg.debuffanim
cd.cachedText = cfg.debufftext cd.cachedText = cfg.debufftext
cd.cachedReverse = cfg.debreverse
cd.configCached = true cd.configCached = true
end end
CooldownFrame_SetTimer(cd, newStart, effDuration, 1) CooldownFrame_SetTimer(cd, newStart, effDuration, 1)
+1
View File
@@ -115,6 +115,7 @@ pfUI:RegisterModule("totems", function ()
self.bar[i].cdbg:SetPoint("CENTER", self.bar[i], "CENTER", 0, 0) self.bar[i].cdbg:SetPoint("CENTER", self.bar[i], "CENTER", 0, 0)
self.bar[i].cd = self.bar[i].cd or CreateFrame("Cooldown", "pfTotemsBar"..i.."Cooldown", self.bar[i].cdbg, "CooldownFrameTemplate") self.bar[i].cd = self.bar[i].cd or CreateFrame("Cooldown", "pfTotemsBar"..i.."Cooldown", self.bar[i].cdbg, "CooldownFrameTemplate")
self.bar[i].cd.pfCooldownStyleAnimation = 1 self.bar[i].cd.pfCooldownStyleAnimation = 1
self.bar[i].cd.pfCooldownReverse = tonumber(pfUI_config.totems.cooldown_reverse) or 0
self.bar[i].cd.pfCooldownType = "ALL" self.bar[i].cd.pfCooldownType = "ALL"
self.bar[i]:RegisterForClicks("LeftButtonUp", "RightButtonUp") self.bar[i]:RegisterForClicks("LeftButtonUp", "RightButtonUp")