Thread Tools Display Modes
09/19/14, 06:36 AM   #1
Sternentau
board director
 
Sternentau's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 17
How to replace ZO_ChatSystem_OnLinkClicked?

Servus friends,

in past, i was handling links within my addon by a jump to the original ZO routines i.e.:

myControl:SetHandler("OnLinkClicked", function(self, ...) return ZO_ChatSystem_OnLinkClicked(...) end)

...but now it seems ZO_ChatSystem_OnLinkClicked() is gone and i have missed to find any replacement...


Nevertheless clicking onto links in the original chat is still working so there must be a way to handle such mouse clicks.
Any idea how to do?


Thank you

Sternentau
  Reply With Quote
09/19/14, 07:59 AM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
You can use function ZO_LinkHandler_OnLinkClicked(link, button, control) instead of ZO_ChatSystem_OnLinkClicked(link, button).

Or you can use "OnLinkMouseUp" event instead of "OnLinkClicked", the same way as it is in the chat system:
Lua Code:
  1. myControl:SetHandler("OnLinkMouseUp", function(...) ZO_LinkHandler_OnLinkMouseUp(...) end)
  Reply With Quote
09/19/14, 11:53 PM   #3
Sternentau
board director
 
Sternentau's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 17
Hmmm...

maybe i have missed something.

Currently i am calling
mycontrol:SetHandler("OnLinkClicked", function(self,...) tim.sendMessage("me here...") return ZO_LinkHandler_OnLinkClicked(...) end)

and the "me here" is displayed as expected, but nothing else happen.
In past, a left-click with the mouse has displayed an item description if it was an itemlink, but now... nothing

Even if i drop the "return" or the "self", outcome is the same... no error, but also no action from the ZO_LinkHandler


Any idea or addon i can spy in?
  Reply With Quote
09/20/14, 12:18 AM   #4
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
Yes, I had the same problem with pChat, even if i'm using LINK_HANDLER:RegisterCallback and you ZO_ChatSystem_OnLinkClicked (which was calling ZO_LinkHandler_OnLinkClicked). I did a huge rewriting because I was perplex on my code wich did nothing more than.. nothing, but for now my addon works in its beta version by registering both functions..

There's a new function, called ZO_LinkHandler_OnLinkMouseUp(link, button, control), your function need to use it because.. I don't know why ESO devs created this redundand function in fact.

It should work with this one (or maybe both ZO_LinkHandler_OnLinkClicked and ZO_LinkHandler_OnLinkMouseUp ?)
  Reply With Quote
09/20/14, 02:13 AM   #5
Sternentau
board director
 
Sternentau's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 17
Ah. Now i have it.

I was using
mycontrol:SetHandler("OnLinkMouseUp", function(self,...) return ZO_LinkHandler_OnLinkMouseUp(...) end)
but the ZO_LinkHandler_OnLinkMouseUp(...) was not working because it seems the parameterlist has changed also.

With the new code
mycontrol:SetHandler("OnLinkMouseUp", function(self, _, link, button) return ZO_LinkHandler_OnLinkMouseUp(link, button, self) end)
it works like expected.

Strange things happen with Zenimax from time to time


Thank you all for the help
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » How to replace ZO_ChatSystem_OnLinkClicked?


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