Skip to content

Commit

Permalink
update dualspec lua
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Apr 7, 2024
1 parent d4a36bd commit 4d3d11e
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions ElvUI/Core/Modules/DataTexts/DualSpec.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
local E, L, V, P, G = unpack(ElvUI)
local DT = E:GetModule('DataTexts')

if not (E.Wrath or E.ClassicSOD) then return end

local _G = _G
local format, strjoin = format, strjoin
local HideUIPanel = HideUIPanel
Expand All @@ -29,7 +27,7 @@ local function BuildTalentString(talentGroup)

for i = 1, MAX_TALENT_TABS do
local _, _, pointsSpent = GetTalentTabInfo(i, false, false, talentGroup)
if (str == '') then
if str == '' then
str = pointsSpent
else
str = strjoin('/', str, pointsSpent)
Expand Down Expand Up @@ -59,10 +57,12 @@ end
local function OnEnter()
DT.tooltip:ClearLines()

DT.tooltip:AddDoubleLine(format('%s: %s', ColorText(PRIMARY, activeGroup == 1 and '0CD809' or 'FFFFFF'), primaryStr))
local primary = format('%s: %s', ColorText(PRIMARY, activeGroup == 1 and '0CD809' or 'FFFFFF'), primaryStr)
DT.tooltip:AddDoubleLine(primary)

if hasDualSpec then
DT.tooltip:AddDoubleLine(format('%s: %s', ColorText(SECONDARY, activeGroup == 2 and '0CD809' or 'FFFFFF'), secondaryStr))
local secondary = format('%s: %s', ColorText(SECONDARY, activeGroup == 2 and '0CD809' or 'FFFFFF'), secondaryStr)
DT.tooltip:AddDoubleLine(secondary)
end

DT.tooltip:AddLine(' ')
Expand All @@ -87,10 +87,8 @@ local function OnClick(_, button)
else
HideUIPanel(_G.PlayerTalentFrame)
end
else
if hasDualSpec then
SetActiveTalentGroup(activeGroup == 1 and 2 or 1)
end
elseif hasDualSpec then
SetActiveTalentGroup(activeGroup == 1 and 2 or 1)
end
end
end
Expand Down

0 comments on commit 4d3d11e

Please sign in to comment.