View Single Post
07/02/17, 05:22 PM   #1
BoarGules
 
BoarGules's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2017
Posts: 34
EVENT_GUILD_DATA_LOADED puzzle

I want to know when a player switches guilds, that is, goes to the guild home page and chooses another guild from the drop-down list.

In the source code at esoui\ingame\guild\guildhsharedinfo.lua I thought I had found exactly what I wanted. It sets up a global variable GUILD_SHARED_INFO which is an instance of class GuildSharedInfo. This responds to the EVENT_GUILD_DATA_LOADED event and helpfully provides a .guildId attribute. Not surprisingly, this all works. If I switch guilds on the guild home page, GUILD_SHARED_INFO.guildId will tell me what the new guildId (integer, 1..5) is.

What I do not understand is that, when I subscribe to it, the event EVENT_GUILD_DATA_LOADED only fires once, at login (and not at /reloadui). Switching guilds on the guild home page does not cause it to fire again, or if it does, my subscription to the event doesn't report it. But GUILD_SHARED_INFO.guildId nonetheless reflects the change, so the class GuildSharedInfo clearly is getting the event reported even though my code doesn't.

I'm clearly missing some crucial point here. Anyone care to explain?
  Reply With Quote