Skip to content

Commit

Permalink
lib: update cargBags, support legion keystone
Browse files Browse the repository at this point in the history
  • Loading branch information
ffainy committed Dec 12, 2021
1 parent 2df3bc6 commit 1488c15
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions libs/cargBags/base/implementation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ local toBagSlot = cargBags.ToBagSlot
local LE_ITEM_CLASS_MISCELLANEOUS = Enum.ItemClass.Miscellaneous or 15
local LE_ITEM_MISCELLANEOUS_COMPANION_PET = Enum.ItemMiscellaneousSubclass.CompanionPet or 2
local PET_CAGE = 82800
local MYTHIC_KEYSTONE = 180653
local MYTHIC_KEYSTONES = {
[180653] = true,
[187786] = true, -- Timewarped
}

--[[!
Creates a new instance of the class
Expand Down Expand Up @@ -322,7 +325,7 @@ function Implementation:GetItemInfo(bagID, slotID, i)
i.level = tonumber(petLevel) or 0
i.classID = LE_ITEM_CLASS_MISCELLANEOUS
i.subClassID = LE_ITEM_MISCELLANEOUS_COMPANION_PET
elseif itemID == MYTHIC_KEYSTONE then
elseif MYTHIC_KEYSTONES[itemID] then
i.level, i.name = strmatch(itemLink, "|H%w+:%d+:%d+:(%d+):.-|h%[(.-)%]|h")
i.level = tonumber(i.level) or 0
end
Expand Down
4 changes: 3 additions & 1 deletion libs/cargBags/mixins-add/plugins/bagBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ function BagButton:OnLeave()
end

function BagButton:OnClick(btn)
if InCombatLockdown() then UIErrorsFrame:AddMessage("|cff99ccff"..ERR_NOT_IN_COMBAT) return end -- PutItemInBag is secure in combat

if(self.notBought) then
BankFrame.nextSlotCost = GetBankSlotCost(GetNumBankSlots())
return StaticPopup_Show("CONFIRM_BUY_BANK_SLOT")
Expand Down Expand Up @@ -230,4 +232,4 @@ cargBags:RegisterPlugin("BagBar", function(self, bags)
self.implementation:RegisterEvent("ITEM_LOCK_CHANGED", bar, onLock)

return bar
end)
end)

0 comments on commit 1488c15

Please sign in to comment.