Skip to content

Commit

Permalink
feat: 添加主副天赋标记
Browse files Browse the repository at this point in the history
  • Loading branch information
DengSir committed Nov 22, 2024
1 parent 168f866 commit 0539184
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Localization/zhCN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ L['Show enchant'] = '显示附魔'
L['Show enchant/gem lost'] = '显示附魔/宝石缺失'
L['Show gem'] = '显示宝石'
L['Add socket'] = '添加插槽'
L.Major = ''
L.Minor = ''
-- @locale-fill@

-- @end-import@
10 changes: 7 additions & 3 deletions UI/GearFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,25 @@ function GearFrame:UpdateTalents()
local activeGroup = self:GetActiveTalentGroup()
if numGroups <= 1 then
self.Talent2:Hide()
self:UpdateTalent(self.Talent1, activeGroup, true)
self:UpdateTalent(self.Talent1, activeGroup, true, true)
else
self:UpdateTalent(self.Talent1, activeGroup, true)
self:UpdateTalent(self.Talent2, activeGroup == 1 and 2 or 1, false)
end
end

function GearFrame:UpdateTalent(button, group, isActive)
function GearFrame:UpdateTalent(button, group, isActive, onlyOne)
button.id = group
button.isActive = isActive

local name, icon, bg, points = self:GetTalentInfo(group)
if name then
button.Icon:SetTexture(icon)
button.Text:SetText(name)
if onlyOne then
button.Text:SetText(name)
else
button.Text:SetFormattedText('%s: %s', group == 1 and L.Major or L.Minor, name)
end
button.Point:SetText(points)
button:Show()
else
Expand Down

0 comments on commit 0539184

Please sign in to comment.