this reverts 3861 0.9.14.1
authornemo
Sun, 14 Nov 2010 11:53:27 -0500
branch0.9.14.1
changeset 4322 564a433ca1cb
parent 4320 8af00b86a38c
child 4324 43e3f1eeceb5
this reverts 3861
QTfrontend/mapContainer.cpp
QTfrontend/mapContainer.h
--- a/QTfrontend/mapContainer.cpp	Sun Nov 14 17:42:00 2010 +0100
+++ b/QTfrontend/mapContainer.cpp	Sun Nov 14 11:53:27 2010 -0500
@@ -56,9 +56,8 @@
     imageButt->setFlat(true);
     imageButt->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);//QSizePolicy::Minimum, QSizePolicy::Minimum);
     mainLayout.addWidget(imageButt, 0, 0, 1, 2);
-    //connect(imageButt, SIGNAL(clicked()), this, SLOT(setRandomSeed()));
-    //connect(imageButt, SIGNAL(clicked()), this, SLOT(setRandomTheme()));
-    connect(imageButt, SIGNAL(clicked()), this, SLOT(setRandomMap()));
+    connect(imageButt, SIGNAL(clicked()), this, SLOT(setRandomSeed()));
+    connect(imageButt, SIGNAL(clicked()), this, SLOT(setRandomTheme()));
 
     chooseMap = new QComboBox(this);
     chooseMap->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
@@ -73,7 +72,6 @@
     chooseMap->insertSeparator(chooseMap->count()); // separator between generators and missions
 
     int missionindex = chooseMap->count();
-    numMissions = 0;
     for (int i = 0; i < mapList->size(); ++i) {
         QString map = (*mapList)[i];
         QFile mapCfgFile(
@@ -100,18 +98,15 @@
                 mapInfo.push_back(18);
             mapInfo.push_back(mapLuaFile.exists());
             if(mapLuaFile.exists())
-            {
                 chooseMap->insertItem(missionindex++, 
 // FIXME - need real icons. Disabling until then
 //QIcon(":/res/mapMission.png"), 
 QComboBox::tr("Mission") + ": " + map, mapInfo);
-                numMissions++;
-            }
             else
                 chooseMap->addItem(
 // FIXME - need real icons. Disabling until then
-//QIcon(":/res/mapCustom.png"), 
-map, mapInfo);
+//QIcon(":/res/mapCustom.png"),
+ map, mapInfo);
             mapCfgFile.close();
         }
     }
@@ -407,38 +402,6 @@
     if(items.size())
         lwThemes->setCurrentItem(items.at(0));
 }
-#include <QMessageBox>
-void HWMapContainer::setRandomMap()
-{
-    switch(chooseMap->currentIndex())
-    {
-    case MAPGEN_REGULAR:
-    case MAPGEN_MAZE:
-        setRandomSeed();
-        setRandomTheme();
-        break;
-    default:
-        if(chooseMap->currentIndex() < numMissions + 3)
-            setRandomMission();
-        else
-            setRandomStatic();
-        break;
-    }
-}
-
-void HWMapContainer::setRandomStatic()
-{
-    chooseMap->setCurrentIndex(4 + numMissions + rand() % (chooseMap->count() - 4 - numMissions));
-    m_seed = QUuid::createUuid().toString();
-    emit seedChanged(m_seed);
-}
-
-void HWMapContainer::setRandomMission()
-{
-    chooseMap->setCurrentIndex(3 + rand() % numMissions);
-    m_seed = QUuid::createUuid().toString();
-    emit seedChanged(m_seed);
-}
 
 void HWMapContainer::setRandomSeed()
 {
--- a/QTfrontend/mapContainer.h	Sun Nov 14 17:42:00 2010 +0100
+++ b/QTfrontend/mapContainer.h	Sun Nov 14 11:53:27 2010 -0500
@@ -72,9 +72,6 @@
   void mapChanged(int index);
   void setRandomSeed();
   void setRandomTheme();
-  void setRandomMap();
-  void setRandomStatic();
-  void setRandomMission();
   void themeSelected(int currentRow);
   void addInfoToPreview(QPixmap image);
   void templateFilterChanged(int filter);
@@ -98,7 +95,6 @@
   QLabel *maze_size_label;
   QComboBox *maze_size_selection;
   MapGenerator mapgen;
-  int numMissions;
   int maze_size;
 
   void loadMap(int index);