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
+11 -6
View File
@@ -1160,17 +1160,21 @@ function pfUI.api.CreateInfoBox(text, time, parent, height)
infobox = CreateFrame("Button", "pfInfoBox", UIParent)
infobox:Hide()
infobox.fade = infobox:CreateAnimationGroup()
local fade = infobox.fade:CreateAnimation("Alpha")
fade:SetChange(-1)
fade:SetDuration(.3)
infobox.fade:SetScript("OnFinished", function()
infobox:Hide()
infobox:SetAlpha(1)
end)
infobox:SetScript("OnUpdate", function()
local time = infobox.lastshow + infobox.duration - GetTime()
infobox.timeout:SetValue(time)
if GetTime() > infobox.lastshow + infobox.duration then
infobox:SetAlpha(infobox:GetAlpha()-0.05)
if infobox:GetAlpha() <= 0.1 then
infobox:Hide()
infobox:SetAlpha(1)
end
if not infobox.fade:IsPlaying() then infobox.fade:Play() end
elseif MouseIsOver(this) then
this:SetAlpha(max(0.4, this:GetAlpha() - .1))
else
@@ -1214,6 +1218,7 @@ function pfUI.api.CreateInfoBox(text, time, parent, height)
infobox:SetParent(parent)
infobox:SetFrameStrata("FULLSCREEN_DIALOG")
infobox.fade:Stop()
infobox:Show()
end