Thread Tools Display Modes
01/18/17, 12:43 AM   #1
Rhyono
AddOn Author - Click to view addons
Join Date: Sep 2016
Posts: 659
Edit Existing Tooltip

Is there a function that allows you to universally hook into a tooltip by name? For practice purposes, I used Zgoo to look at the data of the alchemy tooltip that pops up when you have a solvent and reagents placed. I see that the functions AddLine and ClearLines can be used to modify it, but how would I go about calling those from outside of Zgoo to modify it myself?
  Reply With Quote
01/18/17, 03:16 AM   #2
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
You hook the methods of the well-known tooltips used by build-in code and therefore typically everybody.

InformationTooltip, ItemTooltip, PopupTooltip. For a complete list download ESOUI - The Elder Scrolls Online source code and do a text-search for "<Tooltip ".

The methods are typically SetLink, SetBagItem. My addons use a hook technique originally created by @Garkin, a real smart dev.

Build-in code like the Inventory call these methods on a tooltip, which means your hook. There you call e.g. :AddLine with what you want to add to the tooltip.

The details depend on what you want to do.
  Reply With Quote
01/18/17, 10:00 AM   #3
Ayantir
 
Ayantir's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 1,019
there is few, I did it myself, few examples ae in CraftedPotions, there is others in CritPercent.


btw, nothing really clean.
  Reply With Quote
01/18/17, 11:34 AM   #4
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
I don't really like the idea that an addon hooks into the AddLine function, as it is used by basically any addon that creates custom tooltips. IMO it would be cleaner to try and change the source of the message and change what is passed to the tooltip there. In your case you could take a look at the crafting screen where the tooltip is generated and hook into ALCHEMY:UpdateTooltipLayout().
  Reply With Quote
01/18/17, 01:30 PM   #5
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
@sirinsidiator: Who is talking about hooking AddLine (me not)

As I said: Depends on what one wants to do.
@sirinsidiator is right: If hooking ALCHEMY:UpdateTooltipLayout works, it should be prefered.
  Reply With Quote
01/18/17, 01:44 PM   #6
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
Sorry votan. I only quickly skimmed your message right after I came home and all I read was "Hook [...] AddLine".
  Reply With Quote
01/19/17, 12:44 AM   #7
Rhyono
AddOn Author - Click to view addons
Join Date: Sep 2016
Posts: 659
Thanks, those answers gave me what I needed.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Edit Existing Tooltip

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