mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-31 07:56:57 +00:00
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:
+8
-4
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user