Skip to content

Fix Comparison Tooltip adding Time Lost Jewel mods to incorrect radiusNodes #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3059,7 +3059,10 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode)
for _, compareSlot in pairs(compareSlots) do
if not main.slotOnlyTooltips or (slot and (slot.nodeId == compareSlot.nodeId or slot.slotName == compareSlot.slotName)) or not slot or slot == compareSlot then
local selItem = self.items[compareSlot.selItemId]
-- short term fix for Time-Lost jewel processing
self.build.treeTab.skipTimeLostJewelProcessing = true
local output = calcFunc({ repSlotName = compareSlot.slotName, repItem = item ~= selItem and item or nil})
self.build.treeTab.skipTimeLostJewelProcessing = false
local header
if item == selItem then
header = "^7Removing this item from "..compareSlot.label.." will give you:"
Expand Down
1 change: 1 addition & 0 deletions src/Classes/TreeTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ local TreeTabClass = newClass("TreeTab", "ControlHost", function(self, build)
self.specList[1] = new("PassiveSpec", build, latestTreeVersion)
self:SetActiveSpec(1)
self:SetCompareSpec(1)
self.skipTimeLostJewelProcessing = false

self.anchorControls = new("Control", nil, {0, 0, 0, 20})

Expand Down
33 changes: 18 additions & 15 deletions src/Modules/CalcSetup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -142,23 +142,26 @@
end

local function addStats(jewel, node, spec)
-- reset node stats to base or override for attributes
if spec.hashOverrides and spec.hashOverrides[node.id] then
node.sd = copyTable(spec.hashOverrides[node.id].sd, true)
else
node.sd = copyTable(spec.tree.nodes[node.id].sd, true)
end
-- short term to avoid running the logic on AddItemTooltip
if not spec.build.treeTab.skipTimeLostJewelProcessing then
-- reset node stats to base or override for attributes
if spec.hashOverrides and spec.hashOverrides[node.id] then
node.sd = copyTable(spec.hashOverrides[node.id].sd, true)
else
node.sd = copyTable(spec.tree.nodes[node.id].sd, true)
end

local radiusJewelStats = { }
setRadiusJewelStats(jewel, radiusJewelStats)
for _, stat in ipairs(radiusJewelStats) do
-- the node and stat types match, add sd to node if it's not already there and it's an 'also grant' mod
if not isValueInTable(node.sd, stat.sd) and ((node.type == "Notable" and stat.isNotable) or (node.type == "Normal" and not stat.isNotable))
and stat.toAdd then
t_insert(node.sd, stat.sd)
local radiusJewelStats = { }
setRadiusJewelStats(jewel, radiusJewelStats)
for _, stat in ipairs(radiusJewelStats) do
-- the node and stat types match, add sd to node if it's not already there and it's an 'also grant' mod
if not isValueInTable(node.sd, stat.sd) and ((node.type == "Notable" and stat.isNotable) or (node.type == "Normal" and not stat.isNotable))
and stat.toAdd then
t_insert(node.sd, stat.sd)
end
end
spec.tree:ProcessStats(node)
end
spec.tree:ProcessStats(node)
return node.modList
end

Expand All @@ -169,7 +172,7 @@
-- if the Time-Lost jewel is socketed, add the stat
if itemsTab.activeSocketList then
for _, nodeId in pairs(itemsTab.activeSocketList) do
local _, socketedJewel = itemsTab:GetSocketAndJewelForNodeID(nodeId)
local socketIndex, socketedJewel = itemsTab:GetSocketAndJewelForNodeID(nodeId)
if socketedJewel and socketedJewel.baseName:find("Time%-Lost") == 1 then
return addStats(jewel, node, spec)
end
Expand Down Expand Up @@ -745,7 +748,7 @@
modDB:NewMod("Multiplier:AllocatedLifeMastery", "BASE", allocatedMasteryTypes["Life Mastery"])
end

-- add Conditional WeaponnSet# base on weapon set from item

Check warning on line 751 in src/Modules/CalcSetup.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Weaponn)
modDB:NewMod("Condition:WeaponSet" .. (build.itemsTab.activeItemSet.useSecondWeaponSet and 2 or 1) , "FLAG", true, "Weapon Set")

-- Build and merge item modifiers, and create list of radius jewels
Expand Down
Loading