ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Tutorials & Other Helpful Info (https://www.esoui.com/forums/forumdisplay.php?f=172)
-   -   Disabling my ui on various screens (https://www.esoui.com/forums/showthread.php?t=9126)

satchmo1991 05/01/20 11:33 AM

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!

Baertram 05/01/20 11:40 AM

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

satchmo1991 05/01/20 11:51 AM

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!


All times are GMT -6. The time now is 03:05 PM.

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