Skip to content

Commit ae99b0c

Browse files
committed
Polish Time-Lost jewel radius tooltip and probe set
- Append "(+X% from tree)" to the jewel tooltip Radius line when a build has NonUniqueTimeLostJewelRadius active. - Skip Time-Lost upgrade radius indexes in the AddNodeTooltip probe set unless the build actually has access to them, avoiding unnecessary ProcessStats calls per hover.
1 parent 9501732 commit ae99b0c

2 files changed

Lines changed: 26 additions & 13 deletions

File tree

src/Classes/ItemsTab.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2979,7 +2979,16 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode)
29792979
tooltip:AddLine(fontSizeBig, "^x7F7F7FRequires Class "..(self.build.spec.curClassName == item.classRestriction and colorCodes.POSITIVE or colorCodes.NEGATIVE)..item.classRestriction, "FONTIN SC")
29802980
end
29812981
if item.jewelRadiusLabel then
2982-
tooltip:AddLine(fontSizeBig, "^x7F7F7FRadius: ^7"..item.jewelRadiusLabel, "FONTIN SC")
2982+
local radiusLine = "^x7F7F7FRadius: ^7"..item.jewelRadiusLabel
2983+
if item.base and item.base.subType == "Radius"
2984+
and item.rarity ~= "UNIQUE" and item.rarity ~= "RELIC"
2985+
and self.build.calcsTab and self.build.calcsTab.mainEnv and self.build.calcsTab.mainEnv.modDB then
2986+
local upgradePct = self.build.calcsTab.mainEnv.modDB:Sum("INC", nil, "NonUniqueTimeLostJewelRadius")
2987+
if upgradePct > 0 then
2988+
radiusLine = radiusLine .. " ^x7F7F7F(+"..upgradePct.."% from tree)"
2989+
end
2990+
end
2991+
tooltip:AddLine(fontSizeBig, radiusLine, "FONTIN SC")
29832992
end
29842993
if item.jewelRadiusData and slot and item.jewelRadiusData[slot.nodeId] then
29852994
local radiusData = item.jewelRadiusData[slot.nodeId]

src/Classes/PassiveTreeView.lua

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,20 +1512,24 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi
15121512
-- essentially trying to avoid calling ProcessStats for a Normal/Notable node that can't possibly be affected
15131513
-- loops potentially every socket (24) until itemsTab is loaded or a jewel socket is hovered, then it will only loop the allocated sockets
15141514
-- Radius indexes to probe: Very Large (4) plus any Time-Lost upgrade tiers (e.g. Baryanic Leylines'
1515-
-- "Very Large +40%" at 16) so nodes only reachable via an increased radius still show jewel mods.
1515+
-- "Very Large +40%" at 16) that the current build actually has access to.
15161516
local radiusProbeIndexes = { 4 }
1517-
if data.nonUniqueTimeLostJewelRadiusUpgrades then
1518-
for _, map in pairs(data.nonUniqueTimeLostJewelRadiusUpgrades) do
1519-
for _, upgradedIndex in pairs(map) do
1520-
local seen = false
1521-
for _, existing in ipairs(radiusProbeIndexes) do
1522-
if existing == upgradedIndex then
1523-
seen = true
1524-
break
1517+
local timeLostRadiusUpgrade = build.calcsTab and build.calcsTab.mainEnv and build.calcsTab.mainEnv.modDB
1518+
and build.calcsTab.mainEnv.modDB:Sum("INC", nil, "NonUniqueTimeLostJewelRadius") or 0
1519+
if timeLostRadiusUpgrade > 0 and data.nonUniqueTimeLostJewelRadiusUpgrades then
1520+
for pct, map in pairs(data.nonUniqueTimeLostJewelRadiusUpgrades) do
1521+
if pct <= timeLostRadiusUpgrade then
1522+
for _, upgradedIndex in pairs(map) do
1523+
local seen = false
1524+
for _, existing in ipairs(radiusProbeIndexes) do
1525+
if existing == upgradedIndex then
1526+
seen = true
1527+
break
1528+
end
1529+
end
1530+
if not seen then
1531+
t_insert(radiusProbeIndexes, upgradedIndex)
15251532
end
1526-
end
1527-
if not seen then
1528-
t_insert(radiusProbeIndexes, upgradedIndex)
15291533
end
15301534
end
15311535
end

0 commit comments

Comments
 (0)