diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..3d1aa91 Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index cf9ca0a..0c62d8d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /libs/** -/.vscode/settings.json \ No newline at end of file +/.vscode/settings.json +.idea +.release \ No newline at end of file diff --git a/AdiBags.toc b/AdiBags.toc index 467959e..824f0ae 100644 --- a/AdiBags.toc +++ b/AdiBags.toc @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with AdiBags. If not, see . -## Interface: 110002 +## Interface: 110200 ## Title: AdiBags ## Notes: Adirelle's bag addon. @@ -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 diff --git a/AdiBags_Config/AdiBags_Config.toc b/AdiBags_Config/AdiBags_Config.toc index 1724d33..c4cbf5c 100644 --- a/AdiBags_Config/AdiBags_Config.toc +++ b/AdiBags_Config/AdiBags_Config.toc @@ -1,4 +1,4 @@ -## Interface: 110002 +## Interface: 110200 ## Title: AdiBags Configuration ## Notes: Adirelle's bag addon. diff --git a/config/Options.lua b/config/Options.lua index ba84b94..446033c 100644 --- a/config/Options.lua +++ b/config/Options.lua @@ -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 = { @@ -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) diff --git a/core/Bags.lua b/core/Bags.lua index fa2dc82..1bcdd6a 100644 --- a/core/Bags.lua +++ b/core/Bags.lua @@ -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 diff --git a/core/Constants.lua b/core/Constants.lua index 570133f..0a780b3 100644 --- a/core/Constants.lua +++ b/core/Constants.lua @@ -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 -- 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 diff --git a/core/Hooks.lua b/core/Hooks.lua index 09ac48b..f91eeb4 100644 --- a/core/Hooks.lua +++ b/core/Hooks.lua @@ -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 diff --git a/widgets/ContainerFrame.lua b/widgets/ContainerFrame.lua index 42638b5..e0084df 100644 --- a/widgets/ContainerFrame.lua +++ b/widgets/ContainerFrame.lua @@ -217,7 +217,6 @@ function containerProto:OnCreate(name, isBank, bagObject) if addon.isRetail then if self.isBank then - self:CreateReagentTabButton() self:CreateDepositButton() end self:CreateSortButton() @@ -276,10 +275,10 @@ function containerProto:OnCreate(name, isBank, bagObject) if isBank then if C_Container then hooksecurefunc(C_Container, 'SortBankBags', ForceFullLayout) - hooksecurefunc(C_Container, 'SortReagentBankBags', ForceFullLayout) + --hooksecurefunc(C_Container, 'SortReagentBankBags', ForceFullLayout) else hooksecurefunc('SortBankBags', ForceFullLayout) - hooksecurefunc('SortReagentBankBags', ForceFullLayout) + --hooksecurefunc('SortReagentBankBags', ForceFullLayout) end else if C_Container then @@ -341,25 +340,27 @@ end end function containerProto:CreateDepositButton() - local button = self:CreateModuleAutoButton( - "D", - 0, - REAGENTBANK_DEPOSIT, - L["auto-deposit"], - "autoDeposit", - function() - DepositReagentBank() - for bag in pairs(self:GetBagIds()) do - self:UpdateContent(bag) - end - end, - L["You can block auto-deposit ponctually by pressing a modified key while talking to the banker."] - ) - - if not IsReagentBankUnlocked() then - button:Hide() - button:SetScript('OnEvent', button.Show) - button:RegisterEvent('REAGENTBANK_PURCHASED') + if not addon.isRetail then + local button = self:CreateModuleAutoButton( + "D", + 0, + REAGENTBANK_DEPOSIT, + L["auto-deposit"], + "autoDeposit", + function() + DepositReagentBank() + for bag in pairs(self:GetBagIds()) do + self:UpdateContent(bag) + end + end, + L["You can block auto-deposit ponctually by pressing a modified key while talking to the banker."] + ) + + if not IsReagentBankUnlocked() then + button:Hide() + button:SetScript('OnEvent', button.Show) + button:RegisterEvent('REAGENTBANK_PURCHASED') + end end end @@ -380,7 +381,9 @@ function containerProto:CreateSortButton() 10, function() addon:CloseAllBags() - self.bagObject:Sort(self.isReagentBank) + if not addon.isRetail then + self.bagObject:Sort(self.isReagentBank) + end self.forceLayout = true end, L["(Blizzard's) Sort items"] @@ -399,33 +402,35 @@ function containerProto:CreateLockButton() end function containerProto:CreateReagentTabButton() - local button - button = self:CreateModuleButton( - "R", - 0, - function() - if not IsReagentBankUnlocked() then - PlaySound(SOUNDKIT.IG_MAINMENU_OPTION) - return StaticPopup_Show("CONFIRM_BUY_REAGENTBANK_TAB") - end - self:ShowReagentTab(not self.isReagentBank) - end, - function(_, tooltip) - if not IsReagentBankUnlocked() then - tooltip:AddLine(BANKSLOTPURCHASE, 1, 1, 1) - tooltip:AddLine(REAGENTBANK_PURCHASE_TEXT) - SetTooltipMoney(tooltip, GetReagentBankCost(), nil, COSTS_LABEL) - return - end - tooltip:AddLine( - format( - L['Click to swap between %s and %s.'], - REAGENT_BANK:lower(), - L["Bank"]:lower() - ) - ) - end - ) + if not addon.isRetail then + local button + button = self:CreateModuleButton( + "R", + 0, + function() + if not IsReagentBankUnlocked() then + PlaySound(SOUNDKIT.IG_MAINMENU_OPTION) + return StaticPopup_Show("CONFIRM_BUY_REAGENTBANK_TAB") + end + self:ShowReagentTab(not self.isReagentBank) + end, + function(_, tooltip) + if not IsReagentBankUnlocked() then + tooltip:AddLine(BANKSLOTPURCHASE, 1, 1, 1) + tooltip:AddLine(REAGENTBANK_PURCHASE_TEXT) + SetTooltipMoney(tooltip, GetReagentBankCost(), nil, COSTS_LABEL) + return + end + tooltip:AddLine( + format( + L['Click to swap between %s and %s.'], + REAGENT_BANK:lower(), + L["Bank"]:lower() + ) + ) + end + ) + end end -------------------------------------------------------------------------------- @@ -435,8 +440,8 @@ end function containerProto:GetBagIds() if addon.isRetail then return BAG_IDS[ - self.isReagentBank and "REAGENTBANK_ONLY" or - self.isBank and "BANK_ONLY" or + --self.isReagentBank and "REAGENTBANK_ONLY" or + self.isBank and "BANK" or "BAGS" ] else @@ -515,32 +520,34 @@ function containerProto:RefreshContents() end function containerProto:ShowReagentTab(show) - self:Debug('ShowReagentTab', show) - - self.Title:SetText(show and REAGENT_BANK or L["Bank"]) - self.BagSlotButton:SetEnabled(not show) - if show and self.BagSlotPanel:IsShown() then - self.BagSlotPanel:Hide() - self.BagSlotButton:SetChecked(false) - end - BankFrame.selectedTab = show and 2 or 1 + if not addon.isRetail then + self:Debug('ShowReagentTab', show) + + self.Title:SetText(show and REAGENT_BANK or L["Bank"]) + self.BagSlotButton:SetEnabled(not show) + if show and self.BagSlotPanel:IsShown() then + self.BagSlotPanel:Hide() + self.BagSlotButton:SetChecked(false) + end + BankFrame.selectedTab = show and 2 or 1 - local previousBags = self:GetBagIds() - self.isReagentBank = show + local previousBags = self:GetBagIds() + self.isReagentBank = show - if self.isReagentBank then - self.Title:SetFontObject(addon.fonts.reagentBank.bagFont) - else - self.Title:SetFontObject(addon.fonts[string.lower(self.name)].bagFont) - end + if self.isReagentBank then + self.Title:SetFontObject(addon.fonts.reagentBank.bagFont) + else + self.Title:SetFontObject(addon.fonts[string.lower(self.name)].bagFont) + end - for bag in pairs(previousBags) do - self:UpdateContent(bag) + for bag in pairs(previousBags) do + self:UpdateContent(bag) + end + self.forceLayout = true + self:RefreshContents() + self:UpdateSkin() + self:UpdateSectionFonts() end - self.forceLayout = true - self:RefreshContents() - self:UpdateSkin() - self:UpdateSectionFonts() end function containerProto:UpdateSectionFonts()