11local T , C , L = unpack ((select (2 , ... )))
22
33--[[ This datatext is from: SanUI, by Pyrates ]] --
4+ local GameTooltip = _G .GameTooltip
45
56local DataText = T [" DataTexts" ]
67
78local CurrentLootSpecName
89local CurrentCharSpecName
910
1011local 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 )
2927end
3028
3129local OnLeave = function ()
3230 GameTooltip :Hide ()
3331end
3432
35-
3633local OnEnter = function (self )
3734 self :Update ()
3835
@@ -45,21 +42,19 @@ local OnEnter = function(self)
4542 GameTooltip :Show ()
4643end
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
6459end
6560
0 commit comments