fix: hover container highlight slots
This commit is contained in:
+27
-20
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user