Added "Choose levelset" to menu. Does not work yet.
authorHeli Hyvättinen <heli.hyvattinen@kymp.net>
Mon, 26 Sep 2011 11:36:25 +0000 (14:36 +0300)
committerHeli Hyvättinen <heli.hyvattinen@kymp.net>
Mon, 26 Sep 2011 11:36:25 +0000 (14:36 +0300)
Shows up a list of available levels, but tapping on the list does not
work, it just unpauses the game, the list does not even disappear. The
list is not even separated to multiple items for selecting. "Quit" no
longer fits the screen.

Conflicts:

seascene.cpp
seascene.h

levelset.cpp
seascene.cpp
seascene.h

index 66e0bfe..2cb04b8 100644 (file)
@@ -48,6 +48,11 @@ bool Levelset::isValid()
     return true;
 }
 
+QString Levelset::getName()
+{
+    return name_;
+}
+
 int Levelset::numberOfLevels()
 {
     return levels_.length();
index 74e2d1f..48ca621 100644 (file)
@@ -140,6 +140,8 @@ void SeaScene::setupMap(int ghosts, int rocks, int octopuses, int octopusSpeed)
 
     createAboutBoxItems();
 
+    createSelectLevelsetFromListItems();
+
     createVictoryItems();
 
     createLevelCompletedItems();
@@ -547,6 +549,12 @@ void SeaScene::handleScreenTapped()
     {
         qApp->quit();
     }
+    else if (pItem == pChooseLevelsetItem_)
+    {
+        pPausetextItem_->hide();
+        pSelectLevelsetFromListItem_->show();
+    }
+
 }
 
 
@@ -578,6 +586,10 @@ void SeaScene::createMenuItems()
     pRestartLevelItem_->setHtml(tr("Restart <br> level").prepend(menufonthtml));
     prepareForMenu(pRestartLevelItem_);
 
+    pChooseLevelsetItem_ = new QGraphicsTextItem;
+    pChooseLevelsetItem_->setHtml(tr("Choose <br> levelset").prepend(menufonthtml));
+    prepareForMenu(pChooseLevelsetItem_);
+
     pSettingsItem_ = new QGraphicsTextItem;
     QString vibraText(tr("Turn vibration <br> effects "));
     QString statusText;
@@ -801,10 +813,12 @@ void SeaScene::setItemPointersNull()
     pAboutItem_ = NULL;
     pQuitItem_ = NULL ;
     pMinimizeItem_ = NULL;
+    pChooseLevelsetItem_ = NULL;
 
     pAboutBoxItem_ = NULL;
     pVictoryCongratulationsItem_ = NULL;
     pLevelCompletedItem_ = NULL;
+    pVictoryCongratulationsItem_ = NULL;
     pVictoryScoreItem_ = NULL;
 
 
@@ -858,4 +872,22 @@ void SeaScene::createLevelCompletedItems()
     pTapForNextLevelItem->setZValue(1000);
     pTapForNextLevelItem->setHtml("<font size=\"5\" color = darkorange>Tap to start the next level");
 
+
+void SeaScene::createSelectLevelsetFromListItems()
+{
+    pSelectLevelsetFromListItem_ = new QGraphicsTextItem;
+    addItem(pSelectLevelsetFromListItem_);
+    pSelectLevelsetFromListItem_->setPos(40,80);
+    pSelectLevelsetFromListItem_->setZValue(1000);
+    pSelectLevelsetFromListItem_->hide();
+
+    QString list ("<font color = darkorange size = \"7\">");
+
+    foreach (Levelset set, availableLevelsets_)
+    {
+        list.append(set.getName());
+        list.append("<br>");
+    }
+
+    pSelectLevelsetFromListItem_->setHtml(list);
 }
index fefdfc0..7e6c442 100644 (file)
@@ -111,6 +111,7 @@ protected:
     void createAboutBoxItems();
     void createVictoryItems();
     void createLevelCompletedItems();
+    void createSelectLevelsetFromListItems();
 
     const QString ghostImageFilename_;
     const QString rockImageFilename_;
@@ -137,13 +138,17 @@ protected:
     QGraphicsTextItem * pAboutItem_;
     QGraphicsTextItem * pQuitItem_;
     QGraphicsTextItem * pMinimizeItem_;
+    QGraphicsTextItem * pChooseLevelsetItem_;
 
     QGraphicsTextItem * pVictoryCongratulationsItem_;
     QGraphicsTextItem * pVictoryScoreItem_;
     QGraphicsTextItem * pAboutBoxItem_;
+    QGraphicsTextItem * pVictoryCongratulationsItem_;
 
     QGraphicsTextItem * pLevelCompletedItem_;
 
+    QGraphicsTextItem * pSelectLevelsetFromListItem_;
+
     QList<Levelset> availableLevelsets_;
 
     Levelset levelset_;