display specific bags like (quiver, ammo pouch, soulbag) separately when viewing other characters bag

This commit is contained in:
Salikh Gurgenidze
2025-11-19 21:50:42 +04:00
parent 8c3afafa2d
commit 650859ffe1
3 changed files with 36 additions and 2 deletions
+9
View File
@@ -23,10 +23,19 @@ end
-- Scan a single bag
function BagScanner:ScanBag(bagID)
-- Determine bag type
local bagType = "regular"
if addon.Modules.Utils:IsSoulBag(bagID) then
bagType = "soul"
elseif addon.Modules.Utils:IsAmmoQuiverBag(bagID) then
bagType = "ammo"
end
local bag = {
slots = {},
numSlots = addon.Modules.Utils:GetBagSlotCount(bagID),
freeSlots = 0,
bagType = bagType,
}
if not addon.Modules.Utils:IsBagValid(bagID) then
+9
View File
@@ -26,10 +26,19 @@ end
-- Scan a single bank bag
function BankScanner:ScanBankBag(bagID)
-- Determine bag type
local bagType = "regular"
if addon.Modules.Utils:IsSoulBag(bagID) then
bagType = "soul"
elseif addon.Modules.Utils:IsAmmoQuiverBag(bagID) then
bagType = "ammo"
end
local bag = {
slots = {},
numSlots = addon.Modules.Utils:GetBagSlotCount(bagID),
freeSlots = 0,
bagType = bagType,
}
if not addon.Modules.Utils:IsBagValid(bagID) then
+18 -2
View File
@@ -198,9 +198,25 @@ function BagFrame:DisplayItems(bagData, isOtherChar, charName)
for _, bagID in ipairs(addon.Constants.BAGS) do
-- Skip hidden bags
if not hiddenBags[bagID] then
if addon.Modules.Utils:IsSoulBag(bagID) then
local bagType
if isOtherChar then
-- For other characters, use saved bag type
local bag = bagData[bagID]
bagType = bag and bag.bagType or "regular"
else
-- For current character, detect bag type in real-time
if addon.Modules.Utils:IsSoulBag(bagID) then
bagType = "soul"
elseif addon.Modules.Utils:IsAmmoQuiverBag(bagID) then
bagType = "ammo"
else
bagType = "regular"
end
end
if bagType == "soul" then
table.insert(soulBags, bagID)
elseif addon.Modules.Utils:IsAmmoQuiverBag(bagID) then
elseif bagType == "ammo" then
table.insert(ammoQuiverBags, bagID)
else
table.insert(regularBags, bagID)