mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-24 04:50:49 +00:00
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:
+17
-15
@@ -109,24 +109,26 @@ pfUI:RegisterModule("minimap", function ()
|
||||
this.highlight.tex:SetPoint("BOTTOMRIGHT", MiniMapMailIcon, "BOTTOMRIGHT", 2, -2)
|
||||
this.highlight.tex:SetVertexColor(1,.5,.5)
|
||||
|
||||
this.highlight:SetScript("OnUpdate", function()
|
||||
if not this.count then this.count = 0 end
|
||||
if not this.modifier then this.modifier = 1 end
|
||||
if this.count >= 10 then this:Hide() end
|
||||
|
||||
this:SetAlpha(this:GetAlpha() + this.modifier)
|
||||
|
||||
if this:GetAlpha() <= 0.1 then
|
||||
this.modifier = 0.05
|
||||
this.count = this.count + 1
|
||||
elseif this:GetAlpha() >= 0.9 then
|
||||
this.modifier = -0.05
|
||||
end
|
||||
end)
|
||||
-- Blink ten times between .9 and .1, then hide
|
||||
local highlight = this.highlight
|
||||
highlight:SetAlpha(.9)
|
||||
highlight.blink = highlight:CreateAnimationGroup()
|
||||
for i = 1, 10 do
|
||||
local down = highlight.blink:CreateAnimation("Alpha")
|
||||
down:SetChange(-.8)
|
||||
down:SetDuration(.3)
|
||||
down:SetOrder(i * 2 - 1)
|
||||
local up = highlight.blink:CreateAnimation("Alpha")
|
||||
up:SetChange(.8)
|
||||
up:SetDuration(.3)
|
||||
up:SetOrder(i * 2)
|
||||
end
|
||||
highlight.blink:SetScript("OnFinished", function() highlight:Hide() end)
|
||||
end
|
||||
|
||||
this.highlight.count = 0
|
||||
this.highlight:Show()
|
||||
this.highlight.blink:Stop()
|
||||
this.highlight.blink:Play()
|
||||
end)
|
||||
|
||||
-- Create coordinates text frame with location configurable
|
||||
|
||||
Reference in New Issue
Block a user