Thank you for your reply.
This is not what I really wanted but I solved it now with the following code:
Lua Code:
local UAN = UniqueAddonName
local SM = SCENE_MANAGER
function UAN.ToogleToolbox()
local window = MyBox
-- toogles the window
window:SetHidden(not window:IsHidden())
-- hide the scene "hudui" when the BtnClose is pressed in the "hudui" scene
if window:IsHidden() and SM:GetCurrentScene():GetName() == "hudui" then
ZO_SceneManager_ToggleHUDUIBinding()
end
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:
/script d(SCENE_MANAGER:GetCurrentScene():GetName())