Skip to content

Commit eb23562

Browse files
justjuanguijustjuangui
andauthored
Fix respec tooltip for new Oracle Ascendancy (#1560)
* Enhance node tooltip to exclude nodes with unlock constraints from unallocation count and add warnings for required allocations * Improve node tooltip to accurately reflect dependency counts by considering unlock constraints and allocation status --------- Co-authored-by: justjuangui <servicios@juacarvajal.com>
1 parent 477dae4 commit eb23562

1 file changed

Lines changed: 41 additions & 4 deletions

File tree

src/Classes/PassiveTreeView.lua

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,17 +1472,54 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi
14721472
goldCost = goldCost * 5
14731473
end
14741474
if node.depends and #node.depends > 1 then
1475-
tooltip:AddSeparator(14)
1476-
tooltip:AddLine(14, "^7"..#node.depends .. " points gained from unallocating these nodes")
1477-
tooltip:AddLine(14, "^xFFD700"..formatNumSep(#node.depends * goldCost) .. " Gold ^7required to unallocate these nodes")
1478-
tooltip:AddLine(14, colorCodes.TIP)
1475+
-- remove node that have unlockConstraint from the count as they are not unallocated together with this node
1476+
local dependCount = #node.depends
1477+
for _, depNode in ipairs(node.depends) do
1478+
if depNode.unlockConstraint then
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
1490+
end
1491+
end
1492+
if dependCount > 0 then
1493+
tooltip:AddSeparator(14)
1494+
tooltip:AddLine(14, "^7"..dependCount .. " points gained from unallocating these nodes")
1495+
tooltip:AddLine(14, "^xFFD700"..formatNumSep(dependCount * goldCost) .. " Gold ^7required to unallocate these nodes")
1496+
tooltip:AddLine(14, colorCodes.TIP)
1497+
end
14791498
elseif node.alloc then
14801499
tooltip:AddLine(14, "^xFFD700"..formatNumSep(#node.depends * goldCost) .. " Gold ^7required to unallocate this node")
14811500
tooltip:AddLine(14, colorCodes.TIP)
14821501
end
14831502

14841503
self:AddGlobalNodeWarningsToTooltip(tooltip, node, build)
14851504

1505+
if node.unlockConstraint then
1506+
local addedSeparator = false
1507+
for _, nodeId in ipairs(node.unlockConstraint.nodes) do
1508+
local reqNode = build.spec.nodes[nodeId]
1509+
if reqNode and not reqNode.alloc then
1510+
if not addedSeparator then
1511+
addedSeparator = true
1512+
tooltip:AddSeparator(14)
1513+
end
1514+
tooltip:AddLine(14, colorCodes.WARNING.."Requires allocation of node: "..reqNode.dn)
1515+
end
1516+
end
1517+
1518+
if addedSeparator then
1519+
tooltip:AddSeparator(14)
1520+
end
1521+
end
1522+
14861523
if node.type == "Socket" then
14871524
tooltip:AddLine(14, colorCodes.TIP.."Tip: Hold Shift or Ctrl to hide this tooltip.")
14881525
else

0 commit comments

Comments
 (0)