Skip to content

Commit

Permalink
fix build bank not showing with auto toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Apr 29, 2024
1 parent b31d928 commit 5175d47
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion ElvUI/Core/Modules/Bags/Bags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2710,7 +2710,6 @@ B.QuestKeys = {
}

B.AutoToggleEvents = {
guildBank = { GUILDBANKFRAME_OPENED = 'OpenBags', GUILDBANKFRAME_CLOSED = 'CloseBags' },
auctionHouse = { AUCTION_HOUSE_SHOW = 'OpenBags', AUCTION_HOUSE_CLOSED = 'CloseBags' },
professions = { TRADE_SKILL_SHOW = 'OpenBags', TRADE_SKILL_CLOSE = 'CloseBags' },
trade = { TRADE_SHOW = 'OpenBags', TRADE_CLOSED = 'CloseBags' },
Expand Down Expand Up @@ -2783,6 +2782,19 @@ function B:GetBagFlagMenu(flag, text)
return menu
end

function B:GuildBankShow()
local frame = _G.GuildBankFrame
if frame and frame:IsShown() and B.db.autoToggle.guildBank then
B:OpenBags()
end
end

function B:ADDON_LOADED(_, addon)
if addon == 'Blizzard_GuildBankUI' then
_G.GuildBankFrame:HookScript('OnShow', B.GuildBankShow)
end
end

function B:Initialize()
B.db = E.db.bags

Expand Down Expand Up @@ -2936,6 +2948,7 @@ function B:Initialize()
B:DisableBlizzard()
B:UpdateGoldText()

B:RegisterEvent('ADDON_LOADED')
B:RegisterEvent('PLAYER_MONEY', 'UpdateGoldText')
B:RegisterEvent('PLAYER_TRADE_MONEY', 'UpdateGoldText')
B:RegisterEvent('TRADE_MONEY_CHANGED', 'UpdateGoldText')
Expand Down

0 comments on commit 5175d47

Please sign in to comment.