mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-26 22:00:49 +00:00
Add per-frame reverse toggle for cooldown sweeps
This commit is contained in:
@@ -1045,6 +1045,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.pfCooldownType = "NOGCD"
|
||||
f.cd.pfCooldownSize = cd_size
|
||||
|
||||
|
||||
@@ -398,11 +398,13 @@ pfUI:RegisterModule("bags", function ()
|
||||
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
|
||||
|
||||
if not pfUI.bags[bag].slots[slot].frame.backdrop then
|
||||
|
||||
@@ -142,6 +142,12 @@ pfUI:RegisterModule("cooldown", function ()
|
||||
this:SetAlpha(0)
|
||||
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
|
||||
if ( not this.pfCooldownStyleText or this.pfCooldownStyleText == 1)
|
||||
and start > 0 and duration > 0 and (not enable or enable > 0) then
|
||||
|
||||
@@ -2341,6 +2341,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(U[c], T["Timer"], nil, nil, "header")
|
||||
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["Reverse Timer Animation"], C.unitframes[c], "cooldown_reverse", "checkbox")
|
||||
|
||||
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)
|
||||
@@ -2445,6 +2446,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
CreateConfig(nil, T["Bankslots Per Row"], C.appearance.bags, "bankrowlength")
|
||||
CreateConfig(nil, T["Enable Full-Text Search"], C.appearance.bags, "fulltext")
|
||||
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 Repair Items"], C.global, "autorepair", "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["Spacing"], C.totems, "spacing", "dropdown", pfUI.gui.dropdowns.spacing)
|
||||
CreateConfig(U["totems"], T["Show Background"], C.totems, "showbg", "checkbox")
|
||||
CreateConfig(Reload, T["Reverse Cooldown Animation"], C.totems, "cooldown_reverse", "checkbox")
|
||||
end)
|
||||
|
||||
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 Color"], C.bars, "bind_color", "color")
|
||||
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(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["Show Timer Text"], C.nameplates, "debufftext", "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["Blacklist"], C.nameplates.debuffs, "blacklist", "list")
|
||||
|
||||
@@ -159,6 +159,7 @@ pfUI:RegisterModule("nameplates", function ()
|
||||
cfg.debufftimers = C.nameplates.debufftimers == "1"
|
||||
cfg.debuffanim = tonumber(C.nameplates.debuffanim) or 0
|
||||
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.
|
||||
-- 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)
|
||||
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.pfCooldownType = "ALL"
|
||||
end
|
||||
@@ -486,6 +488,7 @@ pfUI:RegisterModule("nameplates", function ()
|
||||
local cooldown_anim = tonumber(C.nameplates.debuffanim) or 0
|
||||
nameplate.debuffs[i].cd.pfCooldownStyleText = cooldown_text
|
||||
nameplate.debuffs[i].cd.pfCooldownStyleAnimation = cooldown_anim
|
||||
nameplate.debuffs[i].cd.pfCooldownReverse = tonumber(C.nameplates.debreverse) or 0
|
||||
|
||||
end
|
||||
end
|
||||
@@ -1396,12 +1399,14 @@ nameplates:RegisterUnitEvent("UNIT_SPELLCAST_NOT_INTERRUPTIBLE", "target", "focu
|
||||
local cd = plate.debuffs[index].cd
|
||||
cd:Show()
|
||||
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.pfCooldownStyleText = cfg.debufftext
|
||||
cd.pfCooldownReverse = cfg.debreverse or 0
|
||||
cd:SetAlpha(cfg.debuffanim == 1 and 1 or 0)
|
||||
cd.cachedAnim = cfg.debuffanim
|
||||
cd.cachedText = cfg.debufftext
|
||||
cd.cachedReverse = cfg.debreverse
|
||||
cd.configCached = true
|
||||
end
|
||||
CooldownFrame_SetTimer(cd, newStart, effDuration, 1)
|
||||
|
||||
@@ -115,6 +115,7 @@ pfUI:RegisterModule("totems", function ()
|
||||
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.pfCooldownStyleAnimation = 1
|
||||
self.bar[i].cd.pfCooldownReverse = tonumber(pfUI_config.totems.cooldown_reverse) or 0
|
||||
self.bar[i].cd.pfCooldownType = "ALL"
|
||||
|
||||
self.bar[i]:RegisterForClicks("LeftButtonUp", "RightButtonUp")
|
||||
|
||||
Reference in New Issue
Block a user