ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Does anyone know how to extract the text from a PopupTooltip ? (https://www.esoui.com/forums/showthread.php?t=1825)

CrazyDutchGuy 06/21/14 08:00 AM

Does anyone know how to extract the text from a PopupTooltip ?
 
Does anyone know how to extract the text from a PopupTooltip ?

I can't find the text controls for the object, there are no handlers to request the information from the tooltip or the objects it is derived from.

Anyone know if it is even possible to do it ?

Garkin 06/21/14 08:57 AM

Quote:

Originally Posted by CrazyDutchGuy (Post 9584)
Does anyone know how to extract the text from a PopupTooltip ?

I can't find the text controls for the object, there are no handlers to request the information from the tooltip or the objects it is derived from.

Anyone know if it is even possible to do it ?

I didn't find a way. Even if I'm able to go through the lines and show or hide them, I can't get any text from them. Each line is just a container and I don't have a clue how to access its chidren.

Lua Code:
  1. TOOLTIP_LINES = {}
  2. local nextLine = true
  3. local container
  4. PopupTooltip:AddControl(WINDOW_MANAGER:CreateControl("MY_CONTROL", PopupTooltip, CT_LABEL))
  5. local container = MY_CONTROL:GetParent()
  6. while nextLine do
  7.    local nextLine = select(3,container:GetAnchor(0))
  8.    if nextLine == PopupTooltip then break end
  9.    table.insert(TOOLTIP_LINES, 1, nextLine)
  10.    container = nextLine
  11. end
  12.  
  13. --inspect lines using the /zgoo TOOLTIP_LINES

Vuelhering 07/07/14 08:16 PM

I also looked. I even hooked some of the functions, but still couldn't get anything from the game (only my own changes).

Harven 07/08/14 03:21 AM

You can try iterting through the tooltip childs like that:
Lua Code:
  1. local function CheckChildren(control)
  2.     for i=1, control:GetNumChildren() do
  3.         local c = control:GetChild(i)
  4.         if c then
  5.             local type = c:GetType()
  6.             --do something, like GetText if the control is a CT_LABEL
  7.             CheckChildren(c)
  8.         end
  9.     end
  10. end
  11.  
  12. CheckChildren(PopupTooltip)

But if I remember correctly you will get nothing, like the controls in tooltips are some kind of special control filled by the client.

CrazyDutchGuy 07/08/14 03:27 AM

If you inspect the tooltip with ZGOO for example you will see that there are more children available then are shown. I assume they are declared somehow as private and not accessible for us.

Khaibit 07/08/14 08:21 AM

Quote:

Originally Posted by CrazyDutchGuy (Post 10310)
If you inspect the tooltip with ZGOO for example you will see that there are more children available then are shown. I assume they are declared somehow as private and not accessible for us.

Why does it feel like ZOS has systematically closed off every possible way to get information on an item that isn't currently in an accessible bag? Very frustrating for those of us trying to work with item names outside of that limitation :)

I poked around in tooltips for a few hours last night myself, and didn't make any more progress than you - it definitely looks like there's some private members or private accessors to key children of the tooltip object. =\

Khaibit 07/10/14 03:08 PM

Quote:

Originally Posted by Khaibit (Post 10327)
Why does it feel like ZOS has systematically closed off every possible way to get information on an item that isn't currently in an accessible bag? Very frustrating for those of us trying to work with item names outside of that limitation :)

I poked around in tooltips for a few hours last night myself, and didn't make any more progress than you - it definitely looks like there's some private members or private accessors to key children of the tooltip object. =\

It's mentioned in the thread for the 1.3.0 PTS changes, but just to keep the discussion here also relevant, it looks like we'll soon have all the API calls we need to pull each piece out of tooltips, including localized names! Thanks for surprising me and proving me wrong ZOS :D


All times are GMT -6. The time now is 05:44 AM.

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