Thread Tools Display Modes
05/01/20, 11:33 AM   #1
satchmo1991
AddOn Author - Click to view addons
Join Date: Apr 2020
Posts: 2
Disabling my ui on various screens

Hello! I am trying to give the user the option to disable my ui during bank interactions, inventory, map screen, character screen, etc. I have inventory and bank interactions figured out, but I can't seem to find a good way to trigger the function based on the other scenarios, like NPC interactions and map. Is there an event handler in the documentation that I'm just missing? Thanks for the help!
  Reply With Quote
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,912
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
05/01/20, 11:51 AM   #3
satchmo1991
AddOn Author - Click to view addons
Join Date: Apr 2020
Posts: 2
This looks like exactly what I need! Thank you so much! I'll try it out right away.

EDIT - Works like a charm! Thanks again!

Last edited by satchmo1991 : 05/01/20 at 12:02 PM.
  Reply With Quote

ESOUI » Developer Discussions » Tutorials & Other Helpful Info » Disabling my ui on various screens

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