From e43a752ac033865d1670f3c2aa594e2ff3d93d4e Mon Sep 17 00:00:00 2001 From: Salikh Gurgenidze Date: Sat, 24 Jan 2026 03:53:54 +0400 Subject: [PATCH] fix: BagFrame Sorting improvement --- UI/BankFrame.lua | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/UI/BankFrame.lua b/UI/BankFrame.lua index 5cba0db..9393b6c 100644 --- a/UI/BankFrame.lua +++ b/UI/BankFrame.lua @@ -1924,13 +1924,12 @@ end -- Highlight all item slots belonging to a specific bank bag by dimming others function Guda_BankFrame_HighlightBagSlots(bagID) - -- Buttons are parented under per-bag parents, not directly under the item container + -- Use itemButtons tracking instead of GetChildren to avoid allocations local highlightCount, dimCount = 0, 0 for _, bankBagParent in pairs(bankBagParents) do - if bankBagParent then - local children = { bankBagParent:GetChildren() } - for _, button in ipairs(children) do + if bankBagParent and bankBagParent.itemButtons then + for button in pairs(bankBagParent.itemButtons) do if button and button:IsShown() and button.hasItem ~= nil and not button.isBagSlot then if button.bagID == bagID then button:SetAlpha(1.0) @@ -1954,10 +1953,10 @@ function Guda_BankFrame_ClearHighlightedSlots() -- Restore alpha to search-filter state (pfUI style). If no search, full opacity. local searchActive = BankFrame and BankFrame.IsSearchActive and BankFrame:IsSearchActive() + -- Use itemButtons tracking instead of GetChildren to avoid allocations for _, bankBagParent in pairs(bankBagParents) do - if bankBagParent then - local children = { bankBagParent:GetChildren() } - for _, button in ipairs(children) do + if bankBagParent and bankBagParent.itemButtons then + for button in pairs(bankBagParent.itemButtons) do if button and button:IsShown() and button.hasItem ~= nil and not button.isBagSlot then if searchActive and BankFrame and BankFrame.PassesSearchFilter then local matches = BankFrame:PassesSearchFilter(button.itemData)