# HG changeset patch # User nemo # Date 1289753607 18000 # Node ID 564a433ca1cbfed94dca4658582dec0e014e640a # Parent 8af00b86a38c49ac74239c236057674dd7e83986 this reverts 3861 diff -r 8af00b86a38c -r 564a433ca1cb QTfrontend/mapContainer.cpp --- 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 -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() { diff -r 8af00b86a38c -r 564a433ca1cb QTfrontend/mapContainer.h --- 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);