@@ -3,11 +3,13 @@ local S = E:GetModule('Skins')
3
3
4
4
local _G = _G
5
5
local unpack = unpack
6
+ local tinsert = tinsert
6
7
local strfind = strfind
7
8
local hooksecurefunc = hooksecurefunc
8
9
9
10
local CreateFrame = CreateFrame
10
11
local GetNumTalents = GetNumTalents
12
+ local HasPetUI = HasPetUI
11
13
12
14
local function GlyphFrame_Update ()
13
15
local glyphFrame = _G .GlyphFrame
@@ -64,20 +66,21 @@ local function GlyphFrameGlyph_OnUpdate(updater)
64
66
end
65
67
end
66
68
69
+ local TalentTabs = {}
67
70
local function HandleTabs ()
68
- _G .PlayerTalentFrameTab1 :ClearAllPoints ()
69
-
70
71
local lastTab
71
- for index , tab in next , { _G .PlayerTalentFrameTab1 , HasPetUI () and _G .PlayerTalentFrameTab2 or nil , _G .PlayerTalentFrameTab3 } do
72
- tab :ClearAllPoints ()
72
+ for index , tab in next , TalentTabs do
73
+ if index ~= 2 or HasPetUI () then
74
+ tab :ClearAllPoints ()
75
+
76
+ if index == 1 then
77
+ tab :Point (' TOPLEFT' , _G .PlayerTalentFrame , ' BOTTOMLEFT' , - 10 , 0 )
78
+ else
79
+ tab :Point (' TOPLEFT' , lastTab , ' TOPRIGHT' , - 19 , 0 )
80
+ end
73
81
74
- if index == 1 then
75
- tab :Point (' TOPLEFT' , PlayerTalentFrame , ' BOTTOMLEFT' , - 10 , 0 )
76
- else
77
- tab :Point (' TOPLEFT' , lastTab , ' TOPRIGHT' , - 19 , 0 )
82
+ lastTab = tab
78
83
end
79
-
80
- lastTab = tab
81
84
end
82
85
end
83
86
@@ -240,7 +243,9 @@ function S:Blizzard_TalentUI()
240
243
241
244
-- Tabs
242
245
for i = 1 , 3 do
243
- S :HandleTab (_G [' PlayerTalentFrameTab' .. i ])
246
+ local tab = _G [' PlayerTalentFrameTab' .. i ]
247
+ tinsert (TalentTabs , tab )
248
+ S :HandleTab (tab )
244
249
end
245
250
246
251
for i = 1 , 2 do
@@ -254,7 +259,7 @@ function S:Blizzard_TalentUI()
254
259
normal :SetTexCoord (unpack (E .TexCoords ))
255
260
end
256
261
257
- hooksecurefunc (' PlayerTalentFrame_UpdateTabs' , function () HandleTabs () end )
262
+ hooksecurefunc (' PlayerTalentFrame_UpdateTabs' , HandleTabs )
258
263
end
259
264
260
265
function S :Blizzard_GlyphUI ()
0 commit comments