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:
+8
-16
@@ -4,8 +4,6 @@ local CoA = E:GetModule("CoA")
|
||||
local Skin = CoA.Skin
|
||||
|
||||
local FRAME_NAME = "CoATalentFrame"
|
||||
local TAB_NAME = "CollectionsPoolFrameCollectionTabTemplate%d"
|
||||
local MAX_TABS = 10
|
||||
|
||||
-- The talent tree is the one part of the frame we must not touch: every node
|
||||
-- is an icon button whose border/overlay textures encode rank and
|
||||
@@ -595,20 +593,12 @@ local function CropBackground()
|
||||
end
|
||||
end
|
||||
|
||||
-- Tabs go through the shared handler (see Skinning.lua) so they come out
|
||||
-- identical to the wardrobe's category tabs. The talent frame is passed as the
|
||||
-- level parent because, unlike those, these tabs aren't its children -- they're
|
||||
-- separately-placed siblings, so once grown their top edge pokes up behind the
|
||||
-- frame's own panel art unless they're raised above it.
|
||||
-- The tab row is shared with the vanity and wardrobe windows and is handled in
|
||||
-- Skinning.lua. The talent frame is passed as its owner while this window is
|
||||
-- the open one: the tabs aren't its children, so they don't draw above its
|
||||
-- panel on their own.
|
||||
local function SkinTabs()
|
||||
local frame = _G[FRAME_NAME]
|
||||
|
||||
for i = 1, MAX_TABS do
|
||||
local tab = _G[TAB_NAME:format(i)]
|
||||
if not tab then break end
|
||||
|
||||
Skin:Tab(tab, frame)
|
||||
end
|
||||
Skin:CollectionTabs(_G[FRAME_NAME])
|
||||
end
|
||||
|
||||
local SPEC_CHOICE = FRAME_NAME.."SpecViewPoolFrameCoASpecChoiceTemplate%d"
|
||||
@@ -658,7 +648,8 @@ local function SkinFrame(frame)
|
||||
-- run again on every show rather than once at hook time. The isSkinned
|
||||
-- / backdrop guards inside ElvUI's handlers make re-runs cheap.
|
||||
frame:HookScript("OnShow", function(self)
|
||||
Skin:Title(_G[FRAME_NAME.."TitleText"])
|
||||
Skin:ApplyWindowScale("talentScale")
|
||||
Skin:Title(_G[FRAME_NAME.."TitleText"])
|
||||
SkinCloseButton(self)
|
||||
SkinBottomBar()
|
||||
CropBackground()
|
||||
@@ -668,6 +659,7 @@ local function SkinFrame(frame)
|
||||
end)
|
||||
end
|
||||
|
||||
Skin:ApplyWindowScale("talentScale")
|
||||
Skin:Title(_G[FRAME_NAME.."TitleText"])
|
||||
SkinCloseButton(frame)
|
||||
SkinBottomBar()
|
||||
|
||||
Reference in New Issue
Block a user