Give spellbook buttons a native Cooldown and fix the bag slot one

Spell buttons kept the template's indicator Model for their sweep. The
Spellbook skin now creates a native Cooldown for each one.

Taking the "<button>Cooldown" name was meant to point the FrameXML
lookups at the new frame, but 1.12 binds a frame's name only while that
global is unset. The bag slot Cooldowns from a721f788 were never used:
ContainerFrame_UpdateCooldown still drove the Model, so bags lost their
timer text, ignored Reverse Cooldown Animation and were hidden by Hide
Foreign Cooldown Animations. Both places now rebind the global by hand.
This commit is contained in:
Brues
2026-10-30 12:09:19 -05:00
parent a96a3dbd87
commit efe6ec6080
2 changed files with 16 additions and 4 deletions
+8 -4
View File
@@ -416,11 +416,15 @@ pfUI:RegisterModule("bags", function ()
pfUI.bags[bag].slots[slot].frame:SetID(slot)
-- native cooldown frame: the bank template has none and the bag
-- template's is 1.12's indicator Model, which can't reverse. Taking the
-- "<button>Cooldown" name points ContainerFrame_UpdateCooldown at it;
-- the Model starts hidden and nothing reaches it after that
-- template's is 1.12's indicator Model, which can't reverse.
-- ContainerFrame_UpdateCooldown reads the "<button>Cooldown" global.
-- 1.12 binds a frame's name only while that global is unset, so the
-- global is rebound by hand; the Model starts hidden and nothing
-- reaches it after that
local slotframe = pfUI.bags[bag].slots[slot].frame
slotframe.cd = CreateFrame("Cooldown", slotframe:GetName() .. "Cooldown", slotframe, "CooldownFrameTemplate")
local cdname = slotframe:GetName() .. "Cooldown"
slotframe.cd = CreateFrame("Cooldown", cdname, slotframe, "CooldownFrameTemplate")
_G[cdname] = slotframe.cd
slotframe.cd.pfCooldownStyleAnimation = 1
slotframe.cd:SetReverse(C.appearance.bags.cooldown_reverse == "1")
slotframe.cd.pfCooldownType = "NOGCD"
+8
View File
@@ -33,6 +33,14 @@ pfUI:RegisterSkin("Spellbook", function ()
StripTextures(button)
SkinButton(button, nil, nil, nil, texture)
-- native cooldown frame in place of the template's indicator Model.
-- SpellButton_UpdateButton reads the "<button>Cooldown" global on every
-- update. 1.12 binds a frame's name only while that global is unset, so
-- the global is rebound by hand; the Model starts hidden and nothing
-- reaches it after that
local cdname = "SpellButton"..i.."Cooldown"
_G[cdname] = CreateFrame("Cooldown", cdname, button, "CooldownFrameTemplate")
_G["SpellButton"..i.."SubSpellName"]:SetTextColor(1, 1, 1)
_G["SpellButton"..i.."AutoCastable"]:SetTexture("Interface\\Buttons\\UI-AutoCastableOverlay")
_G["SpellButton"..i.."Highlight"]:SetTexture("")