From a4388012e636120ec6edfb8bc6726f696279271b Mon Sep 17 00:00:00 2001 From: Salikh Gurgenidze Date: Sun, 4 Jan 2026 17:30:11 +0400 Subject: [PATCH] fix: hover container highlight slots --- UI/BagFrame.lua | 47 +++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/UI/BagFrame.lua b/UI/BagFrame.lua index c56e563..20ebe8a 100644 --- a/UI/BagFrame.lua +++ b/UI/BagFrame.lua @@ -2138,19 +2138,22 @@ end -- Highlight all item slots belonging to a specific bag by dimming others function Guda_BagFrame_HighlightBagSlots(bagID) - -- Use the tracked itemButtons list because actual buttons are parented under per-bag parents - if not itemButtons or type(itemButtons) ~= "table" then return end - + -- Iterate through bagParents to get all item buttons (same approach as BankFrame) local highlightCount, dimCount = 0, 0 - for _, button in ipairs(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) - highlightCount = highlightCount + 1 - else - button:SetAlpha(0.25) - dimCount = dimCount + 1 + for _, bagParent in pairs(bagParents) do + if bagParent then + local children = { bagParent:GetChildren() } + for _, button in ipairs(children) do + if button and button:IsShown() and button.hasItem ~= nil and not button.isBagSlot then + if button.bagID == bagID then + button:SetAlpha(1.0) + highlightCount = highlightCount + 1 + else + button:SetAlpha(0.25) + dimCount = dimCount + 1 + end + end end end end @@ -2159,16 +2162,20 @@ end -- Clear all highlighting by restoring full opacity to all slots function Guda_BagFrame_ClearHighlightedSlots() -- Restore alpha to whatever the search filter dictates (pfUI style). If no search, full opacity. - if not itemButtons or type(itemButtons) ~= "table" then return end - local searchActive = BagFrame and BagFrame.IsSearchActive and BagFrame:IsSearchActive() - for _, button in ipairs(itemButtons) do - if button and button:IsShown() and button.hasItem ~= nil and not button.isBagSlot then - if searchActive and BagFrame and BagFrame.PassesSearchFilter then - local matches = BagFrame:PassesSearchFilter(button.itemData) - button:SetAlpha(matches and 1.0 or 0.25) - else - button:SetAlpha(1.0) + + for _, bagParent in pairs(bagParents) do + if bagParent then + local children = { bagParent:GetChildren() } + for _, button in ipairs(children) do + if button and button:IsShown() and button.hasItem ~= nil and not button.isBagSlot then + if searchActive and BagFrame and BagFrame.PassesSearchFilter then + local matches = BagFrame:PassesSearchFilter(button.itemData) + button:SetAlpha(matches and 1.0 or 0.25) + else + button:SetAlpha(1.0) + end + end end end end