Thread Tools Display Modes
05/01/14, 03:25 PM   #1
NickK
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 10
Show/Hide label when menu closes

I have a label that i want it to hide when an ESO menu (like inventory/friendlist etc) closes, and stop hiding when i reopen the menu.

My problem is i can't find the correct event for it.

In the beginning i tried with ESO_GUI_HIDDEN and ESO_SHOW_GUI but then i realized that this one was wrong since we don't show/hide the GUI. So the next event i tried (and still trying) is EVENT_ACTION_LAYER_POPPED, the good thing is that it somewhat works (the event does get called when i open/close a menu) but the bad thing is that i cant find how to make my label appear only on a specific menu i.e inventory.

Do i do it with that event? Or are there other events specific to each menu?

Also in wiki it says that it has indexes, and thought that probably a number would represent a specific menu, but i can't work with them ether, it doesn't allow me to do it.

Thanks for your help
  Reply With Quote
05/01/14, 03:49 PM   #2
ingeniousclown
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 122
An alternative you could try is to call ZO_PreHook on the SetHidden member of the control you want to connect to and set your control to hide based on the input parameter.

Another alternative is, if you have a different control per menu, set your control's parent to that menu. It should inherit the SetHidden value automagically.
  Reply With Quote
05/01/14, 04:18 PM   #3
Wykkyd
Are you Wykkyd Gaming?
 
Wykkyd's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 107
Honestly? I would just SetParent to the menu you want it hooked to. It'll show/hide with it's new parent.

Edit: like ingeniousclown said.
  Reply With Quote
05/01/14, 04:21 PM   #4
NickK
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 10
Originally Posted by ingeniousclown View Post
An alternative you could try is to call ZO_PreHook on the SetHidden member of the control you want to connect to and set your control to hide based on the input parameter.

Another alternative is, if you have a different control per menu, set your control's parent to that menu. It should inherit the SetHidden value automagically.
To use the second method you said, do i have to make a new TopLevelControl with the name of the control i want the label to show/hide? i.e ZO_FriendsList? Or just change the name of the label to name="$(parent)ZO_FriendsList"
  Reply With Quote
05/01/14, 04:33 PM   #5
ingeniousclown
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 122
Originally Posted by NickK View Post
To use the second method you said, do i have to make a new TopLevelControl with the name of the control i want the label to show/hide? i.e ZO_FriendsList? Or just change the name of the label to name="$(parent)ZO_FriendsList"
Neither of those makes ZO_FriendsList your control's parent.

To make another control a parent to your control, either pass the the parent control (ZO_FriendList in your case) as the "parent" parameter in WINDOW_MANAGER:CreateControl. Or call :SetParent on your control. I suggest you look at the wiki to see the signature of each of these.
  Reply With Quote
05/01/14, 04:35 PM   #6
NickK
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 10
thanks for your help (both), i'll look into it now.
  Reply With Quote
05/01/14, 04:54 PM   #7
NickK
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 10
I did it with WINDOW_MANAGER thanks again for your help.

Btw i tried with :SetParent, but for some reason it didn't want to work, not sure what i was doing wrong.

It was like this control:SetParent(ZO_FriendsList) but it didn't work.

At least i managed it just fine with the WINDOW_MANAGER.

Thanks again!
  Reply With Quote
05/02/14, 08:50 AM   #8
Aicam
Join Date: Apr 2014
Posts: 16
Another way would be to hook directly into SCENE_MANAGER

Lua Code:
  1. local yourFragment = ZO_SimpleSceneFragment( yourControl )
  2.  
  3. -- this scene controls the hud when the recticle is active
  4. local hudScene = SCENE_MANAGER:GetScene( "hud" )
  5. hudScene:AddFragment( yourFragment )
  6.  
  7. -- this scene controls the hud when the mouse is active ( after you hit the '.' key )
  8. local hudUIScene = Scene_MANAGER:GetScene( "hudui" )
  9. hudUIScene:AddFragment( yourFragment )

in a similiar way you can 'append' your controls to the Inventory, etc.
the downside is there is no easy way to 'remove' it since there is no RemoveFragment function
but it shut be possible to remove the fragment from the scene and the force an update of the scene e.g. toggle the scene twice.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Show/Hide label when menu closes


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