X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=seascene.cpp;h=b483311d37d5c9ae397c977660728c1d19ced00b;hb=3e78e5d189f92bc254bf1e980f17e0e5f2051c87;hp=24c4a0cb7ad2df611f881b9958a152f30b2cb404;hpb=67541efd8bc06e053aa1858b61a30510d8a37c5f;p=ghostsoverboard diff --git a/seascene.cpp b/seascene.cpp index 24c4a0c..b483311 100644 --- a/seascene.cpp +++ b/seascene.cpp @@ -82,6 +82,10 @@ SeaScene::SeaScene(QObject *parent) : connect(pPauseAction_,SIGNAL(toggled(bool)),this,SLOT(pause(bool))); + autopauseTimer.setInterval(15*60*1000); + connect(&autopauseTimer,SIGNAL(timeout()),this,SLOT(forcePause())); + + } void SeaScene::setupMap(int ghosts, int rocks, int octopuses, int octopusSpeed) @@ -208,6 +212,8 @@ void SeaScene::setupMap(int ghosts, int rocks, int octopuses, int octopusSpeed) connect(pOctopus,SIGNAL(droppingGhosts()),pShip,SLOT(dropAllGhosts())); } delete pPosition; + + } void SeaScene::setupMap(Level level) @@ -339,6 +345,8 @@ void SeaScene::pause(bool paused) screenLitKeeper_.keepScreenLit(true); if (pPausetextItem_) pPausetextItem_->hide(); + + autopauseTimer.start(); //Start counting towards autopause } else @@ -353,6 +361,8 @@ void SeaScene::pause(bool paused) qDebug() << "showing pause text"; } else qDebug() << "No pause text available"; + + autopauseTimer.stop(); //No need to count toward autopause when already paused } } @@ -518,6 +528,7 @@ void SeaScene::restartLevel() setupMap(levelList_.value(currentLevel_)); //value() returns default constructor Level if index is invalid, so no risk of crash vibrationActivate(pVibrateAction_->isChecked()); //Vibration effects are lost without this // qDebug() << pVibrateAction_->isChecked(); + autopauseTimer.start(); //reset counting towards autopause }