timer animation fix

timer animation fix
This commit is contained in:
Meow
2026-01-24 02:33:17 +01:00
parent 7a765e16da
commit 7898895cf4
5 changed files with 37 additions and 11 deletions
+1
View File
@@ -837,6 +837,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("nameplates", "debuffs", "blacklist", "")
pfUI:UpdateConfig("nameplates", "debuffs", "showstacks", "0")
pfUI:UpdateConfig("nameplates", "debuffs", "position", "BOTTOM")
pfUI:UpdateConfig("nameplates", nil, "debuffanim", "0")
pfUI:UpdateConfig("abuttons", nil, "enable", "1")
pfUI:UpdateConfig("abuttons", nil, "position", "bottom")
+23 -2
View File
@@ -744,7 +744,17 @@ function pfUI.uf:UpdateConfig()
f.buffs[i].stacks:SetShadowOffset(0.8, -0.8)
f.buffs[i].stacks:SetTextColor(1,1,.5)
f.buffs[i].cd = f.buffs[i].cd or CreateFrame(COOLDOWN_FRAME_TYPE, f.buffs[i]:GetName() .. "Cooldown", f.buffs[i], "CooldownFrameTemplate")
-- Create CD frame if it doesn't exist
if not f.buffs[i].cd then
f.buffs[i].cd = CreateFrame(COOLDOWN_FRAME_TYPE, f.buffs[i]:GetName() .. "Cooldown", f.buffs[i], "CooldownFrameTemplate")
end
-- Always update CD properties (in case size changed)
local cdScale = f.config.buffsize / 32
f.buffs[i].cd:ClearAllPoints()
f.buffs[i].cd:SetScale(cdScale)
f.buffs[i].cd:SetAllPoints(f.buffs[i])
f.buffs[i].cd:SetFrameLevel(14)
f.buffs[i].cd.pfCooldownType = "ALL"
f.buffs[i].cd.pfCooldownStyleText = cooldown_text
f.buffs[i].cd.pfCooldownStyleAnimation = cooldown_anim
@@ -825,7 +835,18 @@ function pfUI.uf:UpdateConfig()
f.debuffs[i].stacks:SetShadowColor(0, 0, 0)
f.debuffs[i].stacks:SetShadowOffset(0.8, -0.8)
f.debuffs[i].stacks:SetTextColor(1,1,.5)
f.debuffs[i].cd = f.debuffs[i].cd or CreateFrame(COOLDOWN_FRAME_TYPE, f.debuffs[i]:GetName() .. "Cooldown", f.debuffs[i], "CooldownFrameTemplate")
-- Create CD frame if it doesn't exist
if not f.debuffs[i].cd then
f.debuffs[i].cd = CreateFrame(COOLDOWN_FRAME_TYPE, f.debuffs[i]:GetName() .. "Cooldown", f.debuffs[i], "CooldownFrameTemplate")
end
-- Always update CD properties (in case size changed)
local cdScale = f.config.debuffsize / 32
f.debuffs[i].cd:ClearAllPoints()
f.debuffs[i].cd:SetScale(cdScale)
f.debuffs[i].cd:SetAllPoints(f.debuffs[i])
f.debuffs[i].cd:SetFrameLevel(14)
f.debuffs[i].cd.pfCooldownType = "ALL"
f.debuffs[i].cd.pfCooldownStyleText = cooldown_text
f.debuffs[i].cd.pfCooldownStyleAnimation = cooldown_anim
+3 -1
View File
@@ -112,9 +112,11 @@ pfUI:RegisterModule("cooldown", "vanilla:tbc", function ()
start, duration = 0, 0
end
-- hide animation
-- handle animation visibility
if this.pfCooldownStyleAnimation == 0 then
this:SetAlpha(0)
elseif this.pfCooldownStyleAnimation == 1 then
this:SetAlpha(1)
elseif not this.pfCooldownStyleAnimation and C.appearance.cd.hideanim == "1" then
this:SetAlpha(0)
end
+1
View File
@@ -2356,6 +2356,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(U["nameplates"], T["Debuff Icon Size"], C.nameplates, "debuffsize")
CreateConfig(U["nameplates"], T["Estimate Debuffs"], C.nameplates, "guessdebuffs", "checkbox")
CreateConfig(U["nameplates"], T["Show Debuff Stacks"], C.nameplates.debuffs, "showstacks", "checkbox")
CreateConfig(U["nameplates"], T["Show Timer Animation"], C.nameplates, "debuffanim", "checkbox")
CreateConfig(U["nameplates"], T["Only Show Own Debuffs (|cffffaaaaExperimental|r)"], C.nameplates, "selfdebuff", "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")
+9 -8
View File
@@ -300,19 +300,19 @@ pfUI:RegisterModule("nameplates", "vanilla", function ()
plate.debuffs[index].stacks:SetJustifyV("BOTTOM")
plate.debuffs[index].stacks:SetTextColor(1,1,0)
-- Read config for cooldown animation
local cooldown_anim = tonumber(C.nameplates.debuffanim) or 0
if pfUI.client <= 11200 then
-- create a fake animation frame on vanilla to improve performance
plate.debuffs[index].cd = CreateFrame("Frame", plate.platename.."Debuff"..index.."Cooldown", plate.debuffs[index])
plate.debuffs[index].cd:SetScript("OnUpdate", CooldownFrame_OnUpdateModel)
plate.debuffs[index].cd.AdvanceTime = DoNothing
plate.debuffs[index].cd.SetSequence = DoNothing
plate.debuffs[index].cd.SetSequenceTime = DoNothing
-- Use Model frame with CooldownFrameTemplate for proper pie animation in Vanilla
plate.debuffs[index].cd = CreateFrame("Model", plate.platename.."Debuff"..index.."Cooldown", plate.debuffs[index], "CooldownFrameTemplate")
plate.debuffs[index].cd:SetAllPoints(plate.debuffs[index])
else
-- use regular cooldown animation frames on burning crusade and later
plate.debuffs[index].cd = CreateFrame(COOLDOWN_FRAME_TYPE, plate.platename.."Debuff"..index.."Cooldown", plate.debuffs[index], "CooldownFrameTemplate")
end
plate.debuffs[index].cd.pfCooldownStyleAnimation = 0
plate.debuffs[index].cd.pfCooldownStyleAnimation = cooldown_anim
plate.debuffs[index].cd.pfCooldownType = "ALL"
end
@@ -1000,7 +1000,8 @@ pfUI:RegisterModule("nameplates", "vanilla", function ()
end
if duration and timeleft and debuffdurations then
plate.debuffs[index].cd:SetAlpha(0)
local cooldown_anim = tonumber(C.nameplates.debuffanim) or 0
plate.debuffs[index].cd:SetAlpha(cooldown_anim == 1 and 1 or 0)
plate.debuffs[index].cd:Show()
CooldownFrame_SetTimer(plate.debuffs[index].cd, GetTime() + timeleft - duration, duration, 1)
end