Skip to content

Commit a71277c

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 9138e24 commit a71277c

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
@@ -3460,7 +3460,16 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode, maxWidth)
34603460
tooltip:AddLine(fontSizeBig, "^x7F7F7FRequires Class "..(self.build.spec.curClassName == item.classRestriction and colorCodes.POSITIVE or colorCodes.NEGATIVE)..item.classRestriction, "FONTIN SC")
34613461
end
34623462
if item.jewelRadiusLabel then
3463-
tooltip:AddLine(fontSizeBig, "^x7F7F7FRadius: ^7"..item.jewelRadiusLabel, "FONTIN SC")
3463+
local radiusLine = "^x7F7F7FRadius: ^7"..item.jewelRadiusLabel
3464+
if item.base and item.base.subType == "Radius"
3465+
and item.rarity ~= "UNIQUE" and item.rarity ~= "RELIC"
3466+
and self.build.calcsTab and self.build.calcsTab.mainEnv and self.build.calcsTab.mainEnv.modDB then
3467+
local upgradePct = self.build.calcsTab.mainEnv.modDB:Sum("INC", nil, "NonUniqueTimeLostJewelRadius")
3468+
if upgradePct > 0 then
3469+
radiusLine = radiusLine .. " ^x7F7F7F(+"..upgradePct.."% from tree)"
3470+
end
3471+
end
3472+
tooltip:AddLine(fontSizeBig, radiusLine, "FONTIN SC")
34643473
end
34653474
if item.jewelRadiusData and slot and item.jewelRadiusData[slot.nodeId] then
34663475
local radiusData = item.jewelRadiusData[slot.nodeId]

src/Classes/PassiveTreeView.lua

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,20 +1806,24 @@ function PassiveTreeViewClass:AddNodeTooltip(tooltip, node, build, incSmallPassi
18061806
-- essentially trying to avoid calling ProcessStats for a Normal/Notable node that can't possibly be affected
18071807
-- loops potentially every socket (24) until itemsTab is loaded or a jewel socket is hovered, then it will only loop the allocated sockets
18081808
-- Radius indexes to probe: Very Large (4) plus any Time-Lost upgrade tiers (e.g. Baryanic Leylines'
1809-
-- "Very Large +40%" at 16) so nodes only reachable via an increased radius still show jewel mods.
1809+
-- "Very Large +40%" at 16) that the current build actually has access to.
18101810
local radiusProbeIndexes = { 4 }
1811-
if data.nonUniqueTimeLostJewelRadiusUpgrades then
1812-
for _, map in pairs(data.nonUniqueTimeLostJewelRadiusUpgrades) do
1813-
for _, upgradedIndex in pairs(map) do
1814-
local seen = false
1815-
for _, existing in ipairs(radiusProbeIndexes) do
1816-
if existing == upgradedIndex then
1817-
seen = true
1818-
break
1811+
local timeLostRadiusUpgrade = build.calcsTab and build.calcsTab.mainEnv and build.calcsTab.mainEnv.modDB
1812+
and build.calcsTab.mainEnv.modDB:Sum("INC", nil, "NonUniqueTimeLostJewelRadius") or 0
1813+
if timeLostRadiusUpgrade > 0 and data.nonUniqueTimeLostJewelRadiusUpgrades then
1814+
for pct, map in pairs(data.nonUniqueTimeLostJewelRadiusUpgrades) do
1815+
if pct <= timeLostRadiusUpgrade then
1816+
for _, upgradedIndex in pairs(map) do
1817+
local seen = false
1818+
for _, existing in ipairs(radiusProbeIndexes) do
1819+
if existing == upgradedIndex then
1820+
seen = true
1821+
break
1822+
end
1823+
end
1824+
if not seen then
1825+
t_insert(radiusProbeIndexes, upgradedIndex)
18191826
end
1820-
end
1821-
if not seen then
1822-
t_insert(radiusProbeIndexes, upgradedIndex)
18231827
end
18241828
end
18251829
end

0 commit comments

Comments
 (0)