View Single Post
03/22/19, 03:32 PM   #3
Supportic
Join Date: Mar 2019
Posts: 24
Thank you for your reply.

This is not what I really wanted but I solved it now with the following code:

Lua Code:
  1. local UAN = UniqueAddonName
  2. local SM = SCENE_MANAGER
  3.  
  4. function UAN.ToogleToolbox()
  5.   local window = MyBox
  6.  
  7.   -- toogles the window
  8.   window:SetHidden(not window:IsHidden())
  9.  
  10.   -- hide the scene "hudui" when the BtnClose is pressed in the "hudui" scene
  11.   if window:IsHidden() and SM:GetCurrentScene():GetName() == "hudui" then
  12.     ZO_SceneManager_ToggleHUDUIBinding()
  13.   end
  14. end

My problem was that the scene "hudui" would stay active when I closed the box via a button. When I close the box I expect to go back to the "hud" scene that's why I need to toggle the "hudui" scene to the "hud" scene.

Ingame you can observe the current scene with this command:
Lua Code:
  1. /script d(SCENE_MANAGER:GetCurrentScene():GetName())
  Reply With Quote