From c8d897e150f8346e0997701a6a6fe85cf2beb040 Mon Sep 17 00:00:00 2001 From: justjuangui Date: Sun, 14 Dec 2025 10:39:53 -0500 Subject: [PATCH 1/2] Enhance node tooltip to exclude nodes with unlock constraints from unallocation count and add warnings for required allocations --- src/Classes/PassiveTreeView.lua | 35 +++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/src/Classes/PassiveTreeView.lua b/src/Classes/PassiveTreeView.lua index e3fe96a9cf..fd88e0aa05 100644 --- a/src/Classes/PassiveTreeView.lua +++ b/src/Classes/PassiveTreeView.lua @@ -1472,10 +1472,19 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi goldCost = goldCost * 5 end if node.depends and #node.depends > 1 then - tooltip:AddSeparator(14) - tooltip:AddLine(14, "^7"..#node.depends .. " points gained from unallocating these nodes") - tooltip:AddLine(14, "^xFFD700"..formatNumSep(#node.depends * goldCost) .. " Gold ^7required to unallocate these nodes") - tooltip:AddLine(14, colorCodes.TIP) + -- remove node that have unlockConstraint from the count as they are not unallocated together with this node + local dependCount = #node.depends + for _, depNode in ipairs(node.depends) do + if depNode.unlockConstraint then + dependCount = dependCount - 1 + end + end + if dependCount > 1 then + tooltip:AddSeparator(14) + tooltip:AddLine(14, "^7"..dependCount .. " points gained from unallocating these nodes") + tooltip:AddLine(14, "^xFFD700"..formatNumSep(dependCount * goldCost) .. " Gold ^7required to unallocate these nodes") + tooltip:AddLine(14, colorCodes.TIP) + end elseif node.alloc then tooltip:AddLine(14, "^xFFD700"..formatNumSep(#node.depends * goldCost) .. " Gold ^7required to unallocate this node") tooltip:AddLine(14, colorCodes.TIP) @@ -1483,6 +1492,24 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi self:AddGlobalNodeWarningsToTooltip(tooltip, node, build) + if node.unlockConstraint then + local addedSeparator = false + for _, nodeId in ipairs(node.unlockConstraint.nodes) do + local reqNode = build.spec.nodes[nodeId] + if reqNode and not reqNode.alloc then + if not addedSeparator then + addedSeparator = true + tooltip:AddSeparator(14) + end + tooltip:AddLine(14, colorCodes.WARNING.."Requires allocation of node: "..reqNode.dn) + end + end + + if addedSeparator then + tooltip:AddSeparator(14) + end + end + if node.type == "Socket" then tooltip:AddLine(14, colorCodes.TIP.."Tip: Hold Shift or Ctrl to hide this tooltip.") else From 754f47871fb38e7daa90c8c51ec12f7702cab608 Mon Sep 17 00:00:00 2001 From: justjuangui Date: Sun, 14 Dec 2025 11:45:54 -0500 Subject: [PATCH 2/2] Improve node tooltip to accurately reflect dependency counts by considering unlock constraints and allocation status --- src/Classes/PassiveTreeView.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Classes/PassiveTreeView.lua b/src/Classes/PassiveTreeView.lua index fd88e0aa05..fb5f5b3cd3 100644 --- a/src/Classes/PassiveTreeView.lua +++ b/src/Classes/PassiveTreeView.lua @@ -1476,10 +1476,20 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi local dependCount = #node.depends for _, depNode in ipairs(node.depends) do if depNode.unlockConstraint then - dependCount = dependCount - 1 + for _, reqNodeId in ipairs(depNode.unlockConstraint.nodes) do + local reqNode = build.spec.nodes[reqNodeId] + if reqNode == node and not depNode.alloc then + dependCount = dependCount - 1 + break + end + if reqNode and not reqNode.alloc then + dependCount = dependCount - 1 + break + end + end end end - if dependCount > 1 then + if dependCount > 0 then tooltip:AddSeparator(14) tooltip:AddLine(14, "^7"..dependCount .. " points gained from unallocating these nodes") tooltip:AddLine(14, "^xFFD700"..formatNumSep(dependCount * goldCost) .. " Gold ^7required to unallocate these nodes")