From 650859ffe106f1681b8399e974cd0df1fb5a27c0 Mon Sep 17 00:00:00 2001 From: Salikh Gurgenidze Date: Wed, 19 Nov 2025 21:50:42 +0400 Subject: [PATCH] display specific bags like (quiver, ammo pouch, soulbag) separately when viewing other characters bag --- Data/BagScanner.lua | 9 +++++++++ Data/BankScanner.lua | 9 +++++++++ UI/BagFrame.lua | 20 ++++++++++++++++++-- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/Data/BagScanner.lua b/Data/BagScanner.lua index 3e266d5..b769fd1 100644 --- a/Data/BagScanner.lua +++ b/Data/BagScanner.lua @@ -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 diff --git a/Data/BankScanner.lua b/Data/BankScanner.lua index 1e5a6fa..16d0959 100644 --- a/Data/BankScanner.lua +++ b/Data/BankScanner.lua @@ -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 diff --git a/UI/BagFrame.lua b/UI/BagFrame.lua index fa7e33c..db74da2 100644 --- a/UI/BagFrame.lua +++ b/UI/BagFrame.lua @@ -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)