WoWInterface (
-   Lua/XML Help (
-   -   How to handle the click of a 'link' (

Hiketeia 07-25-16 11:32 PM

How to handle the click of a 'link'
Probably really simple, pardon me please.

If a "link" (like an itemLink) is printed to the chat frame, when you click on it, it does something - for an item, it opens the tooltip, for pet, the modified one etc. - how do we trigger that something ourselves?

I'm using HandleModifiedItemClick() with an item button and I can ctrl-click it and it pops up in the dressing room. Doesn't seem to be a HandleItemClick() though? I assumed the "modified" was for the ctrl key?

Related to this, I'm trying to use the new "appearanceLink" from C_TransmogCollection and is it just me or when you click on those, does it not actually work right? I noticed it just regular in-game when looting epics the chat says such and such appear was added and if you click that it doesn't bring you to the correct appearance (just the section of the journal it seems?). If it is broken, I assume we have to wait for blizzard to fix that? But if we handle clicking the link like regular, it'll work when they do?

Thanks for your time.

Lombra 07-26-16 04:12 AM

SetItemRef(link, text, button, chatFrame) is what happens when you click a chat link, so you can prehook that to alter current behavior.

Hiketeia 07-26-16 09:23 PM

Thanks for the reply. I didn't want to change anything, I just wanted to cause it to happen. I dug through ItemRef and just look the code I needed for now from there.

Is there any standard method to get the 'hyperlink' portion of the link out of the field? I was passing the full link, and the method I was using was only expecting the stuff between the |H and |h. I did a little string work but figured there should be a standard method for that?

As for the 'transmogappearance' type of link my issue turns out was filters. I had filters set, and their logic that goes to the right page for the item doesn't take that into account. Plus, I'm not using links to things which might not be visible to the particular toon you're on so that's clumsy too.

Lombra 07-27-16 04:30 AM

No function for the specific purpose I don't think. Just do match("|H(.-)|h").

All times are GMT -6. The time now is 05:25 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI