Advances to the next level again
authorHeli Hyvättinen <heli.hyvattinen@kymp.net>
Mon, 12 Sep 2011 17:25:18 +0000 (20:25 +0300)
committerHeli Hyvättinen <heli.hyvattinen@kymp.net>
Mon, 12 Sep 2011 17:25:18 +0000 (20:25 +0300)
Conflicts:

seascene.cpp

seascene.cpp

index 27679db..67ffcd1 100644 (file)
@@ -416,9 +416,22 @@ void SeaScene::handleScreenTapped()
         {
             pAboutBoxItem_->hide();
             pPausetextItem_->show();
+            return;
         }
     }
 
+    //If the game is paused, check if the level completed item is shown
+
+    if (pLevelCompletedItem_)
+    {
+        if (pLevelCompletedItem_->isVisible())
+        {
+            pLevelCompletedItem_->hide();
+            restartLevel(); //Current level has already been set to the next one before showing the level completed item
+            pPauseAction_->setChecked(false); //unpause
+            return;
+        }
+    }
    
     //If the game is paused, check if the victory item is being shown
     if(pVictoryCongratulationsItem_)
@@ -432,6 +445,7 @@ void SeaScene::handleScreenTapped()
         }
     }
 
+
     //If the game is paused and no victory or about box, check if menu item was selected
 
     QList<QGraphicsItem *> items = selectedItems();