Thread Tools Display Modes
04/09/14, 06:12 AM   #1
Nogaruk
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 15
Help with using Tooltips

Hello and thank you ahead of time to anyone that might be able to shed some light on Tooltip controls for me.

I am new to Lua and XML. So far I have managed to force comparative tooltips to show while in a crafting window. It requires me to run it in an OnUpdate (I am buffering it, thanks to the wiki tutorials) and it is still a little buggy.

The position for the tooltip windows will move around if you leave the construction tab and mouse over anything that can pull up a comparative tooltip. This can be bad when you come back to the construction window. It can, rarely, cover up the base tooltip window for that tab.

Also, if you are under a different tab, the only way I have found so far to keep them showing is to basically constantly set them to be shown. This is not as big of a deal, though. It is not a necessity for them to show there.

I have since started to try and create my own tooltip, but so far have had no luck in getting anything to show. Trying to use create virtual instead of just create, I have only found one template name that would not error, ZO_BaseTooltip , but this still shows nothing visually. I can at least access the tooltip functions, but regardless of what I try to Set.. (SetBagItem for example) I still have no visual elements showing.

I'm hoping someone can at least direct me towards how to properly access/make a tooltip. I have been searching, but I have found zero info on this particular subject. Perhaps I am looking in the wrong direction entirely as well.

Last edited by Nogaruk : 04/09/14 at 06:16 AM. Reason: Formatting
  Reply With Quote
04/10/14, 07:35 PM   #2
Nogaruk
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 15
Update: I've managed to make a tooltip and pull in item info. It's a start at least.

From what I can tell so far, and by all means correct me if I wrong in any of this, tooltips are comprised of:

1) A base container window - This window is here for nothing other than to control where the tooltip is anchored and to move the tooltip around if it is moveable.

2) The controller type of CT_TOOLTIP - This is the holder for all the text associated to the item it is drawing from. Such as PopupTooltip, ItemTooltip, and ZO_SmithingTopLevelCreationPanelResultTooltip.

3) Children of CT_TOOLTIP - The children consist of any other elements that might be needed for the window, usually they are visual elements. The icon at the top is it's own CT_TEXTURE control. A divider graphic for between the item name and the items info. A bar graphic for enchantment charges. A "fade" graphic for the left and right of the Icon graphic (Just an aesthetic element). A backdrop control for the background. Some others vary depending on what the tooltip is for. These are all children parented to the CT_TOOLTIP controller, though.

From what I've seen so far, just by doing SetWornItem(EQUIP_SLOT_CHEST), all of the text information is automatically pulled from that slot and formatted according to the width and height of the CT_TOOLTIP control.

So I can show a tooltip window and if I know the CT_TEXTURE controller and slot I should be showing for, then I can pull the data in with SetWornItem(equipSlot) and GetTextureInfo(). Hopefully this will help someone else down the line.

Now I just need to figure out how to know what slot I should be showing and when.

Any suggestions on a good way to do this for a crafting station?

I can probably just set an event for station interaction, sethandler an OnUpdate and just check if the crafting stations result tooltip is not hidden. Then just let the OnUpdate keep checking for what the tooltip is showing. Assuming there is a way to check the itemType or equipSlot from that window. Then just keep setting the tooltip's wornitem.
  Reply With Quote
04/11/14, 09:00 AM   #3
Vicster0
 
Vicster0's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 82
This has been my experience as well - the content of the ToolTip is set via functions and only the information about the content being expressed by the ToolTip is updated. Unless I am mistaken, there is not *always* a reference back to what content was used to generate the ToolTip. With PopupTooltip for linked items, the item information is saved in a variable local to the ToolTip control called .lastLink. Otherwise, I have not seen anything.

So yes, what you mentioned should work great for generating a ToolTip from scratch when you know what you want to show.

Let me know how it goes and if you find out anything else on this topic as I am quite interested with my current development.
  Reply With Quote
04/11/14, 04:49 PM   #4
Nogaruk
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 15
I definitely plan on posting if I manage to find any way to pull in tooltip data. Seems like something many people need. I think part of the problem, might be, that some of the information we need could be hidden from us somehow. To give you an example of why this might be the case is if you try to find the texture info. At least with zgoo, some CT_TEXTURE objects have no file name shown for them.

Trying to find the file name for the tooltip fade left and right graphics for example. There is obviously a texture there. It shows as loaded. If you try to pull the file directly with GetTextureInfo() no texture file will actually be passed over. The texture file has a dimension shown. So there is a texture there that the game is using, but for some reason the GetTextureInfo() is hiding the actual file name. Unless this is a fault in zgoo I imagine there is code in place to prevent us from accessing certain information.

Nevertheless they might be hiding the data or calls for tooltips from us. I hope I'm wrong, but at the moment I have to wonder if there even is a way to access it at all. My addon might actually be stuck the way it is if this ends being the case.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Help with using Tooltips


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