From d69758abe8a321e6b14a40d9bbe37fe1d8c5173e Mon Sep 17 00:00:00 2001 From: MrHB212 Date: Fri, 29 May 2026 21:02:11 +0200 Subject: [PATCH 1/5] Update PassiveTreeView.lua --- src/Classes/PassiveTreeView.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Classes/PassiveTreeView.lua b/src/Classes/PassiveTreeView.lua index 2149899ce..a3154dd6b 100644 --- a/src/Classes/PassiveTreeView.lua +++ b/src/Classes/PassiveTreeView.lua @@ -831,7 +831,7 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents) self.searchParams = prepSearch(self.searchStr) for nodeId, node in pairs(spec.nodes) do - self.searchStrResults[nodeId] = #self.searchParams > 0 and self:DoesNodeMatchSearchParams(node) + self.searchStrResults[nodeId] = #self.searchParams > 0 and self:DoesNodeMatchSearchParams(build, node) end end @@ -1442,11 +1442,15 @@ function PassiveTreeViewClass:Focus(x, y, viewPort, build) self.zoomY = -y * scale end -function PassiveTreeViewClass:DoesNodeMatchSearchParams(node) +function PassiveTreeViewClass:DoesNodeMatchSearchParams(build, node) if node.type == "ClassStart" or node.type == "OnlyImage" then return end + if node.unlockConstraint and not checkUnlockConstraint(build, node) then + return + end + local needMatches = copyTable(self.searchParams) local err From f52f27f1d34f4e7ccb4f1ff662e4057895a816d6 Mon Sep 17 00:00:00 2001 From: MrHB212 Date: Fri, 29 May 2026 21:02:41 +0200 Subject: [PATCH 2/5] Update PassiveTreeView.lua --- src/Classes/PassiveTreeView.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Classes/PassiveTreeView.lua b/src/Classes/PassiveTreeView.lua index a3154dd6b..17783171f 100644 --- a/src/Classes/PassiveTreeView.lua +++ b/src/Classes/PassiveTreeView.lua @@ -1447,7 +1447,7 @@ function PassiveTreeViewClass:DoesNodeMatchSearchParams(build, node) return end - if node.unlockConstraint and not checkUnlockConstraint(build, node) then + if node.unlockConstraint and not checkUnlockConstraints(build, node) then return end From 2a0374c3069f043daaaba561339fbcd536c61d23 Mon Sep 17 00:00:00 2001 From: MrHB212 Date: Fri, 29 May 2026 21:07:35 +0200 Subject: [PATCH 3/5] helper function to set searchNeedsForceUpdate --- src/Classes/PassiveSpec.lua | 2 ++ src/Classes/PassiveTreeView.lua | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Classes/PassiveSpec.lua b/src/Classes/PassiveSpec.lua index 3b2d0ce20..e1e37718e 100644 --- a/src/Classes/PassiveSpec.lua +++ b/src/Classes/PassiveSpec.lua @@ -913,6 +913,7 @@ function PassiveSpecClass:GetEffectiveAllocationPath(node, altPath) end function PassiveSpecClass:AllocNode(node, altPath) + setSearchForceUpdate() if not node.path then -- Node cannot be connected to the tree as there is no possible path return @@ -972,6 +973,7 @@ end -- Deallocate the given node, and all nodes which depend on it (i.e. which are only connected to the tree through this node) function PassiveSpecClass:DeallocNode(node) + setSearchForceUpdate() for _, depNode in ipairs(node.depends) do -- reset any switched attribute nodes if depNode.isAttribute then diff --git a/src/Classes/PassiveTreeView.lua b/src/Classes/PassiveTreeView.lua index 17783171f..7deebf0b6 100644 --- a/src/Classes/PassiveTreeView.lua +++ b/src/Classes/PassiveTreeView.lua @@ -4,6 +4,7 @@ -- Passive skill tree viewer. -- Draws the passive skill tree, and also maintains the current view settings (zoom level, position, etc) -- +local number = 0 local pairs = pairs local ipairs = ipairs local t_insert = table.insert @@ -835,6 +836,10 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents) end end + function setSearchForceUpdate() + self.searchNeedsForceUpdate = true + end + if launch.devModeAlt and hoverNode then -- Draw orbits of the group node local groupNode = hoverNode.group @@ -1443,6 +1448,8 @@ function PassiveTreeViewClass:Focus(x, y, viewPort, build) end function PassiveTreeViewClass:DoesNodeMatchSearchParams(build, node) + print("CALLED:", number) + number = number + 1 if node.type == "ClassStart" or node.type == "OnlyImage" then return end @@ -2094,9 +2101,11 @@ function PassiveTreeViewClass:LessLuminance() local newA = a * alphaFactor; SetDrawColor(newR, newG, newB, newA) end - +local test = 0 -- Checks if a node has unlockConstraint and if that node is allocated function checkUnlockConstraints(build, node) + print("CHECKED: ", test) + test = test+1 if unseenPathHover and node.unlockConstraint and node.unlockConstraint.nodes[1] == 5571 then return true end From 09f9d806a682a65635dae63f4a0ab7e95ad8a016 Mon Sep 17 00:00:00 2001 From: MrHB212 Date: Fri, 29 May 2026 21:22:36 +0200 Subject: [PATCH 4/5] Update PassiveTreeView.lua deleted lines i used to test --- src/Classes/PassiveTreeView.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Classes/PassiveTreeView.lua b/src/Classes/PassiveTreeView.lua index 7deebf0b6..71b35fd7e 100644 --- a/src/Classes/PassiveTreeView.lua +++ b/src/Classes/PassiveTreeView.lua @@ -4,7 +4,6 @@ -- Passive skill tree viewer. -- Draws the passive skill tree, and also maintains the current view settings (zoom level, position, etc) -- -local number = 0 local pairs = pairs local ipairs = ipairs local t_insert = table.insert @@ -1448,8 +1447,6 @@ function PassiveTreeViewClass:Focus(x, y, viewPort, build) end function PassiveTreeViewClass:DoesNodeMatchSearchParams(build, node) - print("CALLED:", number) - number = number + 1 if node.type == "ClassStart" or node.type == "OnlyImage" then return end @@ -2101,11 +2098,9 @@ function PassiveTreeViewClass:LessLuminance() local newA = a * alphaFactor; SetDrawColor(newR, newG, newB, newA) end -local test = 0 + -- Checks if a node has unlockConstraint and if that node is allocated function checkUnlockConstraints(build, node) - print("CHECKED: ", test) - test = test+1 if unseenPathHover and node.unlockConstraint and node.unlockConstraint.nodes[1] == 5571 then return true end From 2c109d156e4096ac91d56937ad9d521ab77dac80 Mon Sep 17 00:00:00 2001 From: Wires77 Date: Mon, 1 Jun 2026 01:17:52 -0500 Subject: [PATCH 5/5] Remove redundant search refresh logic, move global functions to local --- src/Classes/PassiveSpec.lua | 4 ++-- src/Classes/PassiveTreeView.lua | 21 ++++++++------------- src/Modules/Build.lua | 6 +++--- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/Classes/PassiveSpec.lua b/src/Classes/PassiveSpec.lua index e1e37718e..86310d575 100644 --- a/src/Classes/PassiveSpec.lua +++ b/src/Classes/PassiveSpec.lua @@ -913,7 +913,7 @@ function PassiveSpecClass:GetEffectiveAllocationPath(node, altPath) end function PassiveSpecClass:AllocNode(node, altPath) - setSearchForceUpdate() + self.build.treeTab.viewer.searchStrCached = "" if not node.path then -- Node cannot be connected to the tree as there is no possible path return @@ -973,7 +973,7 @@ end -- Deallocate the given node, and all nodes which depend on it (i.e. which are only connected to the tree through this node) function PassiveSpecClass:DeallocNode(node) - setSearchForceUpdate() + self.build.treeTab.viewer.searchStrCached = "" for _, depNode in ipairs(node.depends) do -- reset any switched attribute nodes if depNode.isAttribute then diff --git a/src/Classes/PassiveTreeView.lua b/src/Classes/PassiveTreeView.lua index 71b35fd7e..5c9e91301 100644 --- a/src/Classes/PassiveTreeView.lua +++ b/src/Classes/PassiveTreeView.lua @@ -763,7 +763,7 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents) local node2 = spec.nodes[connector.nodeId2] if not node1.unlockConstraint and not node2.unlockConstraint then renderConnector(connector) - elseif checkUnlockConstraints(build, node1) and checkUnlockConstraints(build, node2) then + elseif self:checkUnlockConstraints(build, node1) and self:checkUnlockConstraints(build, node2) then renderConnector(connector) end end @@ -809,9 +809,8 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents) end -- Update cached node data - if self.searchStrCached ~= self.searchStr or self.searchNeedsForceUpdate == true then + if self.searchStrCached ~= self.searchStr then self.searchStrCached = self.searchStr - self.searchNeedsForceUpdate = false local function prepSearch(search) search = search:lower() @@ -835,10 +834,6 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents) end end - function setSearchForceUpdate() - self.searchNeedsForceUpdate = true - end - if launch.devModeAlt and hoverNode then -- Draw orbits of the group node local groupNode = hoverNode.group @@ -927,7 +922,7 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents) -- This is the icon that appears in the center of many groups if not node.unlockConstraint then base = tree:GetAssetByName(node.activeEffectImage) - elseif checkUnlockConstraints(build, node) then + elseif self:checkUnlockConstraints(build, node) then base = tree:GetAssetByName(node.activeEffectImage) end SetDrawLayer(nil, 15) @@ -937,7 +932,7 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents) if node.activeEffectImage then if not node.unlockConstraint then effect = tree:GetAssetByName(node.activeEffectImage) - elseif checkUnlockConstraints(build, node) then + elseif self:checkUnlockConstraints(build, node) then effect = tree:GetAssetByName(node.activeEffectImage) end end @@ -945,7 +940,7 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents) if not node.unlockConstraint then base = tree:GetAssetByName(node.icon) overlay = node.overlay[state] - elseif checkUnlockConstraints(build, node) then + elseif self:checkUnlockConstraints(build, node) then base = tree:GetAssetByName(node.icon) overlay = node.overlay[state] end @@ -1161,7 +1156,7 @@ function PassiveTreeViewClass:Draw(build, viewPort, inputEvents) end end - if node == hoverNode and (not node.unlockConstraint or checkUnlockConstraints(build, node)) and (node.type ~= "Socket" or not IsKeyDown("SHIFT")) and not IsKeyDown("CTRL") and not main.popups[1] then + if node == hoverNode and (not node.unlockConstraint or self:checkUnlockConstraints(build, node)) and (node.type ~= "Socket" or not IsKeyDown("SHIFT")) and not IsKeyDown("CTRL") and not main.popups[1] then -- Draw tooltip SetDrawLayer(nil, 100) local size = m_floor(node.size * scale) @@ -1451,7 +1446,7 @@ function PassiveTreeViewClass:DoesNodeMatchSearchParams(build, node) return end - if node.unlockConstraint and not checkUnlockConstraints(build, node) then + if node.unlockConstraint and not self:checkUnlockConstraints(build, node) then return end @@ -2100,7 +2095,7 @@ function PassiveTreeViewClass:LessLuminance() end -- Checks if a node has unlockConstraint and if that node is allocated -function checkUnlockConstraints(build, node) +function PassiveTreeViewClass:checkUnlockConstraints(build, node) if unseenPathHover and node.unlockConstraint and node.unlockConstraint.nodes[1] == 5571 then return true end diff --git a/src/Modules/Build.lua b/src/Modules/Build.lua index d2925e431..18d1aab3a 100644 --- a/src/Modules/Build.lua +++ b/src/Modules/Build.lua @@ -246,21 +246,21 @@ function buildMode:Init(dbFileName, buildName, buildXML, convertBuild, importLin self.spec:AddUndoState() self.spec:SetWindowTitleWithBuildClass() self.buildFlag = true - self.treeTab.viewer.searchNeedsForceUpdate = true + self.treeTab.viewer.searchStrCached = "" else main:OpenConfirmPopup("Class Change", "Changing class to "..value.label.." will reset your passive tree.\nThis can be avoided by connecting one of the "..value.label.." starting nodes to your tree.", "Continue", function() self.spec:SelectClass(value.classId) self.spec:AddUndoState() self.spec:SetWindowTitleWithBuildClass() self.buildFlag = true - self.treeTab.viewer.searchNeedsForceUpdate = true + self.treeTab.viewer.searchStrCached = "" end, "Connect Path", function() if self.spec:ConnectToClass(value.classId) then self.spec:SelectClass(value.classId) self.spec:AddUndoState() self.spec:SetWindowTitleWithBuildClass() self.buildFlag = true - self.treeTab.viewer.searchNeedsForceUpdate = true + self.treeTab.viewer.searchStrCached = "" end end) end