View Single Post
01/03/15, 05:24 PM   #7
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Ayantir View Post
I'm already working on this. I prehook SCENE_MANAGER:SetState() and use CHAT_SYSTEM:Minimize() and :Maximize() for my part.

Just need to disable it at 1st state (when addon loads) and check if scene manager is on "hudui" or not.
Usually everything, what you want to do when scene is showing or hiding, is done by registering to StateChange callback, something like:
Lua Code:
  1. local function OnStateChange(oldState, newState)
  2.     if newState == SCENE_SHOWING then
  3.         CHAT_SYSTEM:Minimize()
  4.     elseif newState == SCENE_HIDDEN then
  5.         CHAT_SYSTEM:Maximize()
  6.     end
  7. end
  8.  
  9. local scene = SCENE_MANAGER:GetScene("bank")
  10. scene:RegisterCallback("StateChange", OnStateChange)
But if it works, do it as you like.
  Reply With Quote