Quantcast
WoW 10.0 - GUILDBANKFRAME_OPENED/CLOSED Events - WoWInterface
Thread Tools Display Modes
10-26-22, 06:27 AM   #1
Pandabull
A Defias Bandit
Join Date: Oct 2022
Posts: 3
WoW 10.0 - GUILDBANKFRAME_OPENED/CLOSED Events

::EDIT::
I have found the C_GuildBank list, but it just shows the events still exist, the game just doesnt fire them anymore when opening and closing the guild bank.



Hi All,

I am a little bit lost. I have a mod that I am maintaining that needs to know when the Guild Bank frame is opened and closed (it's a guild tax mod). Previously in 9.2.7 the game would always fire GUILDBANKFRAME_OPENED when the guild bank is opened and GUILDBANKFRAME_CLOSED when the guild bank frame is closed.

I hooked to those events because I found checking if the guild bank frame was visible was very unreliable as many addons that change the guild bank frame might also change its name (I found this for either bartender4 or Bagnon I cant remember which).

Since 10.0.0 however those events still appear to exist as I can still register for them without getting an error, also they are not on the below list as removed.

https://wowpedia.fandom.com/wiki/Pat....0/API_changes

However suddenly the game just doesnt fire those events when the guild bank opens. I have noticed that it does fire ADDON_LOADED with arg[1] being Blizzard_GuildBankUI, but if a mod overrides the default guild bank frame that likely wont fire off anymore. It also appears to always fire GUILDBANKBAGSLOTS_CHANGED every time the guild bank is opened. But nothing is fired when it closes

So now I have no idea how to reiably hook up to knowing when the guild bank is opened or closed as if I use the GuildBankFrame:IsVisible() check, if there is a mod that has replaced the default that will not work as the frame is likely a different name.

Does anyone have any clues as to how to reliably detect when the guild bank is opened and closed?

Once I get this part fixed I will likely upload it to Curse or WoWInterface (or both). For those who might want to see what the addon currently looks like, I have attached 2 screengrabs. It supports communication through the addon channel for officers to see players other than themselves tax status, auto deposit on bank open with prompt, paying outstanding taxes for a character you deleted or left the guild on (from a character in the guild still obviously). It calculates tax from loot, quest rewards, vendor sales, and AH sales. It also supports offering a player that cannot afford their tax to pay an instalment instead (based off a set percent of the character's current gold total). The rate and instalment percentages are configured using the guild info, or can be overriden by officers that can edit the Officer Note of any one player with different values.

Anyway, I would really appreciate some assistance if anyone know the new way in 10.0.0 how to reliably detect the guild bank opening and closing. For instance, I am fairly new to addon coding, and I have not really played with the C_ functions and the G_ globals, so I am not sure if it could be reflected anywhere in those as I am yet to find a list of those functions to look through.

Thanks in advance.
Attached Thumbnails
Click image for larger version

Name:	TBG-Main.PNG
Views:	66
Size:	559.5 KB
ID:	9753  Click image for larger version

Name:	TBG-Audit.PNG
Views:	33
Size:	438.8 KB
ID:	9754  

Last edited by Pandabull : 10-26-22 at 06:54 AM. Reason: Found C_GuildBank list.
  Reply With Quote
10-26-22, 09:22 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,605
https://wowpedia.fandom.com/wiki/PLA...GER_FRAME_SHOW
https://wowpedia.fandom.com/wiki/PLA...GER_FRAME_HIDE

Some of the older show/hide events still exist but they may disappear at any time.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
10-26-22, 10:08 AM   #3
Pandabull
A Defias Bandit
Join Date: Oct 2022
Posts: 3
Originally Posted by Fizzlemizz View Post
https://wowpedia.fandom.com/wiki/PLA...GER_FRAME_SHOW
https://wowpedia.fandom.com/wiki/PLA...GER_FRAME_HIDE

Some of the older show/hide events still exist but they may disappear at any time.

Thanks, I did turn on temporarily Register for All events just to see what was and was not firing when I opened the gbank, but I couldnt see anything that would certainly help me. I could use the event for guild bank slots changed to detect that its open, but then I wouldnt know how to tell the mod it was closed when the window was closed.

I also dont know much about those PLAYER_INTERACTION_MANAGER_FRAME things, I dont know if they are events or something else, or how to use them (I am a relative newbie to wow mod coding). I certainly didnt see any events fire named like those when I clicked the gbank with the registerallevents turned on and was test printing the event name every time one fired to the default chat frame.

Thanks again, but I am maybe 60% sure that because the BANKFRAME_OPENED still works along with its _CLOSED events normally, it might be just Blizzard created a bug which might still be a bug in 14.0. They have not removed the event (it can still be registered) so clearly not intended not to fire.
  Reply With Quote
10-28-22, 03:19 PM   #4
L3n1n
A Deviate Faerie Dragon
 
L3n1n's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 19
You found correct event, but you need to know correct argument: 10 is GuildBanker. There is example for you:

Lua Code:
  1. local f = CreateFrame("Frame")
  2. f:RegisterEvent("PLAYER_INTERACTION_MANAGER_FRAME_SHOW")
  3. f:SetScript("OnEvent", function(self, event, arg)
  4.     if arg == 10 then
  5.         print('gbank has been opened')
  6.     end
  7. end)
  Reply With Quote
10-28-22, 08:59 PM   #5
Pandabull
A Defias Bandit
Join Date: Oct 2022
Posts: 3
Originally Posted by L3n1n View Post
You found correct event, but you need to know correct argument: 10 is GuildBanker. There is example for you:

Lua Code:
  1. local f = CreateFrame("Frame")
  2. f:RegisterEvent("PLAYER_INTERACTION_MANAGER_FRAME_SHOW")
  3. f:SetScript("OnEvent", function(self, event, arg)
  4.     if arg == 10 then
  5.         print('gbank has been opened')
  6.     end
  7. end)
Thanks for that, yes i did some experimenting and found that ID for the guild bank. I also found that MAIL_CLOSED is the same and thats ID 17.

I have moved my code around accordingly in the event handler and it seems to be working. I guess Blizz is just trying to consolidate events and maybe will eventually remove the gb opened and gb/mailbox closed events after some time.

Thanks for the assistance, it was doing my head in for a bit there.
  Reply With Quote
11-04-22, 07:21 PM   #6
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,023
Originally Posted by Pandabull View Post
Since 10.0.0 however those events still appear to exist as I can still register for them without getting an error, also they are not on the below list as removed.

https://wowpedia.fandom.com/wiki/Pat....0/API_changes

It has now been documented as a small section in https://wowpedia.fandom.com/wiki/Pat...action_Manager
  Reply With Quote

WoWInterface » Developer Discussions » Dev Tools » WoW 10.0 - GUILDBANKFRAME_OPENED/CLOSED Events

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off