Autopauses after 15 minutes. Restarted at start of level and returning
from pause. Timer stopped during paused.
connect(pPauseAction_,SIGNAL(toggled(bool)),this,SLOT(pause(bool)));
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)
}
void SeaScene::setupMap(int ghosts, int rocks, int octopuses, int octopusSpeed)
connect(pOctopus,SIGNAL(droppingGhosts()),pShip,SLOT(dropAllGhosts()));
}
delete pPosition;
connect(pOctopus,SIGNAL(droppingGhosts()),pShip,SLOT(dropAllGhosts()));
}
delete pPosition;
}
void SeaScene::setupMap(Level level)
}
void SeaScene::setupMap(Level level)
screenLitKeeper_.keepScreenLit(true);
if (pPausetextItem_)
pPausetextItem_->hide();
screenLitKeeper_.keepScreenLit(true);
if (pPausetextItem_)
pPausetextItem_->hide();
+
+ autopauseTimer.start(); //Start counting towards autopause
qDebug() << "showing pause text";
}
else qDebug() << "No pause text available";
qDebug() << "showing pause text";
}
else qDebug() << "No pause text available";
+
+ autopauseTimer.stop(); //No need to count toward autopause when already paused
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();
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
#include "screenlitkeeper.h"
#include "level.h"
#include <QAction>
#include "screenlitkeeper.h"
#include "level.h"
#include <QAction>
class SeaScene : public QGraphicsScene
{
class SeaScene : public QGraphicsScene
{