[HELP] Display Guild Frame?
Hello,
Does anyone know how to display the main guild frame (the one where guildmates are listed) from an AddOn? I tried the basic "GuildFrame:Show();" but wow returns this LUA error: "attempt to index global 'GuildFrame' (a nil value)" Thanks in advance. |
the :Show command only show's it if it is initially hidden or hidden on purpose.
You need to find a toggle version of it. ToggleGuildFrame(); |
What sacrife said.
Keep in mind that the guild is nowadays a load on demand blizzard addon. "Blizzard_GuildUI". Depending how soon you try to show it it might not be loaded. For unguilded players I'm not sure it loads at all. Do not try to force load it as that tends to break other Blizzard addons (Calendar for example). Your best bet is monitoring ADDON_LOADED for "Blizzard_GuildUI" as first argument, then you know it's available. Hope it helps. |
Thanks :)
Keeping in mind what you said, I tried this: Code:
if (IsInGuild()) then I was just trying to display guild frame when entering WoW in order to quickly see the connected guildmates. |
Quote:
Also LoadAddOn() is not good practice, it can break other LoD Blizzard addons, most notably the Calendar. This might be better: Lua Code:
|
It seems the frame is not created until you open it (manually). After that GuildFrame:Show() should work.
|
ToggleGuildFrame() loads Blizzard_GuildUI upon use, so no need to wait for it.
https://github.com/tekkub/wow-ui-sou...arent.lua#L443 |
Yes but the only 2 places the default client calls that function is when you click the microbutton,
or use the keybind. In both cases the game is fully loaded. Calling it from addon code at say VARIABLES_LOADED will cause the same problem I pointed out above as if you did LoadAddOn() or ## RequiredDependencies on an addon. It's not the best idea. You either need for it to load "normally" or delay calling that function sufficiently. |
I belive the GuildUI is loaded on demand, but I could be wrong.
|
You're absolutely right.
I mentioned that on post #3. The problem is that Blizzard "assumes" the several Blizzard_ LoD addons will load in a specific order. This is an implicit assumption though they are not ReqDep on each other. This (which is essentially a lack of forethought on their part, not addon author's part) causes obscure side-effects when you force-load Blizz LoD addons (like GuildUI) too early. |
I tried your script Dridzt (thanks to post it).
The guild frame was not shown but when I press my key to show it, WoW played the standard little sound and the guild frame didn't appear. Si I believe your script calls the frame without showing it and when I pressed my "guild" shortcut, WoW closed the guild pane. I reloaded the UI and WoW crashed (it never crashes on my computer). So, considering the goal - just show the guild pane on connect - I think I will abandon this non-essential feature. I didn't think it would be so difficult (it worked very easily on pre 4.x Wow version. Anyhow, thanks all for your help. |
All times are GMT -6. The time now is 09:02 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI