Files
bdot89andClaude Opus 5.5 b976597f09 Raid and world map switches, colour picker check, dragon end art, Buffs section
- Blizzard switches for raid frames and the world map (strip has room for three)
- Test that every colour setting has a picker; swing mark colours are settings now
- End art: the client's gold, elite and silver dragons, one or both ends, mirror, preview
- Buffs section: one page with a preview, replacing pfUI's five Buffs pages
- Layout mode's buff boxes open the new page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 05:14:44 +01:00

81 lines
3.3 KiB
Lua

pfUI:RegisterModule("gryphons", "vanilla:tbc", function ()
pfUI.gryphons = {
frames = {
left = CreateFrame("Frame"),
right = CreateFrame("Frame"),
}
}
pfUI.gryphons.textures = {
["None"] = nil,
["Gryphon"] = "Interface\\MainMenuBar\\UI-MainMenuBar-EndCap-Dwarf",
["Lion"] = "Interface\\MainMenuBar\\UI-MainMenuBar-EndCap-Human",
}
-- octo (24 Oct 2026): more of the client's own art for the bar ends (every
-- path checked in the MPQ listfiles). coords = the part of the texture that
-- is the picture; each one looks right as stored, so the left end shows it
-- as it is and the right end mirrored (C.bars.gryphons.mirror swaps that)
pfUI.gryphons.art = {
{ key = "Gryphon", label = "Gryphon", tex = "Interface\\MainMenuBar\\UI-MainMenuBar-EndCap-Dwarf" },
{ key = "Lion", label = "Lion", tex = "Interface\\MainMenuBar\\UI-MainMenuBar-EndCap-Human" },
{ key = "Dragon", label = "Gold dragon", tex = "Interface\\DialogFrame\\UI-DialogBox-Gold-Dragon" },
{ key = "Dragon2", label = "Rising dragon", tex = "Interface\\DialogFrame\\UI-DialogBox-Gold-Dragon2", coords = { 0, .87, 0, .78 } },
{ key = "Elite", label = "Elite dragon", tex = "Interface\\TargetingFrame\\UI-TargetingFrame-Elite", coords = { .56, 1, 0, .85 } },
{ key = "Rare", label = "Silver dragon", tex = "Interface\\TargetingFrame\\UI-TargetingFrame-Rare", coords = { .56, 1, 0, .85 } },
}
for _, a in ipairs(pfUI.gryphons.art) do
pfUI.gryphons.textures[a.key] = a.tex
a.coords = a.coords or { 0, 1, 0, 1 }
end
function pfUI.gryphons.Art(key)
for _, a in ipairs(pfUI.gryphons.art) do if a.key == key then return a end end
end
pfUI.gryphons.UpdateConfig = function()
local set = C.bars.gryphons
local art = pfUI.gryphons.Art(set.texture)
for position, frame in pairs(pfUI.gryphons.frames) do
local anchor = _G[set["anchor_"..position]]
local texture = art and art.tex
local r, g, b, a = GetStringColor(set.color)
local size = tonumber(set.size) or 50
local offset_h = tonumber(set.offset_h) or 0
local offset_v = tonumber(set.offset_v) or 0
local relative = "BOTTOM"..string.upper(position)
local c = art and art.coords or { 0, 1, 0, 1 }
-- the picture's own shape (crops are not square)
local aspect = math.max(.2, (c[2] - c[1]) / math.max(.01, c[4] - c[3]))
local sides = set.sides or "both"
frame:SetParent(anchor)
frame:SetWidth(size * aspect)
frame:SetHeight(size)
frame:ClearAllPoints()
frame:SetPoint(relative, anchor, relative, (position == "right" and -1 or 1) * offset_h, offset_v)
frame:SetFrameLevel(128)
frame.texture = frame.texture or frame:CreateTexture(nil, "OVERLAY")
frame.texture:SetTexture(texture)
frame.texture:SetVertexColor(r, g, b, a)
frame.texture:SetAllPoints()
local mirror = position == "right"
if set.mirror == "1" then mirror = not mirror end
if mirror then
frame.texture:SetTexCoord(c[2], c[1], c[3], c[4])
else
frame.texture:SetTexCoord(c[1], c[2], c[3], c[4])
end
if texture and anchor and (sides == "both" or sides == position) then
frame:Show()
else
frame:Hide()
end
end
end
pfUI.gryphons.UpdateConfig()
end)