ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Copy Tooltip (https://www.esoui.com/forums/showthread.php?t=4250)

circonian 01/30/15 01:44 AM

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.

Garkin 01/30/15 05:35 AM

Quote:

Originally Posted by circonian (Post 18504)
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)

circonian 01/30/15 08:15 PM

Quote:

Originally Posted by Garkin (Post 18505)
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.

Garkin 01/30/15 08:34 PM

Quote:

Originally Posted by circonian (Post 18513)
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)

circonian 01/30/15 09:11 PM

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)


All times are GMT -6. The time now is 06:44 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI