Skip to content

Commit b5fdf30

Browse files
author
LocalIdentity
committed
Match jewels by parse raw info instead of name
Matching by name would fail on jewels that has different radius variants like Controller Metamorphosis
1 parent 1c75452 commit b5fdf30

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

src/Classes/PassiveTreeView.lua

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ function PassiveTreeViewClass:GetJewelSocketOverlay(jewel, isExpansion)
123123
end
124124
end
125125

126+
local function compareJewelsEqual(a, b)
127+
if not a or not b then
128+
return a == b
129+
end
130+
return a:BuildRaw() == b:BuildRaw()
131+
end
132+
126133
-- Returns the draw color for a node when compare overlay is active.
127134
-- Handles diff coloring for allocated/unallocated, mastery changes, and jewel socket differences.
128135
function PassiveTreeViewClass:GetCompareNodeColor(node, compareNode, spec, build, nodeDefaultColor)
@@ -139,9 +146,7 @@ function PassiveTreeViewClass:GetCompareNodeColor(node, compareNode, spec, build
139146
local pJewelId = spec.jewels[node.id]
140147
local pJewel = pJewelId and build.itemsTab.items[pJewelId]
141148
local cJewel = self:GetCompareJewel(node.id)
142-
local pName = pJewel and pJewel.name or ""
143-
local cName = cJewel and cJewel.name or ""
144-
if pName ~= cName then
149+
if not compareJewelsEqual(pJewel, cJewel) then
145150
return 0, 0, 1
146151
end
147152
end
@@ -1128,8 +1133,8 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents)
11281133
self:AddNodeTooltip(self.tooltip, node, build, incSmallPassiveSkillEffect)
11291134
end
11301135
self.tooltip.center = true
1131-
local ttWidth, ttHeight = self.tooltip:GetDynamicSize()
1132-
local skillWidth, skillHeight = self.skillTooltip:GetDynamicSize()
1136+
local ttWidth, ttHeight = self.tooltip:GetDynamicSize(viewPort)
1137+
local skillWidth, skillHeight = self.skillTooltip:GetDynamicSize(viewPort)
11331138

11341139
local fatSkill = skillWidth > skillHeight*1.5
11351140

@@ -1257,7 +1262,7 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents)
12571262
if node.alloc or (compareNode and compareNode.alloc) then
12581263
local pHasRadius = jewel and jewel.jewelRadiusIndex
12591264
local cHasRadius = cJewel and cJewel.jewelRadiusIndex
1260-
local sameJewel = jewel and cJewel and jewel.name == cJewel.name
1265+
local sameJewel = compareJewelsEqual(jewel, cJewel)
12611266
if pHasRadius then
12621267
local tint = (not self.compareSpec or sameJewel) and JEWEL_RADIUS_TINT_NEUTRAL or JEWEL_RADIUS_TINT_PRIMARY_ONLY
12631268
drawJewelRadius(jewel, scrX, scrY, tint)
@@ -1564,7 +1569,7 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi
15641569
local cJewel = self.compareSpec and self:GetCompareJewel(node.id) or nil
15651570
if jewel then
15661571
build.itemsTab:AddItemTooltip(tooltip, jewel, socket)
1567-
if cJewel and cJewel.name ~= jewel.name then
1572+
if not compareJewelsEqual(jewel, cJewel) then
15681573
addCompareJewelSection(socket, true)
15691574
end
15701575
if node.distanceToClassStart and node.distanceToClassStart > 0 then

0 commit comments

Comments
 (0)