Skip to content

Commit

Permalink
Added more event handling for bankframe events in Retail.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cidan committed May 11, 2023
1 parent a028dde commit 3ad760b
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions modules/DataSource.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,30 @@ function mod:OnEnable()
created = true
end
self:RegisterBucketEvent('BAG_UPDATE', 0.5, "Update")
self:RegisterEvent('BANKFRAME_OPENED')
self:RegisterEvent('BANKFRAME_CLOSED')
if addon.isRetail or addon.isWrath then
self:RegisterEvent('PLAYER_INTERACTION_MANAGER_FRAME_SHOW', 'BANKFRAME_OPENED')
self:RegisterEvent('PLAYER_INTERACTION_MANAGER_FRAME_HIDE', 'BANKFRAME_CLOSED')
else
self:RegisterEvent('BANKFRAME_OPENED')
self:RegisterEvent('BANKFRAME_CLOSED')
end
self:Update()
end

function mod:BANKFRAME_OPENED()
self.atBank = true
return self:Update()
function mod:BANKFRAME_OPENED(e, kind)
if kind == Enum.PlayerInteractionType.Banker or
kind == Enum.PlayerInteractionType.GuildBanker then
self.atBank = true
return self:Update()
end
end

function mod:BANKFRAME_CLOSED()
self.atBank = false
return self:Update()
function mod:BANKFRAME_CLOSED(e, kind)
if kind == Enum.PlayerInteractionType.Banker or
kind == Enum.PlayerInteractionType.GuildBanker then
self.atBank = false
return self:Update()
end
end

local FAMILY_ORDER = {
Expand Down

0 comments on commit 3ad760b

Please sign in to comment.