ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Weird Behavior - ZO_LinkHandler_OnLinkMouseUp (https://www.esoui.com/forums/showthread.php?t=10292)

pithka 07/30/22 08:44 AM

Weird Behavior - ZO_LinkHandler_OnLinkMouseUp
 
I'm trying to make guild links clickable in my addon. Generating a guild link is pretty easy.
  • GetGuildRecruitmentLink(guildId)

Getting a guildId is easy, simply generate one in game and then copy/paste it into a text editor.
  • |H1:guild:694135|hHard Dungeoneers|h

Then automating a link click is pretty easy
  • ZO_LinkHandler_OnLinkMouseUp(link, button, control)

So you put it all together and the strangest thing happens.
  • ZO_LinkHandler_OnLinkMouseUp(GetGuildRecruitmentLink(575137), MOUSE_BUTTON_INDEX_LEFT)

This will work if you're ALREADY IN THE GUILD, but it will not work if you don't belong to the guild. Which is the exact opposite behavior than you'd want for a guild link. I really can't figure this one out. Any ideas?

Baertram 07/30/22 11:18 AM

Seems that GetGuildRecruitmentLink will only work for your joined guilds, right. Have tested this too.
I have not found anything that will provide you links of others guilds, but I doubt it exists as API.

You can just use something like a pattern and create the links yourself:
Lua Code:
  1. locla function myBuildGuildRecruitmentLink(guildId)
  2.     if guildId == nil then return end
  3.     return string.format("|H1:guild:%s|h%s|h", tostring(guildId), tostring(GetGuildName(guildId)))
  4. end

But GetGuildName does not show me the guild names allthough the id exists, and I can even see the ID within the guild search...

Using /tb GetGuildName(132553) ingame returns an empty string (using merTorchbug).
Something is weird indeed.

Sharlikran 07/30/22 01:49 PM

I have yet to see any guild functions work on guilds you are not a member of.

If you made a for loop with these two functions fine.

GetNumGuilds()
GetGuildId(guildIndex)

However, these (and others) would only work with the guilds you are a member of.

GetNumGuildMembers(guildId)
GetGuildInfo(guildId)
GetGuildName(guildId)


All times are GMT -6. The time now is 01:07 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI