Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DataStore_Containers/API/ReagentBank.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ end
local function ScanReagentBank()
local bagID = REAGENT_BANK
if not bagID then return end

local bag = thisCharacter
wipe(bag.items)
wipe(bag.links)
Expand Down
7 changes: 5 additions & 2 deletions DataStore_Containers/API/WarbandBank.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This file keeps track of an account's warband bank (Retail only).
local addonName, addon = ...
local thisCharacter
local warbank
local isBankOpen = false

local DataStore, tonumber, wipe, time, C_Container, C_Bank = DataStore, tonumber, wipe, time, C_Container, C_Bank

Expand All @@ -27,7 +28,7 @@ local TAB_SIZE = 98

local function ScanAccountBankTab(tabID)
local tab = GetBankTab(tabID)
if not tab then return end
if not tab or not isBankOpen then return end

local link, itemID
local isWipeDone = false
Expand Down Expand Up @@ -192,11 +193,13 @@ AddonFactory:OnPlayerLogin(function()
addon:ListenTo("PLAYER_INTERACTION_MANAGER_FRAME_SHOW", function(event, interactionType)
-- .Banker when interacting with a banker in a capital
-- .AccountBanker when interacting with the remote portal

if interactionType == Enum.PlayerInteractionType.Banker or interactionType == Enum.PlayerInteractionType.AccountBanker then
isBankOpen = true
ScanAccountBank()
end
end)
addon:ListenTo("PLAYER_INTERACTION_MANAGER_FRAME_HIDE", function() isBankOpen = false end)


-- The event is triggered when purchasing a new tab, not sure yet if we need it.
addon:ListenTo("PLAYER_ACCOUNT_BANK_TAB_SLOTS_CHANGED", OnAccountBankTabsChanged)
Expand Down
40 changes: 26 additions & 14 deletions DataStore_Containers/DataStore_Containers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,16 @@ local bagSizes = {
[enum.ReagentBank] = hasReagentBank and 98,
[100] = 28, -- MainBankSlots for MoP
}
-- This is kind of ugly, but should allow for backwards compatibility for Classic
if interfaceVersion >= 110200 then
bagSizes[enum.MainBankSlots] = 98
for bagID = Enum.BagIndex.CharacterBankTab_1, Enum.BagIndex.AccountBankTab_5 do
bagSizes[bagID] = 98
end
bagSizes[enum.VoidStorageTab1] = nil
bagSizes[enum.VoidStorageTab2] = nil
bagSizes[enum.ReagentBank] = nil
end

if isRetail then
bagTypeStrings = {
Expand All @@ -366,14 +376,14 @@ else
bagTypeStrings = {
[1] = "Quiver",
[2] = "Ammo Pouch",
[4] = C_Item.GetItemSubClassInfo(LE_ITEM_CLASS_CONTAINER, 1), -- "Soul Bag",
[8] = C_Item.GetItemSubClassInfo(LE_ITEM_CLASS_CONTAINER, 7), -- "Leatherworking Bag",
[16] = C_Item.GetItemSubClassInfo(LE_ITEM_CLASS_CONTAINER, 8), -- "Inscription Bag",
[32] = C_Item.GetItemSubClassInfo(LE_ITEM_CLASS_CONTAINER, 2), -- "Herb Bag"
[64] = C_Item.GetItemSubClassInfo(LE_ITEM_CLASS_CONTAINER, 3), -- "Enchanting Bag",
[128] = C_Item.GetItemSubClassInfo(LE_ITEM_CLASS_CONTAINER, 4), -- "Engineering Bag",
[512] = C_Item.GetItemSubClassInfo(LE_ITEM_CLASS_CONTAINER, 5), -- "Gem Bag",
[1024] = C_Item.GetItemSubClassInfo(LE_ITEM_CLASS_CONTAINER, 6), -- "Mining Bag",
[4] = C_Item.GetItemSubClassInfo(LE_ITEM_CLASS_CONTAINER or Enum.ItemClass.Container, 1), -- "Soul Bag",
[8] = C_Item.GetItemSubClassInfo(LE_ITEM_CLASS_CONTAINER or Enum.ItemClass.Container, 7), -- "Leatherworking Bag",
[16] = C_Item.GetItemSubClassInfo(LE_ITEM_CLASS_CONTAINER or Enum.ItemClass.Container, 8), -- "Inscription Bag",
[32] = C_Item.GetItemSubClassInfo(LE_ITEM_CLASS_CONTAINER or Enum.ItemClass.Container, 2), -- "Herb Bag"
[64] = C_Item.GetItemSubClassInfo(LE_ITEM_CLASS_CONTAINER or Enum.ItemClass.Container, 3), -- "Enchanting Bag",
[128] = C_Item.GetItemSubClassInfo(LE_ITEM_CLASS_CONTAINER or Enum.ItemClass.Container, 4), -- "Engineering Bag",
[512] = C_Item.GetItemSubClassInfo(LE_ITEM_CLASS_CONTAINER or Enum.ItemClass.Container, 5), -- "Gem Bag",
[1024] = C_Item.GetItemSubClassInfo(LE_ITEM_CLASS_CONTAINER or Enum.ItemClass.Container, 6), -- "Mining Bag",
}
end

Expand Down Expand Up @@ -510,7 +520,7 @@ end

local function _GetItemCountByID(container, searchedID)
local count = 0
if not container then return count end
if not container then return count end

for slotID, slot in pairs(container.items) do
local pos = _GetItemCountPosition(slot)
Expand Down Expand Up @@ -649,11 +659,13 @@ AddonFactory:OnPlayerLogin(function()
addon:ListenTo("BAG_UPDATE", OnBagUpdate)
end)

-- Only for Classic & BC, scan the keyring
-- 2024/06/20 : not for Cata either, see later what we do for Classic
-- if not isRetail and HasKey() then
-- ScanBag(enum.Keyring)
-- end
-- Wipe any bag that doesn't exist anymore
if not hasKeyring then EmptyContainer(-2) end -- Use the previous enum value
if not hasReagentBank then EmptyContainer(enum.ReagentBank) end
if not hasVoidBank then
EmptyContainer(enum.VoidStorageTab1)
EmptyContainer(enum.VoidStorageTab2)
end

if not hasKeyring then EmptyContainer(enum.Keyring) end

Expand Down
4 changes: 2 additions & 2 deletions DataStore_Containers/DataStore_Containers.toc
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## Interface: 120000, 50501, 11507
## Interface: 120000, 50503, 20505, 11508
## Title: DataStore_Containers
## IconTexture: Interface\Icons\garrison_building_storehouse

## Notes: Stores information about character bags, bank, and guild banks
## Author: Thaoky (EU-Marécages de Zangar)
## Version: 2025.10.19
## Version: 2026.01.16
## Dependencies: AddonFactory, DataStore
## SavedVariables: DataStore_Containers_Characters, DataStore_Containers_Banks, DataStore_Containers_Guilds, DataStore_Containers_Reagents, DataStore_Containers_VoidStorage, DataStore_Containers_Keystones, DataStore_Containers_BankTypes, DataStore_Containers_Warbank
## X-Category: Interface Enhancements
Expand Down
6 changes: 3 additions & 3 deletions DataStore_Containers/Enum.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Container-related enumerations
local enum = DataStore.Enum

enum.ContainerIDs = {
MainBankSlots = -1, -- bag id of the 28 main bank slots
Keyring = -2, -- keyring bag id (non-retail)
MainBankSlots = Enum.BagIndex.Characterbanktab or -1, -- bag id of the main bank slots (originally 28, now 98)
Keyring = Enum.BagIndex.Keyring or -2, -- keyring bag id (non-retail)
VoidStorageTab1 = -5, -- bag id for the void storage (arbitrary)
VoidStorageTab2 = -6, -- bag id for the void storage (arbitrary)
ReagentBank = -7,
ReagentBank = -7, -- this should have been -3 before 11.2?
ReagentBag = 5,
}