fix: BagFrame Sorting improvement
This commit is contained in:
+6
-7
@@ -1924,13 +1924,12 @@ end
|
|||||||
|
|
||||||
-- Highlight all item slots belonging to a specific bank bag by dimming others
|
-- Highlight all item slots belonging to a specific bank bag by dimming others
|
||||||
function Guda_BankFrame_HighlightBagSlots(bagID)
|
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
|
local highlightCount, dimCount = 0, 0
|
||||||
|
|
||||||
for _, bankBagParent in pairs(bankBagParents) do
|
for _, bankBagParent in pairs(bankBagParents) do
|
||||||
if bankBagParent then
|
if bankBagParent and bankBagParent.itemButtons then
|
||||||
local children = { bankBagParent:GetChildren() }
|
for button in pairs(bankBagParent.itemButtons) do
|
||||||
for _, button in ipairs(children) do
|
|
||||||
if button and button:IsShown() and button.hasItem ~= nil and not button.isBagSlot then
|
if button and button:IsShown() and button.hasItem ~= nil and not button.isBagSlot then
|
||||||
if button.bagID == bagID then
|
if button.bagID == bagID then
|
||||||
button:SetAlpha(1.0)
|
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.
|
-- Restore alpha to search-filter state (pfUI style). If no search, full opacity.
|
||||||
local searchActive = BankFrame and BankFrame.IsSearchActive and BankFrame:IsSearchActive()
|
local searchActive = BankFrame and BankFrame.IsSearchActive and BankFrame:IsSearchActive()
|
||||||
|
|
||||||
|
-- Use itemButtons tracking instead of GetChildren to avoid allocations
|
||||||
for _, bankBagParent in pairs(bankBagParents) do
|
for _, bankBagParent in pairs(bankBagParents) do
|
||||||
if bankBagParent then
|
if bankBagParent and bankBagParent.itemButtons then
|
||||||
local children = { bankBagParent:GetChildren() }
|
for button in pairs(bankBagParent.itemButtons) do
|
||||||
for _, button in ipairs(children) do
|
|
||||||
if button and button:IsShown() and button.hasItem ~= nil and not button.isBagSlot then
|
if button and button:IsShown() and button.hasItem ~= nil and not button.isBagSlot then
|
||||||
if searchActive and BankFrame and BankFrame.PassesSearchFilter then
|
if searchActive and BankFrame and BankFrame.PassesSearchFilter then
|
||||||
local matches = BankFrame:PassesSearchFilter(button.itemData)
|
local matches = BankFrame:PassesSearchFilter(button.itemData)
|
||||||
|
|||||||
Reference in New Issue
Block a user