Quantcast
Weird Behavior - ZO_LinkHandler_OnLinkMouseUp - ESOUI
Thread Tools Display Modes
07/30/22, 08:44 AM   #1
pithka
AddOn Author - Click to view addons
Join Date: Jan 2021
Posts: 5
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?

Last edited by pithka : 07/30/22 at 09:27 AM.
  Reply With Quote
07/30/22, 11:18 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,205
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.

Last edited by Baertram : 07/30/22 at 11:27 AM.
  Reply With Quote
07/30/22, 01:49 PM   #3
Sharlikran
 
Sharlikran's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 389
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)
__________________
Admin for TES5Edit, occasional LOOT masterlist contributor, and Wrye Bash contributor. I also maintain special Fallout 3 and Fallout NV versions of Wrye Flash.

Last edited by Sharlikran : 07/30/22 at 01:53 PM.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Weird Behavior - ZO_LinkHandler_OnLinkMouseUp

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