Skip to content

Commit fd98bdc

Browse files
author
JerichoR
committed
Loads the new spec and talent UI on click.
LeftButton -> Specialization pane Any other button -> Talents pane
1 parent 57a6c97 commit fd98bdc

1 file changed

Lines changed: 17 additions & 22 deletions

File tree

Tukui/Modules/DataTexts/Elements/Talents.lua

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,35 @@
11
local T, C, L = unpack((select(2, ...)))
22

33
--[[ This datatext is from: SanUI, by Pyrates ]] --
4+
local GameTooltip = _G.GameTooltip
45

56
local DataText = T["DataTexts"]
67

78
local CurrentLootSpecName
89
local CurrentCharSpecName
910

1011
local Update = function(self)
11-
local CurrentLootSpec = GetLootSpecialization()
1212
local CurrentSpec = GetSpecialization()
13+
local CurrentLootSpec = GetLootSpecialization()
1314

14-
CurrentLootSpecName = CurrentLootSpec and select(2, GetSpecializationInfoByID(CurrentLootSpec))
15-
16-
CurrentCharSpecName = CurrentSpec and select(2, GetSpecializationInfo(CurrentSpec))
15+
if CurrentSpec then
16+
CurrentCharSpecName = select(2, GetSpecializationInfo(CurrentSpec))
17+
CurrentLootSpecName = CurrentLootSpec == 0 and CurrentCharSpecName or select(2, GetSpecializationInfoByID(CurrentLootSpec))
1718

18-
if (CurrentLootSpec ~=0 and CurrentLootSpecName == nil) or CurrentCharSpecName == nil then
19+
if CurrentCharSpecName and CurrentLootSpecName then
20+
self.Text:SetText("S " .. CurrentCharSpecName .. " - L " .. CurrentLootSpecName)
21+
else
22+
self.Text:SetText("+--+")
23+
end
24+
else
1925
self.Text:SetText("+--+")
20-
21-
return
2226
end
23-
24-
if CurrentLootSpec == 0 then
25-
CurrentLootSpecName = CurrentCharSpecName
26-
end
27-
28-
self.Text:SetText(CurrentCharSpecName)
2927
end
3028

3129
local OnLeave = function()
3230
GameTooltip:Hide()
3331
end
3432

35-
3633
local OnEnter = function(self)
3734
self:Update()
3835

@@ -45,21 +42,19 @@ local OnEnter = function(self)
4542
GameTooltip:Show()
4643
end
4744

48-
local OnMouseDown = function()
45+
local OnMouseDown = function(self, button)
4946
if InCombatLockdown() then
5047
T.Print(ERR_NOT_IN_COMBAT)
5148

5249
return
5350
end
5451

55-
if not PlayerTalentFrame then
56-
LoadAddOn("Blizzard_TalentUI")
57-
end
58-
59-
if not PlayerTalentFrame:IsShown() then
60-
ShowUIPanel(PlayerTalentFrame)
52+
if button == "LeftButton" then
53+
-- Opens Specialization pane
54+
PlayerSpellsUtil.TogglePlayerSpellsFrame(1)
6155
else
62-
HideUIPanel(PlayerTalentFrame)
56+
-- Opens Talents pane
57+
PlayerSpellsUtil.TogglePlayerSpellsFrame(2)
6358
end
6459
end
6560

0 commit comments

Comments
 (0)