Skip to content

Commit 9c788d7

Browse files
LothrikWires77LocalIdentity
authored
Further Timeless Jewel search improvements (#4546)
* Fix broken might/legacy of the vaal + misc cleanup * Update to new noTooltip draw behavior * Update edit box when slider values change .. and prevent duplicate nodes from being added to edit box. * Remove search result total weight column * Fix dynamic slider update bug * Sanitize user input and fix a few errors * Wipe all search input on reset * Fix another missed variable sync * Rebuild searchListTbl from timelessData.searchList * Save timeless jewel search config to build XML * Update TreeTab.lua * Fixed swapped weight values, minor refactors * Fix search list result updating * Fix statMod2 nil error on small nodes * Properly handle replace and add types, finally * Minor consistency edit * Remove dynamic slider width code * Set modFlag to prompt build saving on several .. .. different events, including: - timelessData.searchList change (node weight sliders) - updateSearchList called - conqueror change - jewel socket change - desired node change (direct and via dropdown list) * Remove lingering duplicate variable from old implementation * Save socketFilter state to build XML * Change tooltip colour for tree node names Co-authored-by: Wires77 <Wires77@users.noreply.github.com> Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent b1826fb commit 9c788d7

File tree

5 files changed

+201
-100
lines changed

5 files changed

+201
-100
lines changed

src/Classes/PassiveSpec.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,13 +700,13 @@ function PassiveSpecClass:BuildAllDependsAndPaths()
700700
value = value / 1000
701701
end
702702
end
703-
--if statMod.fmt == "d" then --only ever d or g, and we want both past here
703+
--if statMod.fmt == "d" then -- only ever d or g, and we want both past here
704704
if statMod.min ~= statMod.max then
705705
return statToFix:gsub("%("..statMod.min.."%-"..statMod.max.."%)", value)
706706
elseif statMod.min ~= value then -- only true for might/legacy of the vaal which can combine stats
707707
return statToFix:gsub(statMod.min, value)
708708
end
709-
return statToFix -- if it doesnt need to be changed
709+
return statToFix -- if it doesn't need to be changed
710710
end
711711

712712
if node.type == "Notable" then
@@ -716,7 +716,7 @@ function PassiveSpecClass:BuildAllDependsAndPaths()
716716
else
717717
jewelDataTbl = data.readLUT(conqueredBy.id, node.id, jewelType)
718718
end
719-
print("Need to Update: " .. node.id .. " [" .. node.dn .. "]")
719+
--print("Need to Update: " .. node.id .. " [" .. node.dn .. "]")
720720
if not next(jewelDataTbl) then
721721
ConPrintf("Missing LUT: " .. data.timelessJewelTypes[jewelType])
722722
else

src/Classes/TimelessJewelListControl.lua

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
local m_random = math.random
88
local t_concat = table.concat
99

10-
local TimelessJewelListControlClass = newClass("TimelessJewelListControl", "ListControl", function(self, anchor, x, y, width, height, build, list, sharedList, hideHoverControl)
11-
self.list = list or { }
12-
self.ListControl(anchor, x, y, width, height, 16, true, false, self.list)
10+
local TimelessJewelListControlClass = newClass("TimelessJewelListControl", "ListControl", function(self, anchor, x, y, width, height, build)
1311
self.build = build
14-
self.sharedList = sharedList
15-
self.hideHoverControl = hideHoverControl
12+
self.sharedList = self.build.timelessData.sharedResults or { }
13+
self.list = self.build.timelessData.searchResults or { }
14+
self.ListControl(anchor, x, y, width, height, 16, true, false, self.list)
1615
self.selIndex = nil
1716
end)
1817

19-
function TimelessJewelListControlClass:Draw(viewPort)
18+
function TimelessJewelListControlClass:Draw(viewPort, noTooltip)
19+
self.noTooltip = noTooltip
2020
self.ListControl.Draw(self, viewPort)
2121
end
2222

@@ -28,25 +28,25 @@ end
2828

2929
function TimelessJewelListControlClass:AddValueTooltip(tooltip, index, data)
3030
tooltip:Clear()
31-
if not self.hideHoverControl:IsMouseOver() then
31+
if not self.noTooltip then
3232
if self.list[index].label:match("B2B2B2") == nil then
3333
tooltip:AddLine(16, "^7Double click to add this jewel to your build.")
3434
else
3535
tooltip:AddLine(16, "^7" .. self.sharedList.type.label .. " " .. data.seed .. " was successfully added to your build.")
3636
end
3737
local treeData = self.build.spec.tree
3838
local sortedNodeLists = { }
39-
for _, desiredNode in pairs(self.sharedList.desiredNodes) do
40-
if self.list[index][desiredNode.nodeId] and self.list[index][desiredNode.nodeId].targetNodeNames and #self.list[index][desiredNode.nodeId].targetNodeNames > 0 then
41-
sortedNodeLists[desiredNode.desiredIdx] = " " .. desiredNode.displayName .. ":\n " .. t_concat(self.list[index][desiredNode.nodeId].targetNodeNames, "\n ")
39+
for legionId, desiredNode in pairs(self.sharedList.desiredNodes) do
40+
if self.list[index][legionId] and self.list[index][legionId].targetNodeNames and #self.list[index][legionId].targetNodeNames > 0 then
41+
sortedNodeLists[desiredNode.desiredIdx] = "^7 " .. desiredNode.displayName .. ":\n^8 " .. t_concat(self.list[index][legionId].targetNodeNames, "\n ")
4242
end
4343
end
4444
if sortedNodeLists then
4545
tooltip:AddLine(16, "Node List:")
4646
for _, sortedNodeList in pairs(sortedNodeLists) do
4747
tooltip:AddLine(16, sortedNodeList)
4848
end
49-
tooltip:AddLine(16, "Combined Node Weight: " .. data.total)
49+
tooltip:AddLine(16, "^7Combined Node Weight: " .. data.total)
5050
end
5151
end
5252
end

src/Classes/TimelessJewelSocketControl.lua

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,18 @@
66

77
local m_min = math.min
88

9-
local TimelessJewelSocketClass = newClass("TimelessJewelSocketControl", "DropDownControl", function(self, anchor, x, y, width, height, list, selFunc, build, socketViewer, hideHoverControls)
9+
local TimelessJewelSocketClass = newClass("TimelessJewelSocketControl", "DropDownControl", function(self, anchor, x, y, width, height, list, selFunc, build, socketViewer)
1010
self.DropDownControl(anchor, x, y, width, height, list, selFunc)
1111
self.build = build
1212
self.socketViewer = socketViewer
13-
self.hideHoverControls = hideHoverControls
1413
end)
1514

16-
function TimelessJewelSocketClass:Draw(viewPort)
15+
function TimelessJewelSocketClass:Draw(viewPort, noTooltip)
1716
local x, y = self:GetPos()
1817
local width, height = self:GetSize()
1918
self.DropDownControl:Draw(viewPort)
2019
self:DrawControls(viewPort)
21-
for _, hoverControl in pairs(self.hideHoverControls) do
22-
if hoverControl:IsMouseOver() then
23-
return
24-
end
25-
end
26-
if not main.popups[2] and self:IsMouseOver() then
20+
if self:IsMouseOver() and not noTooltip and not main.popups[2] then
2721
SetDrawLayer(nil, 15)
2822
local viewerY
2923
if self.DropDownControl.dropUp and self.DropDownControl.dropped then

0 commit comments

Comments
 (0)