Skip to content

Commit 754f478

Browse files
author
justjuangui
committed
Improve node tooltip to accurately reflect dependency counts by considering unlock constraints and allocation status
1 parent c8d897e commit 754f478

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

src/Classes/PassiveTreeView.lua

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,10 +1476,20 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi
14761476
local dependCount = #node.depends
14771477
for _, depNode in ipairs(node.depends) do
14781478
if depNode.unlockConstraint then
1479-
dependCount = dependCount - 1
1479+
for _, reqNodeId in ipairs(depNode.unlockConstraint.nodes) do
1480+
local reqNode = build.spec.nodes[reqNodeId]
1481+
if reqNode == node and not depNode.alloc then
1482+
dependCount = dependCount - 1
1483+
break
1484+
end
1485+
if reqNode and not reqNode.alloc then
1486+
dependCount = dependCount - 1
1487+
break
1488+
end
1489+
end
14801490
end
14811491
end
1482-
if dependCount > 1 then
1492+
if dependCount > 0 then
14831493
tooltip:AddSeparator(14)
14841494
tooltip:AddLine(14, "^7"..dependCount .. " points gained from unallocating these nodes")
14851495
tooltip:AddLine(14, "^xFFD700"..formatNumSep(dependCount * goldCost) .. " Gold ^7required to unallocate these nodes")

0 commit comments

Comments
 (0)