Thread Tools Display Modes
01/31/19, 08:10 AM   #1
Baumkuchen3
AddOn Author - Click to view addons
Join Date: Jan 2019
Posts: 12
HowTo Close addon Window when another menu was opened

I want to hide my addon window whenever another window (Inventory, ESC-Menu, Dialogue) pops-up.

I suppose I need to use a RegisterCallback from SCENE_MANAGER. Is there a callback-Function that will get notified by all open/closes Window/Panel events?
  Reply With Quote
01/31/19, 10:06 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,966
First of all a note.
There is aforum for developing questions: https://www.esoui.com/forums/forumdisplay.php?f=174
This forum here is about existing addons or search of addons.

You can join us on the gitter messenger as it'S easier to talk about code there:
https://gitter.im/esoui/esoui

Back to your topic:
You are right that the scene manager can help here. Please search for "scene callback" (with "") or check this thread
https://www.esoui.com/forums/showthr...ne+callback%22
or the wiki
https://wiki.esoui.com/Scene_Manager:_On_scene_change
or this addon comments here (I had answered someone how his addon can be hidden if menus open etc.):
https://www.esoui.com/downloads/file...age=4#comments

You just need to use the correct scene (which can be determined via SCENE_MANAGER.currentScene) and/or fragment(s) of the scene.
  Reply With Quote
01/31/19, 10:06 AM   #3
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Hi Baumkuchen3,

the "menus" are called scenes. If you want your window to be visible in a number of scenes only, you add your "fragment" to those.

See https://wiki.esoui.com/SimpleNotebookTutorial/part6
  Reply With Quote
02/02/19, 08:16 AM   #4
Baumkuchen3
AddOn Author - Click to view addons
Join Date: Jan 2019
Posts: 12
Thanks, that works fine for me:

Code:
local fragmentWindow1 = ZO_HUDFadeSceneFragment:New(window1, nil, 0)

HUD_SCENE:AddFragment(fragmentWindow1 )
HUD_UI_SCENE:AddFragment(fragmentWindow1 )
now, it hides the Addon window(s) whenever a Menu pops-up
  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » HowTo Close addon Window when another menu was opened


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