Use ClassicAPI animation groups for fades and pulses

Replace hand-rolled OnUpdate alpha loops with engine animation groups:
unit frame aggro/combat glow, tracking icon pulse, new-mail blink,
castbar fade-out, autohide, XP/rep bar fade, info box timeout and the
unlock-mode scale label. Timing no longer depends on framerate, and the
always-running glow driver and tracking OnUpdate are gone.

The XP bar tracks hover through OnEnter/OnLeave instead of MouseIsOver,
so a fade can't restart under the cursor.
This commit is contained in:
Brues
2026-10-22 21:28:34 -05:00
parent 65ad47e842
commit 9cb21b982b
8 changed files with 113 additions and 94 deletions
+13 -3
View File
@@ -1555,11 +1555,20 @@ function pfUI.api.EnableAutohide(frame, timeout, combat)
frame.hover.parent = frame
frame.hover:Show()
if not frame.hover.fade then
frame.hover.fade = frame:CreateAnimationGroup()
local fade = frame.hover.fade:CreateAnimation("Alpha")
fade:SetChange(-1)
fade:SetDuration(1)
frame.hover.fade:SetScript("OnFinished", function() frame:SetAlpha(0) end)
end
if combat then
frame.hover:RegisterEvent("PLAYER_REGEN_ENABLED")
frame.hover:RegisterEvent("PLAYER_REGEN_DISABLED")
frame.hover:SetScript("OnEvent", function()
if event == "PLAYER_REGEN_DISABLED" then
this.fade:Stop()
this.parent:SetAlpha(1)
this.activeTo = "keep"
elseif event == "PLAYER_REGEN_ENABLED" then
@@ -1577,11 +1586,11 @@ function pfUI.api.EnableAutohide(frame, timeout, combat)
if MouseIsOver(this, 10, -10, -10, 10) then
this.activeTo = GetTime() + timeout
this.fade:Stop()
this.parent:SetAlpha(1)
elseif this.activeTo then
if this.activeTo < GetTime() and this.parent:GetAlpha() > 0 then
local fps = (60 / math.max(GetFramerate(), 1))
this.parent:SetAlpha(this.parent:GetAlpha() - 0.05*fps)
if this.activeTo < GetTime() and this.parent:GetAlpha() > 0 and not this.fade:IsPlaying() then
this.fade:Play()
end
else
this.activeTo = GetTime() + timeout
@@ -1598,6 +1607,7 @@ function pfUI.api.DisableAutohide(frame)
frame.hover:SetScript("OnEvent", nil)
frame.hover:SetScript("OnUpdate", nil)
frame.hover:Hide()
frame.hover.fade:Stop()
frame:SetAlpha(1)
end