Quantcast Copy Tooltip - ESOUI
Thread Tools Display Modes
01/30/15, 01:44 AM   #1
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 648
Copy Tooltip

Is there a way to get the tooltip from a mapPin to also show up when mousing over a different control? I still want it to show up for the mapPin, I just want it to also show up over another control.
  Reply With Quote
01/30/15, 05:35 AM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 853
Originally Posted by circonian View Post
Is there a way to get the tooltip from a mapPin to also show up when mousing over a different control? I still want it to show up for the mapPin, I just want it to also show up over another control.
Of course, for example MiniMap does that.

You will need this function:
Lua Code:
  1. ZO_MapPin.TOOLTIP_CREATORS[pinTypeString].creator(mapPin)
__________________
@Garkin (retired from ESO)
My addons: SkyShards, LoreBooks, Dustman, Map Coordinates, No, thank you!, ... (full list)
  Reply With Quote
01/30/15, 08:15 PM   #3
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 648
Originally Posted by Garkin View Post
Of course, for example MiniMap does that.

You will need this function:
Lua Code:
  1. ZO_MapPin.TOOLTIP_CREATORS[pinTypeString].creator(mapPin)
Hm, well I guess I'm doing something else wrong then. Thats what I was trying to do, but it doesn't show up properly.
I will look at miniMap, thank you for the info.

Last edited by circonian : 01/30/15 at 08:18 PM.
  Reply With Quote
01/30/15, 08:34 PM   #4
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 853
Originally Posted by circonian View Post
Hm, well I guess I'm doing something else wrong then. Thats what I was trying to do, but it doesn't show up properly.
I will look at miniMap, thank you for the info.
Ah, sorry there is pinType instead of pinTypeString.

Lua Code:
  1. local pinType = pin:GetPinType()
  2. local tooltipData = pin.TOOLTIP_CREATORS[pinType]
  3. InitializeTooltip(tooltipData.tooltip, yourControl, anchorPoint, xOffset, yOffset)
  4. tooltipData.creator(pin)


In Update 6 will be this code a bit different because WorldMap uses mode instead of tooltip control, so it will look like this:

Lua Code:
  1. local function GetTooltip(mode)
  2.     if mode == 1 then
  3.         return InformationTooltip
  4.     elseif mode == 2 then
  5.         return ZO_KeepTooltip
  6.     elseif mode == 3 then
  7.         return ZO_MapLocationTooltip
  8.     elseif mode == 4 then
  9.         return ZO_ImperialCityTooltip
  10.     else
  11.         return mode
  12.     end
  13. end
  14.  
  15. local pinType = pin:GetPinType()
  16. local tooltipData = pin.TOOLTIP_CREATORS[pinType]
  17. InitializeTooltip(GetTooltip(tooltipData.tooltip), yourControl, anchorPoint, xOffset, yOffset)
  18. tooltipData.creator(pin)
__________________
@Garkin (retired from ESO)
My addons: SkyShards, LoreBooks, Dustman, Map Coordinates, No, thank you!, ... (full list)

Last edited by Garkin : 01/30/15 at 08:38 PM.
  Reply With Quote
01/30/15, 09:11 PM   #5
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 648
Thank you for the help Garkin, looking at miniMap helped.

I was just making a stupid mistake and didn't realize it. I wasn't calling the creator(..) in the correct spot. I was doing this:
Lua Code:
  1. tCreator.creator(mapPinData)
  2. ...
  3. rowControl:SetHandler("OnMouseEnter", function(...)
  4.    ...
  5.    InitializeTooltip(tooltip, rowControl, BOTTOMLEFT, 20, 0, TOPRIGHT)
  6.    ...
  7. end)

Instead of doing it inside the SetHandler:
Lua Code:
  1. rowControl:SetHandler("OnMouseEnter", function(...)
  2.    ...
  3.    InitializeTooltip(tooltip, rowControl, BOTTOMLEFT, 20, 0, TOPRIGHT)
  4.    ...
  5.    tCreator.creator(mapPinData)
  6. end)
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Copy 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