--- 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()
{