View Single Post
04/16/14, 11:11 AM   #3
thelegendaryof
 
thelegendaryof's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 161
Or you could attach it to the scene you'd like to attach it to directly:

Code:
local InventoryScene = SCENE_MANAGER.scenes.inventory
InventoryScene:RegisterCallback("StateChange", function(oldState, newState) 
	-- states: hiding, showing, shown, hidden
	if(newState == "showing") then
		-- do something if the inventory is beginning to show
	elseif(newState == "hiding") then
		-- do something if the inventory is beginning to hide
	end
end)
That way it really only triggers when the inventory-scene changes (and not for any other scene)
and you're actually able to begin fading in your window on the exact same moment
it begins to fadein the inventory (or after it is done -> shown, hidden).

/zgoo SCENE_MANAGER.scenes
for a list of all scenes

Last edited by thelegendaryof : 04/16/14 at 11:24 AM.
  Reply With Quote