QTfrontend/mapContainer.cpp
changeset 4936 d65d438acd23
parent 4701 7ed88cfc99b1
child 4941 90572c338e60
--- a/QTfrontend/mapContainer.cpp	Tue Feb 08 02:43:07 2011 +0100
+++ b/QTfrontend/mapContainer.cpp	Tue Feb 08 22:24:30 2011 +0300
@@ -425,16 +425,21 @@
   //imageButt->setIconSize(imageButt->size());
 }
 
-void HWMapContainer::setSeed(const QString & seed)
+void HWMapContainer::intSetSeed(const QString & seed)
 {
     m_seed = seed;
     if (seed != seedEdit->text())
         seedEdit->setText(seed);
+}
+
+void HWMapContainer::setSeed(const QString & seed)
+{
+    intSetSeed(seed);
     if (chooseMap->currentIndex() < MAPGEN_MAP)
         updatePreview();
 }
 
-void HWMapContainer::setMap(const QString & map)
+void HWMapContainer::intSetMap(const QString & map)
 {
     int id = 0;
     for(int i = 0; i < chooseMap->count(); i++)
@@ -452,10 +457,15 @@
             pMap = 0;
         }
         chooseMap->setCurrentIndex(id);
-        updatePreview();
     }
 }
 
+void HWMapContainer::setMap(const QString &map)
+{
+    intSetMap(map);
+    updatePreview();
+}
+
 void HWMapContainer::setTheme(const QString & theme)
 {
     QList<QListWidgetItem *> items = lwThemes->findItems(theme, Qt::MatchExactly);
@@ -543,11 +553,16 @@
     updatePreview();
 }
 
-void HWMapContainer::setMapgen(MapGenerator m)
+void HWMapContainer::intSetMapgen(MapGenerator m)
 {
     mapgen = m;
     chooseMap->setCurrentIndex(m);
     emit mapgenChanged(m);
+}
+
+void HWMapContainer::setMapgen(MapGenerator m)
+{
+    intSetMapgen(m);
     updatePreview();
 }
 
@@ -620,3 +635,12 @@
         addInfoToPreview(mapImage);
     }
 }
+
+void HWMapContainer::setMapMapgenSeed(const QString & map, MapGenerator m, const QString & seed)
+{
+    setMap(map);
+    setMapgen(m);
+    setSeed(seed);
+
+    updatePreview();
+}