Skip to content

Commit

Permalink
Updated for Patch 11.0.2.
Browse files Browse the repository at this point in the history
Closes #1021 and #1022.
  • Loading branch information
Talyrius committed Sep 8, 2024
1 parent a9a573c commit 1961cbc
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 31 deletions.
2 changes: 1 addition & 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: 110000
## Interface: 110002

## Title: AdiBags
## Notes: Adirelle's bag addon.
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: 110000
## Interface: 110002

## Title: AdiBags Configuration
## Notes: Adirelle's bag addon.
Expand Down
4 changes: 2 additions & 2 deletions Annotations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ _G.InterfaceOptions_AddCategory = function(frame, addOn, position) end
---@field isBank boolean Whether the item is in the player's bank.
---@field item ItemInfo The item information for the item in the bag slot.

---@class ItemInfo ItemInfo is constructed by GetItemInfo(), with some additional fields for use in AdiBags.
---@class ItemInfo ItemInfo is constructed by C_Item.GetItemInfo(), with some additional fields for use in AdiBags.
---@field itemName string The localized name of the item.
---@field itemLink string The localized link of the item.
---@field itemQuality Enum.ItemQuality The item quality, i.e. 1 for common, 2 for uncommon, etc.
---@field itemLevel number The base item level, not including upgrades. See GetDetailedItemLevelInfo() for getting the actual item level.
---@field itemLevel number The base item level, not including upgrades. See C_Item.GetDetailedItemLevelInfo() for getting the actual item level.
---@field itemMinLevel number The minimum level required to use the item, or 0 if there is no level requirement.
---@field itemType string The localized type name of the item: Armor, Weapon, Quest, etc.
---@field itemSubType string The localized sub-type name of the item: Bows, Guns, Staves, etc.
Expand Down
6 changes: 4 additions & 2 deletions core/Constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,19 @@ addon.EXPANSION_MAP = {
[_G.LE_EXPANSION_CLASSIC] = _G.EXPANSION_NAME0,
[_G.LE_EXPANSION_BURNING_CRUSADE] = _G.EXPANSION_NAME1
}
if addon.isRetail or addon.isWrath then
if addon.isRetail or addon.isWrath or addon.isCata then
addon.EXPANSION_MAP[_G.LE_EXPANSION_WRATH_OF_THE_LICH_KING] = _G.EXPANSION_NAME2
addon.EXPANSION_MAP[_G.LE_EXPANSION_CATACLYSM] = _G.EXPANSION_NAME3
addon.EXPANSION_MAP[_G.LE_EXPANSION_MISTS_OF_PANDARIA] = _G.EXPANSION_NAME4
addon.EXPANSION_MAP[_G.LE_EXPANSION_WARLORDS_OF_DRAENOR] = _G.EXPANSION_NAME5
addon.EXPANSION_MAP[_G.LE_EXPANSION_LEGION] = _G.EXPANSION_NAME6
addon.EXPANSION_MAP[_G.LE_EXPANSION_BATTLE_FOR_AZEROTH] = _G.EXPANSION_NAME7
addon.EXPANSION_MAP[_G.LE_EXPANSION_SHADOWLANDS] = _G.EXPANSION_NAME8
addon.EXPANSION_MAP[_G.LE_EXPANSION_DRAGONFLIGHT] = _G.EXPANSION_NAME9
end

if addon.isRetail then
addon.EXPANSION_MAP[_G.LE_EXPANSION_DRAGONFLIGHT] = _G.EXPANSION_NAME9
addon.EXPANSION_MAP[_G.LE_EXPANSION_WAR_WITHIN] = _G.EXPANSION_NAME10
end

-- Tradeskill subclassID -> subclassName
Expand Down Expand Up @@ -316,4 +317,5 @@ Enum.ExpansionType = {
LE_EXPANSION_BATTLE_FOR_AZEROTH = 7,
LE_EXPANSION_SHADOWLANDS = 8,
LE_EXPANSION_DRAGONFLIGHT = 9,
LE_EXPANSION_WAR_WITHIN = 10,
}
4 changes: 2 additions & 2 deletions core/Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function addon:OnEnable()
self:RegisterMessage('AdiBags_BagClosed', 'LayoutBags')

