Skip to content

Commit 2a2ee55

Browse files
committed
clean up tabs in talents a bit
1 parent 310d341 commit 2a2ee55

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

ElvUI/Cata/Modules/Skins/Talent.lua

+17-12
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ local S = E:GetModule('Skins')
33

44
local _G = _G
55
local unpack = unpack
6+
local tinsert = tinsert
67
local strfind = strfind
78
local hooksecurefunc = hooksecurefunc
89

910
local CreateFrame = CreateFrame
1011
local GetNumTalents = GetNumTalents
12+
local HasPetUI = HasPetUI
1113

1214
local function GlyphFrame_Update()
1315
local glyphFrame = _G.GlyphFrame
@@ -64,20 +66,21 @@ local function GlyphFrameGlyph_OnUpdate(updater)
6466
end
6567
end
6668

69+
local TalentTabs = {}
6770
local function HandleTabs()
68-
_G.PlayerTalentFrameTab1:ClearAllPoints()
69-
7071
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
7381

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
7883
end
79-
80-
lastTab = tab
8184
end
8285
end
8386

@@ -240,7 +243,9 @@ function S:Blizzard_TalentUI()
240243

241244
-- Tabs
242245
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)
244249
end
245250

246251
for i = 1, 2 do
@@ -254,7 +259,7 @@ function S:Blizzard_TalentUI()
254259
normal:SetTexCoord(unpack(E.TexCoords))
255260
end
256261

257-
hooksecurefunc('PlayerTalentFrame_UpdateTabs', function() HandleTabs() end)
262+
hooksecurefunc('PlayerTalentFrame_UpdateTabs', HandleTabs)
258263
end
259264

260265
function S:Blizzard_GlyphUI()

0 commit comments

Comments
 (0)