fix: category view markers

This commit is contained in:
Vati
2026-02-28 04:36:04 +04:00
parent 597a66ec9c
commit 02001fb1ce
2 changed files with 5 additions and 62 deletions
+2 -46
View File
@@ -336,52 +336,8 @@ function BagFrame:UpdateChangedSlots(bagID)
local isCategoryView = (viewType == "category")
if isCategoryView then
-- In Category View: update slots that HAVE button mappings
-- AND check for NEW items that arrived in slots without buttons
local updatedCount = 0
for slotID, targetButton in pairs(slotToButton[bagID]) do
local currentLink = GetContainerItemLink(bagID, slotID)
local cachedLink = targetButton.itemData and targetButton.itemData.link or nil
local needsUpdate = false
if currentLink ~= cachedLink then
needsUpdate = true
elseif currentLink then
local _, currentCount = GetContainerItemInfo(bagID, slotID)
local cachedCount = targetButton.itemData and targetButton.itemData.count or 0
if currentCount ~= cachedCount then
needsUpdate = true
end
end
if needsUpdate then
-- Pass the button directly to avoid type mismatch lookup issues
if self:UpdateSingleSlot(bagID, slotID, targetButton) then
updatedCount = updatedCount + 1
else
return -1
end
end
end
-- CRITICAL: Check for NEW items that arrived in slots WITHOUT button mappings
-- Category View only has buttons for filled slots, so new items need full redraw
local numSlots = GetContainerNumSlots(bagID)
if numSlots and numSlots > 0 then
for checkSlotID = 1, numSlots do
-- If slot has an item but no button mapping -> new item arrived
-- Check both numeric and potential string keys
local hasButton = slotToButton[bagID][checkSlotID] or slotToButton[bagID][tostring(checkSlotID)]
if not hasButton then
local currentLink = GetContainerItemLink(bagID, checkSlotID)
if currentLink then
return -1 -- Trigger full redraw to categorize new item
end
end
end
end
return updatedCount
-- Category view: always do full redraw since items may change categories
return -1
else
-- In Single View: check all slots
local numSlots = GetContainerNumSlots(bagID)