nameplate animation

- If debuff animation timer is loaded it loads "COOLDOWN_FRAME_TYPE" (more heave for performance)
- If  debuff animation disabled it loads normal frames for the timer display.
This commit is contained in:
Meow
2026-01-29 06:17:06 +01:00
parent 52e2755243
commit df550cf9e2
2 changed files with 25 additions and 12 deletions
+1 -1
View File
@@ -2357,7 +2357,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(U["nameplates"], T["Show Debuff Stacks"], C.nameplates.debuffs, "showstacks", "checkbox")
CreateConfig(U["nameplates"], T["Enable Debuff Timers"], C.nameplates, "debufftimers", "checkbox")
CreateConfig(U["nameplates"], T["Show Timer Text"], C.nameplates, "debufftext", "checkbox")
CreateConfig(U["nameplates"], T["Show Timer Animation"], C.nameplates, "debuffanim", "checkbox")
CreateConfig(nil, 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")
+24 -11
View File
@@ -303,17 +303,26 @@ pfUI:RegisterModule("nameplates", "vanilla", function ()
local cooldown_text = tonumber(C.nameplates.debufftext) or 1
if pfUI.client <= 11200 then
-- 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
-- Animation enabled: Use Model frame with CooldownFrameTemplate
plate.debuffs[index].cd = CreateFrame(COOLDOWN_FRAME_TYPE, plate.platename.."Debuff"..index.."Cooldown", plate.debuffs[index], "CooldownFrameTemplate")
plate.debuffs[index].cd:SetAllPoints(plate.debuffs[index])
plate.debuffs[index].cd.pfCooldownStyleAnimation = 1
plate.debuffs[index].cd.pfCooldownStyleText = cooldown_text
plate.debuffs[index].cd.pfCooldownType = "ALL"
else
-- Animation disabled: Create fake cooldown frame for performance (like ShaguPlates)
plate.debuffs[index].cd = CreateFrame("Frame", plate.platename.."Debuff"..index.."Cooldown", plate.debuffs[index])
plate.debuffs[index].cd:SetAllPoints(plate.debuffs[index])
-- Add dummy functions so CooldownFrame_SetTimer doesn't crash
plate.debuffs[index].cd.AdvanceTime = DoNothing
plate.debuffs[index].cd.SetSequence = DoNothing
plate.debuffs[index].cd.SetSequenceTime = DoNothing
plate.debuffs[index].cd.pfCooldownStyleAnimation = 0
plate.debuffs[index].cd.pfCooldownStyleText = cooldown_text
plate.debuffs[index].cd.pfCooldownType = "ALL"
end
plate.debuffs[index].cd.pfCooldownStyleAnimation = cooldown_anim
plate.debuffs[index].cd.pfCooldownStyleText = cooldown_text
plate.debuffs[index].cd.pfCooldownType = "ALL"
end
local function UpdateDebuffConfig(nameplate, i)
@@ -1000,11 +1009,15 @@ pfUI:RegisterModule("nameplates", "vanilla", function ()
end
if duration and timeleft and C.nameplates.debufftimers == "1" then
-- Read config values for cooldown display
local cooldown_anim = tonumber(C.nameplates.debuffanim) or 0
local cooldown_text = tonumber(C.nameplates.debufftext) or 1
plate.debuffs[index].cd.pfCooldownStyleAnimation = cooldown_anim
-- Ensure cooldown flags are set
plate.debuffs[index].cd.pfCooldownStyleText = cooldown_text
plate.debuffs[index].cd:SetAlpha(cooldown_anim == 1 and 1 or 0)
plate.debuffs[index].cd.pfCooldownStyleAnimation = cooldown_anim
plate.debuffs[index].cd.pfCooldownType = "ALL"
plate.debuffs[index].cd:Show()
CooldownFrame_SetTimer(plate.debuffs[index].cd, GetTime() + timeleft - duration, duration, 1)
end