dmuratshin 9 years ago
parent
commit
13d647cd14
3 changed files with 31 additions and 1 deletions
  1. 20 1
      src/flow/Scene.cpp
  2. 7 0
      src/flow/Scene.h
  3. 4 0
      src/flow/flow.cpp

+ 20 - 1
src/flow/Scene.cpp

@@ -129,6 +129,18 @@ namespace oxygine
             return t;
             return t;
         }
         }
 
 
+        void Scene::_flowPreLeaving()
+        {
+            preLeaving();
+            preHiding();
+        }
+
+        void Scene::_flowPostLeaving()
+        {            
+            postHiding();
+            postLeaving();
+        }
+
         void Scene::preEntering()
         void Scene::preEntering()
         {
         {
             LOGD("%-20s '%s'", "Scene.preEntering", getName().c_str());
             LOGD("%-20s '%s'", "Scene.preEntering", getName().c_str());
@@ -136,9 +148,16 @@ namespace oxygine
             dispatchEvent(&ev2);
             dispatchEvent(&ev2);
         }
         }
 
 
+        void Scene::postEntering()
+        {
+            LOGD("%-20s '%s'", "Scene.postEntering", getName().c_str());
+            Event ev2(EVENT_POST_ENTERING);
+            dispatchEvent(&ev2);
+        }
+
         void Scene::preLeaving()
         void Scene::preLeaving()
         {
         {
-            //LOGD("%-20s '%s'", "Scene.preLeaving", getName().c_str());
+            LOGD("%-20s '%s'", "Scene.preLeaving", getName().c_str());
             Event ev(EVENT_PRE_LEAVING);
             Event ev(EVENT_PRE_LEAVING);
             dispatchEvent(&ev);
             dispatchEvent(&ev);
         }
         }

+ 7 - 0
src/flow/Scene.h

@@ -37,6 +37,9 @@ namespace oxygine
                 //fired before entering to scene
                 //fired before entering to scene
                 EVENT_PRE_ENTERING = makefourcc('S', 'P', 'E', 'n'),
                 EVENT_PRE_ENTERING = makefourcc('S', 'P', 'E', 'n'),
 
 
+                //fired after entering to scene
+                EVENT_POST_ENTERING = makefourcc('S', 'P', 'S', 'E'),
+
                 //fired before leaving scene
                 //fired before leaving scene
                 EVENT_PRE_LEAVING = makefourcc('S', 'P', 'r', 'L'),
                 EVENT_PRE_LEAVING = makefourcc('S', 'P', 'r', 'L'),
 
 
@@ -131,6 +134,9 @@ namespace oxygine
             spActor _holder;
             spActor _holder;
             bool _inloop;
             bool _inloop;
 
 
+            void _flowPreLeaving();
+            void _flowPostLeaving();
+
         private:
         private:
 
 
             spTransition _transitionIn;
             spTransition _transitionIn;
@@ -145,6 +151,7 @@ namespace oxygine
             void preHiding();
             void preHiding();
             void postHiding();
             void postHiding();
             void preEntering();
             void preEntering();
+            void postEntering();
             void preLeaving();
             void preLeaving();
             void postLeaving();
             void postLeaving();
 
 

+ 4 - 0
src/flow/flow.cpp

@@ -86,6 +86,7 @@ namespace oxygine
                 scene->preEntering();
                 scene->preEntering();
                 scene->preShowing();
                 scene->preShowing();
                 scene->_holder->attachTo(getStage());
                 scene->_holder->attachTo(getStage());
+                scene->postEntering();
                 scene->postShowing();
                 scene->postShowing();
                 scene->_resultCB = cb;
                 scene->_resultCB = cb;
                 return;
                 return;
@@ -174,6 +175,9 @@ namespace oxygine
             if (!_back || !current->_dialog)
             if (!_back || !current->_dialog)
                 next->postShowing();
                 next->postShowing();
 
 
+            if (next && !_back)
+                next->postEntering();
+
 
 
 
 
             getStage()->removeEventListener(TouchEvent::CLICK, CLOSURE(this, &Flow::blockedTouch));
             getStage()->removeEventListener(TouchEvent::CLICK, CLOSURE(this, &Flow::blockedTouch));