Thread Tools Display Modes
08/16/20, 08:17 AM   #1
Scootworks
 
Scootworks's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2014
Posts: 312
i use something like this in one of my addonds. maybe it helps:

Lua Code:
  1. local lastSceneName = "empty"
  2.         local marketAnnouncement = "marketAnnouncement"
  3.         local gameMenuInGame = "gameMenuInGame"
  4.  
  5. SCENE_MANAGER:RegisterCallback("SceneStateChanged", function(scene, oldState, newState)
  6.             local sceneName = scene:GetName()
  7.             if sceneName == marketAnnouncement and lastSceneName ~= gameMenuInGame then
  8.                 if newState == SCENE_SHOWING or newState == SCENE_SHOWN then
  9.                     SCENE_MANAGER:Hide(sceneName)
  10.                 end
  11.             end
  12.             lastSceneName = sceneName
  13.         end)
  Reply With Quote
08/17/20, 12:59 AM   #2
Phinix
 
Phinix's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 186
Originally Posted by Scootworks View Post
i use something like this in one of my addons. maybe it helps:
Thanks for that. I ended up using something a little different:

Code:
	if SCENE_MANAGER:IsShowing("gameMenuInGame") == false then
		-- do stuff
	end
Basically this was for ChatWindowManager, to avoid the auto-minimize when opening the system menu to logout always setting your last chat window state to minimize even if you had it maximized before that, when the option to remember the chat state was enabled.

Last edited by Phinix : 08/17/20 at 01:04 AM.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Detect when in system menu...


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