-- Track most windows involving items
if addon.isRetail or addon.isWrath then
if addon.isRetail or addon.isWrath or addon.isCata then
self:RegisterEvent('PLAYER_INTERACTION_MANAGER_FRAME_SHOW', 'UpdateInteractingFrame')
self:RegisterEvent('PLAYER_INTERACTION_MANAGER_FRAME_HIDE', 'UpdateInteractingFrame')
-- TODO(lobato): This is a hack to fix a change in the timing of the interaction manager
Expand Down Expand Up @@ -342,7 +342,7 @@ end

function addon:BAG_UPDATE(event, bag)
updatedBags[bag] = true
if addon.isWrath or addon.isRetail then
if addon.isRetail or addon.isWrath or addon.isCata then
self:SendMessage('AdiBags_BagUpdated', updatedBags)
wipe(updatedBags)
end
Expand Down
6 changes: 3 additions & 3 deletions core/DefaultFilters.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function addon:SetupDefaultFilters()
}

-- [90] Parts of an equipment set
if addon.isRetail or addon.isWrath then
if addon.isRetail or addon.isWrath or addon.isCata then
do
local setFilter = addon:RegisterFilter("ItemSets", 90, "ABEvent-1.0", "ABBucket-1.0")
setFilter.uiName = L['Gear manager item sets']
Expand Down Expand Up @@ -116,7 +116,7 @@ function addon:SetupDefaultFilters()
if location ~= 0 and location ~= 1 and itemIDs[invId] ~= 0 then
local player, bank, bags, voidstorage, slot, container
local slotId
if addon.isWrath then
if addon.isWrath or addon.isCata then
player, bank, bags, slot, container = EquipmentManager_UnpackLocation(location)
else
player, bank, bags, voidstorage, slot, container = EquipmentManager_UnpackLocation(location)
Expand Down Expand Up @@ -202,7 +202,7 @@ function addon:SetupDefaultFilters()
if slotData.class == QUEST or slotData.subclass == QUEST then
return QUEST
else
if addon.isRetail or addon.isWrath then
if addon.isRetail or addon.isWrath or addon.isCata then
local isQuestItem, questId = addon:GetContainerItemQuestInfo(slotData.bag, slotData.slot)
return (questId or isQuestItem) and QUEST
else
Expand Down
1 change: 1 addition & 0 deletions core/ItemDatabase.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ along with AdiBags. If not, see <http://www.gnu.org/licenses/>.

--<GLOBALS
local _G = _G
local GetItemInfo = _G.C_Item.GetItemInfo
local TRADE_GOODS = _G.Enum.ItemClass.Tradegoods
local UNKNOWN = _G.UNKNOWN
--GLOBALS>
Expand Down
6 changes: 3 additions & 3 deletions modules/DataSource.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function mod:OnEnable()
created = true
end
self:RegisterBucketEvent('BAG_UPDATE', 0.5, "Update")
if addon.isRetail or addon.isWrath then
if addon.isRetail or addon.isWrath or addon.isCata then
self:RegisterEvent('PLAYER_INTERACTION_MANAGER_FRAME_SHOW', 'BANKFRAME_OPENED')
self:RegisterEvent('PLAYER_INTERACTION_MANAGER_FRAME_HIDE', 'BANKFRAME_CLOSED')
else
Expand All @@ -85,7 +85,7 @@ function mod:OnEnable()
end

function mod:BANKFRAME_OPENED(e, kind)
if addon.isRetail or addon.isWrath then
if addon.isRetail or addon.isWrath or addon.isCata then
if kind == Enum.PlayerInteractionType.Banker then
self.atBank = true
return self:Update()
Expand All @@ -97,7 +97,7 @@ function mod:BANKFRAME_OPENED(e, kind)
end

