View Single Post
04/17/14, 12:07 PM   #10
Total-Khaos
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 6
Originally Posted by bsrealm View Post
I am trying to hide my UI when player is in any of the screens - inventory, character, mail, etc. I am using the pushed and popped events and checking for

Code:
if ZO_GameMenu_InGame:IsHidden() then
So I can keep it shown when in settings menu.

BUT, pushed is also called when I get into the mouse mode, where I need it to stay visible because I want the user to be able to move it. Any idea how I can detect pure mouse mode vs inventory et al is shown?

Thanks!
This is how I accomplished what you're asking for:

Code:
function AutoHide()
	menu1 = ZO_GameMenu_InGame:IsHidden()
	menu2 = ZO_KeybindStripControlBackground:IsHidden()
	menu3 = ZO_InteractWindow:IsHidden()
	menu4 = ZO_Character:IsHidden()
	if not menu1 or not menu2 or not menu3 or not menu4
	then
		myAddonUI:SetMouseEnabled(false)
		myAddonUIBackdrop:SetHidden(true)
	else
		myAddonUI:SetMouseEnabled(true)
		myAddonUIBackdrop:SetHidden(false)
	end
end
Once this AutoHide function is called from your update function, it should show and hide your specified XML elements. In my example above, it disables the mouse and hides the backdrop I defined in my XML file and reverses that when the menus are closed.

EDIT: I'm not sure if this works with scene manager stuff, but you could change the code to show / hide depending on which menu system is currently opened.

Last edited by Total-Khaos : 04/17/14 at 12:30 PM.
  Reply With Quote