Skip to content

Commit

Permalink
Fix more Dragonflight bugs (#735)
Browse files Browse the repository at this point in the history
* Fixed a bug where opening bags when bank isn't managed by AdiBags would break bag interaction.

* Fixed a bug where cooldown textures were not rendering in bags.

* Fixed update cooldown for non-retail use.

* Cooldown callback fix for GetBagID() bug.
  • Loading branch information
Cidan authored Oct 28, 2022
1 parent 82fcdc7 commit ffc9c49
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/Hooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function addon:GetContainerFrame(id, spawn)
if spawn then
local size = GetContainerNumSlots(id)
if size > 0 then
local frame = ContainerFrame_GetOpenFrame()
local frame = ContainerFrame_GetOpenFrame(id)
ContainerFrame_GenerateFrame(frame, size, id)
end
end
Expand Down
17 changes: 12 additions & 5 deletions widgets/ItemButton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ end
--------------------------------------------------------------------------------

function buttonProto:OnShow()
self:RegisterEvent('BAG_UPDATE_COOLDOWN', 'UpdateCooldown')
self:RegisterEvent('BAG_UPDATE_COOLDOWN', 'UpdateCooldownCallback')
self:RegisterEvent('ITEM_LOCK_CHANGED', 'UpdateLock')
self:RegisterEvent('QUEST_ACCEPTED', 'UpdateBorder')
self:RegisterEvent('BAG_NEW_ITEMS_UPDATED', 'UpdateNew')
Expand Down Expand Up @@ -322,7 +322,7 @@ function buttonProto:Update()
end
self:UpdateCount()
self:UpdateBorder()
self:UpdateCooldown()
self:UpdateCooldown(self.texture)
self:UpdateLock()
self:UpdateNew()
if addon.isRetail then
Expand Down Expand Up @@ -367,9 +367,16 @@ function buttonProto:UpdateSearch()
end
end

function buttonProto:UpdateCooldown()
-- TODO(lobato): Figure out where this function disappeared to?
--return ContainerFrame_UpdateCooldown(self.bag, self)
do
if not addon.isRetail then
function buttonProto:UpdateCooldown(texture)
return ContainerFrame_UpdateCooldown(self.bag, self)
end
end
end

function buttonProto:UpdateCooldownCallback()
self:UpdateCooldown(self.texture)
end

function buttonProto:UpdateNew()
Expand Down

0 comments on commit ffc9c49

Please sign in to comment.