QTfrontend/gamecfgwidget.cpp
changeset 3133 1ab5f18f4df8
parent 3044 8466bd29280f
child 3236 4ab3917d7d44
--- a/QTfrontend/gamecfgwidget.cpp	Sun Mar 28 00:46:34 2010 +0000
+++ b/QTfrontend/gamecfgwidget.cpp	Sun Mar 28 02:49:39 2010 +0000
@@ -80,6 +80,8 @@
 
     connect(pMapContainer, SIGNAL(seedChanged(const QString &)), this, SLOT(seedChanged(const QString &)));
     connect(pMapContainer, SIGNAL(mapChanged(const QString &)), this, SLOT(mapChanged(const QString &)));
+    connect(pMapContainer, SIGNAL(mapgenChanged(MapGenerator)), this, SLOT(mapgenChanged(MapGenerator)));
+    connect(pMapContainer, SIGNAL(maze_sizeChanged(int)), this, SLOT(maze_sizeChanged(int)));
     connect(pMapContainer, SIGNAL(themeChanged(const QString &)), this, SLOT(themeChanged(const QString &)));
     connect(pMapContainer, SIGNAL(newTemplateFilter(int)), this, SLOT(templateFilterChanged(int)));
 }
@@ -153,6 +155,8 @@
     sl.append(QString("e$minedudpct %1").arg(schemeData(24).toInt()));
     sl.append(QString("e$explosives %1").arg(schemeData(25).toInt()));
     sl.append(QString("e$template_filter %1").arg(pMapContainer->getTemplateFilter()));
+    sl.append(QString("e$mapgen %1").arg(pMapContainer->get_mapgen()));
+    sl.append(QString("e$maze_size %1").arg(pMapContainer->get_maze_size()));
 
     QString currentMap = pMapContainer->getCurrentMap();
     if (currentMap.size() > 0)
@@ -193,6 +197,9 @@
 
     schemeChanged(GameSchemes->currentIndex());
 
+    mapgenChanged(pMapContainer->get_mapgen());
+    maze_sizeChanged(pMapContainer->get_maze_size());
+
     // map must be the last
     QString map = pMapContainer->getCurrentMap();
     if (map.size())
@@ -220,6 +227,14 @@
             pMapContainer->setTemplateFilter(value.toUInt());
             return;
         }
+        if (param == "MAPGEN") {
+            pMapContainer->setMapgen((MapGenerator)value.toUInt());
+            return;
+        }
+        if (param == "MAZE_SIZE") {
+            pMapContainer->setMaze_size(value.toUInt());
+            return;
+        }
     }
 
     if (slValue.size() == 2)
@@ -285,6 +300,16 @@
     emit paramChanged("SCHEME", sl);
 }
 
+void GameCFGWidget::mapgenChanged(MapGenerator m)
+{
+    emit paramChanged("MAPGEN", QStringList(QString::number(m)));
+}
+
+void GameCFGWidget::maze_sizeChanged(int s)
+{
+    emit paramChanged("MAZE_SIZE", QStringList(QString::number(s)));
+}
+
 void GameCFGWidget::resendSchemeData()
 {
     schemeChanged(GameSchemes->currentIndex());