View Single Post
12/02/20, 07:04 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,993
I'd register a callback function to this event to start your code as the guilddata is ready:
https://github.com/esoui/esoui/blob/...shared.lua#L35

Lua Code:
  1. local function OnGuildDataReady(guildId)
  2. ...
  3. end
  4.  
  5. GUILD_BROWSER_MANAGER:RegisterCallback("OnGuildDataReady", OnGuildDataReady)

This is how the ZOs code does it.

Create your own callback register and use e.g. anoher local function MyOnGuildDataReady, and in there do your checks on the guilddata. This should strip your "wait some time" code as it shouldl fire as your requested guildData IS ready.

Maybe this will already fix he 0 issue then.

btw: Did you check the guildId is correct and given? Maybe it is 0 itsself and thus the function returns 0 ?


Guild size data:
https://github.com/esoui/esoui/blob/...nager.lua#L199
Maybe this helps and returns another value (which would make me wonder) GetGuildSizeAttribute(guildId)

Last edited by Baertram : 12/02/20 at 07:12 AM.
  Reply With Quote