Add a Talents skin entry with an enable switch and per-window scale

The talent window, the Vanity and Wardrobe windows it switches between and
the tab row along its bottom are one feature to the player, so they get one
entry in the Skins tree and one master switch gating all three
Initialize calls together. Skinning one of them without the others reads as
a bug.

Scale is a slider per window, 0.5 to 1.5, applied as a multiplier on the
existing scale rather than an absolute -- the three don't ship at the same
size (the vanity store's frame runs about 9% larger than the others), and
that is the server's choice to keep. A setting of 1.0 leaves everything
exactly as it was.

The scale is set on Collections, not on the window itself. All three
windows and the tab row are its children, and it is the only one of them
with mouse enabled -- it is what the player drags. Scaling a window
directly left the drag target at full size, so a shrunk window had to be
grabbed by clicking outside itself, and the tab row, not being a child of
any window, kept whichever size the first-opened one gave it. Scaling the
container moves its hit area with it and the tabs follow as children.
This commit is contained in:
2026-08-17 22:37:53 +02:00
parent 766e561839
commit 964f88559d
5 changed files with 174 additions and 25 deletions
+82 -8
View File
@@ -18,6 +18,14 @@ local defaults = {
skins = {
extraActionButton = true,
instanceSwap = true,
talentFrames = {
enable = true,
-- Multipliers on each frame's own scale, so 1 is "as the server
-- built it" rather than a fixed size.
talentScale = 1,
vanityScale = 1,
wardrobeScale = 1,
},
},
extraActionButtonSize = 52,
instanceButtonFont = "PT Sans Narrow",
@@ -39,6 +47,7 @@ function CoA:RefreshConfig()
if self.UpdateInstanceButtonFont then self:UpdateInstanceButtonFont() end
if self.UpdateDispelHighlight then self:UpdateDispelHighlight() end
if self.UpdateClassResourceVisibility then self:UpdateClassResourceVisibility() end
if self.UpdateFrameScales then self:UpdateFrameScales() end
end
CoA:RegisterEvent("ADDON_LOADED", function(_, addon)
@@ -66,6 +75,28 @@ CoA:RegisterEvent("ADDON_LOADED", function(_, addon)
CoA.db.RegisterCallback(CoA, "OnProfileReset", "RefreshConfig")
end)
-- One slider per window rather than a single shared one: the three don't ship
-- at the same scale, so a shared value would only line them up by flattening
-- the difference the server built in.
local function scaleOption(order, name, key)
return {
order = order,
type = "range",
name = name,
min = 0.5,
max = 1.5,
step = 0.01,
get = function() return CoA.db.profile.skins.talentFrames[key] end,
set = function(_, value)
CoA.db.profile.skins.talentFrames[key] = value
if CoA.UpdateFrameScales then
CoA:UpdateFrameScales()
end
end,
}
end
local function getOptions()
local profiles = AceDBOptions:GetOptionsTable(CoA.db)
profiles.order = 5
@@ -205,6 +236,45 @@ local function getOptions()
},
},
},
-- One entry for the whole talent window: its own frame, the
-- tab row along its bottom, and the Vanity and Wardrobe
-- windows those tabs open. They're separate frames but one
-- feature to the player, and they're skinned as a set.
talents = {
order = 3,
type = "group",
name = "Talents",
args = {
header = {
order = 1,
type = "header",
name = "Talents",
},
enable = {
order = 2,
type = "toggle",
name = "Enable",
desc = "Skin the talent window, its tabs, and the Vanity and Wardrobe windows. Requires a UI reload.",
get = function() return CoA.db.profile.skins.talentFrames.enable end,
set = function(_, value)
CoA.db.profile.skins.talentFrames.enable = value
E:StaticPopup_Show("CONFIG_RL")
end,
},
scale = {
order = 3,
type = "group",
inline = true,
name = "Scale",
disabled = function() return not CoA.db.profile.skins.talentFrames.enable end,
args = {
talentScale = scaleOption(1, "Talents", "talentScale"),
vanityScale = scaleOption(2, "Vanity", "vanityScale"),
wardrobeScale = scaleOption(3, "Wardrobe", "wardrobeScale"),
},
},
},
},
},
},
classResources = {
@@ -427,16 +497,20 @@ function CoA:Initialize()
self:InitializeClassResources()
end
if self.InitializeTalentFrame then
self:InitializeTalentFrame()
end
-- One switch for all three: the vanity and wardrobe windows are the talent
-- frame's own tabs, so skinning one without the others reads as a bug.
if skins.talentFrames.enable then
if self.InitializeTalentFrame then
self:InitializeTalentFrame()
end
if self.InitializeVanityFrame then
self:InitializeVanityFrame()
end
if self.InitializeVanityFrame then
self:InitializeVanityFrame()
end
if self.InitializeWardrobeFrame then
self:InitializeWardrobeFrame()
if self.InitializeWardrobeFrame then
self:InitializeWardrobeFrame()
end
end
end