prg adds option to toggle girders in maze, adjusts some frontend strings
authornemo
Sun, 28 Mar 2010 18:47:35 +0000
changeset 3141 70d65353bd60
parent 3140 749682ae8926
child 3142 1a488adc676c
prg adds option to toggle girders in maze, adjusts some frontend strings
QTfrontend/mapContainer.cpp
QTfrontend/pages.cpp
hedgewars/uLand.pas
--- a/QTfrontend/mapContainer.cpp	Sun Mar 28 18:28:46 2010 +0000
+++ b/QTfrontend/mapContainer.cpp	Sun Mar 28 18:47:35 2010 +0000
@@ -113,13 +113,15 @@
 
     connect(CB_TemplateFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(templateFilterChanged(int)));
 
-    maze_size_label = new QLabel("Size", this);
+    maze_size_label = new QLabel("Tunnel size", this);
     mainLayout.addWidget(maze_size_label, 2, 0);
     maze_size_label->hide();
     maze_size_selection = new QComboBox(this);
     maze_size_selection->addItem(tr("Small"), 0);
     maze_size_selection->addItem(tr("Medium"), 1);
     maze_size_selection->addItem(tr("Large"), 2);
+    maze_size_selection->setCurrentIndex(1);
+    maze_size = 1;
     mainLayout.addWidget(maze_size_selection, 2, 1);
     maze_size_selection->hide();
     connect(maze_size_selection, SIGNAL(currentIndexChanged(int)), this, SLOT(setMaze_size(int)));
@@ -218,7 +220,7 @@
         CB_TemplateFilter->hide();
         maze_size_label->show();
         maze_size_selection->show();
-        emit mapChanged("+rnd+");
+        emit mapChanged("+maze+");
         emit mapgenChanged(mapgen);
         emit themeChanged(chooseMap->itemData(index).toList()[1].toString());
         break;
@@ -284,13 +286,18 @@
 void HWMapContainer::themeSelected(int currentRow)
 {
     QString theme = Themes->at(currentRow);
-    QList<QVariant> mapInfo;
-    mapInfo.push_back(QString("+rnd+"));
-    mapInfo.push_back(theme);
-    mapInfo.push_back(18);
-    mapInfo.push_back(false);
-    chooseMap->setItemData(0, mapInfo);
-    chooseMap->setItemData(1, mapInfo);
+    QList<QVariant> mapInfoRegular;
+    mapInfoRegular.push_back(QString("+rnd+"));
+    mapInfoRegular.push_back(theme);
+    mapInfoRegular.push_back(18);
+    mapInfoRegular.push_back(false);
+    chooseMap->setItemData(0, mapInfoRegular);
+    QList<QVariant> mapInfoMaze;
+    mapInfoMaze.push_back(QString("+maze+"));
+    mapInfoMaze.push_back(theme);
+    mapInfoMaze.push_back(18);
+    mapInfoMaze.push_back(false);
+    chooseMap->setItemData(1, mapInfoMaze);
     gbThemes->setIcon(QIcon(QString("%1/Themes/%2/icon.png").arg(datadir->absolutePath()).arg(theme)));
     emit themeChanged(theme);
 }
@@ -340,7 +347,7 @@
 
 void HWMapContainer::setMap(const QString & map)
 {
-    if(map == "+rnd+")
+    if(map == "+rnd+" || map == "+maze+")
     {
         changeImage();
         return;
@@ -411,8 +418,8 @@
 void HWMapContainer::setMaze_size(int size)
 {
     maze_size = size;
+    maze_size_selection->setCurrentIndex(size);
     emit maze_sizeChanged(size);
-//    emit mapChanged("+rnd+");
     changeImage();
 }
 
@@ -420,6 +427,5 @@
 {
     mapgen = m;
     emit mapgenChanged(m);
-//    emit mapChanged("+rnd+");
     changeImage();
 }
--- a/QTfrontend/pages.cpp	Sun Mar 28 18:28:46 2010 +0000
+++ b/QTfrontend/pages.cpp	Sun Mar 28 18:47:35 2010 +0000
@@ -1044,7 +1044,11 @@
         item->setToolTip(tr("%1 is the host. He may adjust settings and start the game.").arg(list[i + 4]));
         roomsList->setItem(r, 3, item);
 
-        if(list[i + 5].compare("+rnd+"))
+        if(list[i + 5] == "+rnd+")
+            item = new QTableWidgetItem(tr("Random Map")); // selected map (is randomized)
+        else if (list[i+5] == "+maze+")
+            item = new QTableWidgetItem(tr("Random Maze"));
+        else
         {
             item = new QTableWidgetItem(list[i + 5]); // selected map
             
@@ -1053,8 +1057,6 @@
             if(!mapList->contains(list[i + 5]))
                 item->setForeground(QBrush(QColor(255, 0, 0)));
         }
-        else
-            item = new QTableWidgetItem(tr("Random Map")); // selected map (is randomized)
         
         item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable);
         item->setToolTip(tr("Games may be played on precreated or randomized maps."));
--- a/hedgewars/uLand.pas	Sun Mar 28 18:28:46 2010 +0000
+++ b/hedgewars/uLand.pas	Sun Mar 28 18:47:35 2010 +0000
@@ -984,7 +984,8 @@
 FillLand(x+1, cellsize div 2 + cellsize + off_y);
 
 MaxHedgehogs:= 32;
-hasGirders:= false;
+if (GameFlags and gfDisableGirders) <> 0 then hasGirders:= false
+else hasGirders := true;
 leftX:= 0;
 rightX:= playWidth;
 topY:= off_y;