Files
pfUI/skins/blizzard/spellbook.lua
T
Brues 001e09c1b7 Pick cooldown timers per feature with one dropdown
Each feature's settings page now picks its own timers - None, Numbers,
Sweep, or Numbers And Sweep - in place of the "Show Numbers On", "Show
Sweep On" and "Reverse Sweep On" lists on Settings -> Cooldown. Unit
frames get theirs per frame again ("Buff And Debuff Timers" and
"Indicator Timers"), so party and pet can drop their numbers while the
target keeps them. The other dropdowns sit on Action Bars, Bags & Bank,
Buff/Debuff Icons, Totem Icons, Tooltip and Nameplates.

Settings -> Cooldown keeps the shared font, size, threshold, tenths and
colors, plus the timers of Spellbook And Character, Loss Of Control and
Other Addons, which have no page of their own.

CreateCooldown(parent, kind, config, key, name) reads its mode from
config[key]. The kind says only what it times: "spell" hides numbers on
the global cooldown, "aura" drains its sweep, "timer" fills it. The
reverse option is gone; the direction follows the kind.

The migration carries every old setting into its timers: the
C.cooldown kind tables, appearance.cd's foreign and Blizzard toggles,
the buff frame's sweep, the nameplate debuff options, and each unit
frame's timer text, sweep and "Show Time Left" from before the kinds,
so frames that had their own settings keep them. Reverse options are
dropped.
2026-11-02 16:07:41 -06:00

75 lines
2.9 KiB
Lua

pfUI:RegisterSkin("Spellbook", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
StripTextures(SpellBookFrame)
CreateBackdrop(SpellBookFrame, nil, nil, .75)
CreateBackdropShadow(SpellBookFrame)
SpellBookFrame.backdrop:SetPoint("TOPLEFT", 10, -10)
SpellBookFrame.backdrop:SetPoint("BOTTOMRIGHT", -30, 72)
SpellBookFrame:SetHitRectInsets(10,30,10,72)
EnableMovable(SpellBookFrame)
SpellBookTitleText:ClearAllPoints()
SpellBookTitleText:SetPoint("TOP", SpellBookFrame.backdrop, "TOP", 0, -10)
SpellBookFrameTabButton1:ClearAllPoints()
SpellBookFrameTabButton1:SetPoint("TOPLEFT", SpellBookFrame.backdrop, "BOTTOMLEFT", bpad, -(border + (border == 1 and 1 or 2)))
for i=1, 3 do
local tab = _G["SpellBookFrameTabButton"..i]
local lastTab = _G["SpellBookFrameTabButton"..(i-1)]
if lastTab then
tab:ClearAllPoints()
tab:SetPoint("LEFT", lastTab, "RIGHT", border*2 + 1, 0)
end
SkinTab(tab)
end
for i=1,SPELLS_PER_PAGE do
local button = _G["SpellButton"..i]
local texture = _G["SpellButton"..i.."IconTexture"]
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] = CreateCooldown(button, "spell", C.cooldown, "blizzard_timers", cdname)
_G["SpellButton"..i.."SubSpellName"]:SetTextColor(1, 1, 1)
_G["SpellButton"..i.."AutoCastable"]:SetTexture("Interface\\Buttons\\UI-AutoCastableOverlay")
_G["SpellButton"..i.."Highlight"]:SetTexture("")
_G["SpellButton"..i.."Highlight"].SetTexture = function(self, tex) return end
end
SpellBookSkillLineTab1:ClearAllPoints()
SpellBookSkillLineTab1:SetPoint("TOPLEFT", SpellBookFrame.backdrop, "TOPRIGHT", border + (border == 1 and 1 or 2), -30)
for i = 1, MAX_SKILLLINE_TABS do
local button = _G["SpellBookSkillLineTab"..i]
local lastbutton = _G["SpellBookSkillLineTab"..(i-1)]
local texture = _G["SpellBookSkillLineTab"..i]:GetNormalTexture()
StripTextures(button)
SkinButton(button, nil, nil, nil, texture)
button:SetScale(1.1)
texture:SetTexCoord(.07,.93,.07,.93)
if lastbutton then
button:ClearAllPoints()
button:SetPoint("TOP", lastbutton, "BOTTOM", 0, - (border + (border == 1 and 1 or 2) + bpad))
end
end
SkinArrowButton(SpellBookPrevPageButton, "left", 18)
SkinArrowButton(SpellBookNextPageButton, "right", 18)
SkinCloseButton(SpellBookCloseButton, SpellBookFrame.backdrop, -6, -6)
SpellBookPageText:SetTextColor(1, 1, 1)
end)