Thread Tools Display Modes
06/20/15, 10:01 AM   #1
Weolo
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 79
Same tooltip as bags

The tooltip for an item in my bags contains a lot of information.

I have a texture in my addon that I want to replicate the same tooltip.
How do I do this?
  Reply With Quote
06/29/15, 11:13 AM   #2
Weolo
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 79
Okay maybe not specific enough, let me try again

I have a simple text tooltip at the moment:
Lua Code:
  1. control:SetTexture(traitIcons[traitType].icon)
  2. control:SetHandler("OnMouseEnter", function(self)
  3.   ZO_Tooltips_ShowTextTooltip(self, RIGHT, traitIcons[traitType].name)
  4. end)
  5. control:SetHandler("OnMouseExit", function(self) ZO_Tooltips_HideTextTooltip() end)

And I want to change this over so instead of the text I actually show the proper tooltip for the material.
Example a "Diamond" for the Impenetrable Armor Trait

Whats a good way for me to approach this?

If I have to build the tooltip myself I have found these:
  • ZO_Tooltip:LayoutItem(itemLink, equipped, creatorName, forceFullDurability, enchantMode, previewValueToAdd)
  • ZO_Tooltip:LayoutStyleMaterial(itemLink)
  • GAMEPAD_TOOLTIPS:LayoutItem(GAMEPAD_MOVABLE_TOOLTIP, itemLink)

http://esodata.uesp.net/current/src/...s.lua.html#685
  Reply With Quote
06/29/15, 03:12 PM   #3
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by Weolo View Post
Okay maybe not specific enough, let me try again

I have a simple text tooltip at the moment:
Lua Code:
  1. control:SetTexture(traitIcons[traitType].icon)
  2. control:SetHandler("OnMouseEnter", function(self)
  3.   ZO_Tooltips_ShowTextTooltip(self, RIGHT, traitIcons[traitType].name)
  4. end)
  5. control:SetHandler("OnMouseExit", function(self) ZO_Tooltips_HideTextTooltip() end)

And I want to change this over so instead of the text I actually show the proper tooltip for the material.
Example a "Diamond" for the Impenetrable Armor Trait

Whats a good way for me to approach this?

If I have to build the tooltip myself I have found these:
  • ZO_Tooltip:LayoutItem(itemLink, equipped, creatorName, forceFullDurability, enchantMode, previewValueToAdd)
  • ZO_Tooltip:LayoutStyleMaterial(itemLink)
  • GAMEPAD_TOOLTIPS:LayoutItem(GAMEPAD_MOVABLE_TOOLTIP, itemLink)

http://esodata.uesp.net/current/src/...s.lua.html#685
I don't know, if I got you right, but:
I assume control is a ToolTip which inherits from ZO_ItemIconTooltip.

Code:
ZO_ItemIconTooltip_OnAddGameData(control, TOOLTIP_GAME_DATA_ITEM_ICON, texture)
You can also try to use control:SetLink(itemLink) or control:SetBagItem(bagId, slotIndex)

Is it this, what you are looking for?
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Same tooltip as bags


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