View Single Post
05/01/20, 11:40 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
You should simply add your UI's toplevel control to a new fragment and then add the fragment to the base vanilla games existing scenes for the "Ui shown" and "UI hidden -> In menus".


Lua Code:
  1. local fragmentOfYourAddon = ZO_HUDFadeSceneFragment:New(YourTopLevelControlNameHere, nil, 0)
  2.     HUD_SCENE:AddFragment(fragmentOfYourAddon )
  3.     HUD_UI_SCENE:AddFragment(fragmentOfYourAddon )

This will automatically hide and show your TLC YourTopLevelControlNameHere as the users presses ESC or I or U etc. and a menu is shown, and show it again after they closed that.

Read more about scenes and fragments here:
https://wiki.esoui.com/Scene_Manager:_On_scene_change
https://wiki.esoui.com/Fragments_in_...t_state_change
  Reply With Quote