[email protected] 8 years ago
parent
commit
0a41c4fffa
2 changed files with 12 additions and 1 deletions
  1. 2 0
      src/flow/Scene.h
  2. 10 1
      src/flow/flow.cpp

+ 2 - 0
src/flow/Scene.h

@@ -135,6 +135,8 @@ namespace oxygine
             bool _allowDialogsOnTop;
             bool _allowDialogsOnTop;
             bool _passBlockedTouch;
             bool _passBlockedTouch;
 
 
+            std::function< bool(spScene) > _checkIsDialogAllowed;
+
 
 
             spTransition runTransition(Flow*, spScene current, bool back);
             spTransition runTransition(Flow*, spScene current, bool back);
             virtual spTransition _runTransitionIn(Flow*, spScene current);
             virtual spTransition _runTransitionIn(Flow*, spScene current);

+ 10 - 1
src/flow/flow.cpp

@@ -256,7 +256,7 @@ namespace oxygine
                         LOGD("send  blocked touch");
                         LOGD("send  blocked touch");
                         TouchEvent click(TouchEvent::CLICK, true, _blockedTouchPosition);
                         TouchEvent click(TouchEvent::CLICK, true, _blockedTouchPosition);
                         getStage()->handleEvent(&click);
                         getStage()->handleEvent(&click);
-                    }                    
+                    }
                 }
                 }
                 _wasTouchBlocked = false;
                 _wasTouchBlocked = false;
             }
             }
@@ -306,6 +306,15 @@ namespace oxygine
                     break;
                     break;
                 }
                 }
             }
             }
+            if (current->_checkIsDialogAllowed)
+            {
+                for (; it != scenes2show.end(); ++it)
+                {
+                    if ((*it)->_dialog && !current->_checkIsDialogAllowed(*it))
+                        continue;
+                    break;
+                }
+            }
 
 
             if (it == scenes2show.end())
             if (it == scenes2show.end())
                 return;
                 return;