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
Binary file added .DS_Store
Binary file not shown.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/libs/**
/.vscode/settings.json
/.vscode/settings.json
.idea
.release
14 changes: 13 additions & 1 deletion AdiBags.toc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with AdiBags. If not, see <http://www.gnu.org/licenses/>.

## Interface: 110002
## Interface: 110200

## Title: AdiBags
## Notes: Adirelle's bag addon.
Expand All @@ -32,6 +32,18 @@
## OptionalDeps: AdiDebug, BugSack, Swatter
#@end-alpha@

## Category-enUS: Inventory
## Category-deDE: Inventar
## Category-esES: Inventario
## Category-esMX: Inventario
## Category-frFR: Inventaire
## Category-itIT: Inventario
## Category-koKR: 소지품
## Category-ptBR: Inventário
## Category-ruRU: Предметы
## Category-zhCN: 物品栏
## Category-zhTW: 物品欄

#@no-lib-strip@
libs\LibStub\LibStub.lua
libs\CallbackHandler-1.0\CallbackHandler-1.0.xml
Expand Down
2 changes: 1 addition & 1 deletion AdiBags_Config/AdiBags_Config.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 110002
## Interface: 110200

## Title: AdiBags Configuration
## Notes: Adirelle's bag addon.
Expand Down
7 changes: 3 additions & 4 deletions config/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,8 @@ local function GetOptions()
}
},
backpack = CreateBagOptions("Backpack", "backpack"),
bank = CreateBagOptions("Bank", "bank"),
reagentBank = CreateBagOptions("Reagent Bank", "reagentBank"),
-- TODO: Re-enable with bank fixes
--bank = CreateBagOptions("Bank", "bank"),
}
},
items = {
Expand Down Expand Up @@ -732,10 +732,9 @@ local function GetOptions()
if addon.isRetail then
options["args"]["bags"]["args"]["automatically"]["args"]["autoDeposit"] = {
name = L["Deposit reagents"],
desc = L["Automtically deposit all reagents into the reagent bank when you talk to the banker."],
desc = L["Automatically deposit all reagents into the bank when you talk to the banker."],
type = 'toggle',
order = 110,
disabled = function() return not IsReagentBankUnlocked() end,
}
end
hooksecurefunc(addon, "OnModuleCreated", OnModuleCreated)
Expand Down
2 changes: 1 addition & 1 deletion core/Bags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ do

function bank:PreOpen()
self.hooks[BankFrame].Show(BankFrame)
if addon.isRetail and addon.db.profile.autoDeposit and not IsModifierKeyDown() then
if addon.isWoD and addon.db.profile.autoDeposit and not IsModifierKeyDown() then
DepositReagentBank()
end
end
Expand Down
43 changes: 5 additions & 38 deletions core/Constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ addon.isClassic = WOW_PROJECT_ID == WOW_PROJECT_CLASSIC
addon.isBCC = WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC
addon.isWrath = WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC
addon.isCata = WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC
addon.isWoD = WOW_PROJECT_ID == WOW_PROJECT_WOD_CLASSIC

--<GLOBALS
local _G = _G
local BACKPACK_CONTAINER = _G.BACKPACK_CONTAINER or ( Enum.BagIndex and Enum.BagIndex.Backpack ) or 0
local REAGENTBAG_CONTAINER = ( Enum.BagIndex and Enum.BagIndex.REAGENTBAG_CONTAINER ) or 5
local BANK_CONTAINER = _G.BANK_CONTAINER or ( Enum.BagIndex and Enum.BagIndex.Bank ) or -1
local REAGENTBANK_CONTAINER = _G.REAGENTBANK_CONTAINER or ( Enum.BagIndex and Enum.BagIndex.Reagentbank ) or -3
local NUM_BAG_SLOTS = _G.NUM_BAG_SLOTS
local NUM_REAGENTBAG_SLOTS = _G.NUM_REAGENTBAG_SLOTS
local NUM_TOTAL_EQUIPPED_BAG_SLOTS = _G.NUM_TOTAL_EQUIPPED_BAG_SLOTS
Expand All @@ -48,29 +48,14 @@ local pairs = _G.pairs

-- Backpack and bags
local BAGS = { [BACKPACK_CONTAINER] = BACKPACK_CONTAINER }

local BANK = {}
local BANK_ONLY = {}
local REAGENTBANK_ONLY = {}

if addon.isRetail then

-- Bags
for i = 1, NUM_TOTAL_EQUIPPED_BAG_SLOTS do BAGS[i] = i end

-- Base bank bags
BANK_ONLY = { [BANK_CONTAINER] = BANK_CONTAINER }
for i = NUM_TOTAL_EQUIPPED_BAG_SLOTS + 1, NUM_TOTAL_EQUIPPED_BAG_SLOTS + NUM_BANKBAGSLOTS do BANK_ONLY[i] = i end

--- Reagent bank bags
REAGENTBANK_ONLY = { [REAGENTBANK_CONTAINER] = REAGENTBANK_CONTAINER }

-- All bank bags
for _, bags in ipairs { BANK_ONLY, REAGENTBANK_ONLY } do
for id in pairs(bags) do BANK[id] = id end
end
else
for i = 1, NUM_BAG_SLOTS do BAGS[i] = i end
end

local BANK = {}
if not addon.isRetail then
BANK = { [BANK_CONTAINER] = BANK_CONTAINER }
for i = NUM_BAG_SLOTS + 1, NUM_BAG_SLOTS + NUM_BANKBAGSLOTS do BANK[i] = i end
end
Expand Down Expand Up @@ -129,8 +114,6 @@ addon.TRADESKILL_MAP = {
addon.BAG_IDS = {
BAGS = BAGS,
BANK = BANK,
BANK_ONLY = BANK_ONLY,
REAGENTBANK_ONLY = REAGENTBANK_ONLY,
ALL = ALL
}

Expand Down Expand Up @@ -240,13 +223,6 @@ addon.DEFAULT_SETTINGS = {
insets = 3,
color = { 0, 0, 0.0, 1 },
},
reagentBank = {
background = "Blizzard Dialog Background",
border = "Blizzard Tooltip",
borderWidth = 16,
insets = 3,
color = { 0, 0.0, 0, 1 },
},
themes = {
default = {
backpack = {
Expand All @@ -268,15 +244,6 @@ addon.DEFAULT_SETTINGS = {
sectionFont = addon.SectionFontDefault,

},
reagentBank = {
background = "Blizzard Dialog Background",
border = "Blizzard Tooltip",
borderWidth = 16,
insets = 3,
color = { 0, 0.0, 0, 1 },
bagFont = addon.BagFontDefault,
sectionFont = addon.SectionFontDefault,
},
},
},
},
Expand Down
19 changes: 11 additions & 8 deletions core/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ local function DebugTable(t, prevKey)
end
--@end-debug@

local bagKeys = {"backpack", "bank", "reagentBank"}
local bagKeys = {"backpack", "bank"}
function addon:OnInitialize()
-- Create the default font settings for each bag type.
for _, name in ipairs(bagKeys) do
Expand Down Expand Up @@ -122,7 +122,7 @@ function addon:OnEnable()
self:RegisterEvent('BAG_UPDATE')
self:RegisterEvent('BAG_UPDATE_DELAYED')
self:RegisterBucketEvent('PLAYERBANKSLOTS_CHANGED', 0.01, 'BankUpdated')
if addon.isRetail then
if addon.isWoD then
self:RegisterBucketEvent('PLAYERREAGENTBANKSLOTS_CHANGED', 0.01, 'ReagentBankUpdated')
end

Expand Down Expand Up @@ -336,9 +336,10 @@ end
local updatedBags = {}
local updatedBank = { [BANK_CONTAINER] = true }
local updatedReagentBank = {}
if addon.isRetail then
updatedReagentBank = { [REAGENTBANK_CONTAINER] = true }
end
-- Relevant when WoD Classic comes about
--if addon.isRetail then
-- updatedReagentBank = { [REAGENTBANK_CONTAINER] = true }
--end

function addon:BAG_UPDATE(event, bag)
updatedBags[bag] = true
Expand All @@ -355,9 +356,11 @@ end

function addon:BankUpdated(slots)
-- Wrap several PLAYERBANKSLOTS_CHANGED into one AdiBags_BagUpdated message
for slot in pairs(slots) do
if slot > 0 and slot <= NUM_BANKGENERIC_SLOTS then
return self:SendMessage('AdiBags_BagUpdated', updatedBank)
if not addon.isRetail then
for slot in pairs(slots) do
if slot > 0 and slot <= NUM_BANKGENERIC_SLOTS then
return self:SendMessage('AdiBags_BagUpdated', updatedBank)
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion core/Hooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ do
function IterateBuiltInContainers()
if addon:GetInteractingWindow() == "BANKFRAME" then
if addon.isRetail then
return iter, NUM_TOTAL_EQUIPPED_BAG_SLOTS+1 + NUM_BANKBAGSLOTS, -1
return iter, NUM_TOTAL_EQUIPPED_BAG_SLOTS+1, -1
else
return iter, NUM_BAG_SLOTS + NUM_BANKBAGSLOTS, -1
end
Expand Down
Loading