Thread Tools Display Modes
06/21/14, 08:00 AM   #1
CrazyDutchGuy
 
CrazyDutchGuy's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 89
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 ?
  Reply With Quote
06/21/14, 08:57 AM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by CrazyDutchGuy View Post
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

Last edited by Garkin : 06/21/14 at 09:09 AM.
  Reply With Quote
07/07/14, 08:16 PM   #3
Vuelhering
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 169
I also looked. I even hooked some of the functions, but still couldn't get anything from the game (only my own changes).
  Reply With Quote
07/08/14, 03:21 AM   #4
Harven
 
Harven's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 135
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.
  Reply With Quote
07/08/14, 03:27 AM   #5
CrazyDutchGuy
 
CrazyDutchGuy's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 89
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.
  Reply With Quote
07/08/14, 08:21 AM   #6
Khaibit
 
Khaibit's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 26
Originally Posted by CrazyDutchGuy View Post
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. =\
  Reply With Quote
07/10/14, 03:08 PM   #7
Khaibit
 
Khaibit's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2014
Posts: 26
Originally Posted by Khaibit View Post
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
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Does anyone know how to extract the text from a PopupTooltip ?

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