function mod:BANKFRAME_CLOSED(e, kind)
if addon.isRetail or addon.isWrath then
if addon.isRetail or addon.isWrath or addon.isCata then
if kind == Enum.PlayerInteractionType.Banker then
self.atBank = false
return self:Update()
Expand Down
29 changes: 15 additions & 14 deletions modules/ItemLevel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -345,23 +345,24 @@ local maxLevelRanges = {}
do
if addon.isRetail then
maxLevelRanges = {
[50] = { 72, 140 }, -- Battle for Azeroth
[60] = { 158, 233 }, -- Shadowlands
[70] = { 252, 434 }, -- Dragonflight
[ 50] = { 72, 140 }, -- Battle for Azeroth
[ 60] = { 158, 291 }, -- Shadowlands
[ 70] = { 252, 535 }, -- Dragonflight
[ 80] = { 554, 639 }, -- The War Within
}
else
maxLevelRanges = {
[25] = { 66, 92 }, -- Classic Season of Disocvery Phase 1
[40] = { 66, 92 }, -- Classic Season of Disocvery Phase 2
[50] = { 66, 92 }, -- Classic Season of Disocvery Phase 3
[60] = { 66, 92 },
[70] = { 100, 164 },
[80] = { 187, 284 },
[85] = { 333, 416 },
[90] = { 450, 616 },
[100] = { 615, 735 },
[110] = { 805, 905 },
[120] = { 310, 350 },
[ 25] = { 23, 35 }, -- Classic: Season of Discovery, Phase 1
[ 40] = { 33, 45 }, -- Classic: Season of Discovery, Phase 2
[ 50] = { 43, 55 }, -- Classic: Season of Discovery, Phase 3
[ 60] = { 66, 92 }, -- Classic
[ 70] = { 100, 164 }, -- The Burning Crusade
[ 80] = { 187, 284 }, -- Wrath of the Lich King
[ 85] = { 333, 416 }, -- Cataclysm
[ 90] = { 450, 616 }, -- Mists of Pandaria
[100] = { 615, 735 }, -- Warlords of Draenor
[110] = { 805, 1000 }, -- Legion
[120] = { 310, 500 }, -- Battle for Azeroth
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion widgets/BagSlots.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ local CursorHasItem = _G.CursorHasItem
local CursorUpdate = _G.CursorUpdate
local GameTooltip = _G.GameTooltip
local GetBankSlotCost = _G.GetBankSlotCost
local GetCoinTextureString = _G.GetCoinTextureString
local GetCoinTextureString = _G.C_CurrencyInfo.GetCoinTextureString
local GetContainerItemID = C_Container and _G.C_Container.GetContainerItemID or _G.GetContainerItemID
local GetContainerItemInfo = C_Container and _G.C_Container.GetContainerItemInfo or _G.GetContainerItemInfo
local GetContainerNumFreeSlots = C_Container and _G.C_Container.GetContainerNumFreeSlots or _G.GetContainerNumFreeSlots
Expand Down
4 changes: 2 additions & 2 deletions widgets/ItemButton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ local GetContainerItemLink = C_Container and _G.C_Container.GetContainerItemLink
local GetContainerItemQuestInfo = C_Container and _G.C_Container.GetContainerItemQuestInfo or _G.GetContainerItemQuestInfo
local GetContainerNumFreeSlots = C_Container and _G.C_Container.GetContainerNumFreeSlots or _G.GetContainerNumFreeSlots
local GetItemInfo = _G.C_Item.GetItemInfo
local GetItemQualityColor = _G.GetItemQualityColor
local GetItemQualityColor = _G.C_Item.GetItemQualityColor
local hooksecurefunc = _G.hooksecurefunc
local IsBattlePayItem = C_Container and _G.C_Container.IsBattlePayItem or _G.IsBattlePayItem or function(...) return false end
local IsContainerItemAnUpgrade = _G.IsContainerItemAnUpgrade
Expand Down Expand Up @@ -460,7 +460,7 @@ if addon.isRetail then
end

local function GetBorder(quality, isQuestItem, questId, isQuestActive, settings)
if addon.isRetail or addon.isWrath then
if addon.isRetail or addon.isWrath or addon.isCata then
if settings.questIndicator then
if questId and not isQuestActive then
return TEXTURE_ITEM_QUEST_BANG
Expand Down

0 comments on commit 1961cbc

Please sign in to comment.