QTfrontend/gamecfgwidget.cpp
changeset 4936 d65d438acd23
parent 4720 a9f9c96db60c
child 4941 90572c338e60
--- a/QTfrontend/gamecfgwidget.cpp	Tue Feb 08 02:43:07 2011 +0100
+++ b/QTfrontend/gamecfgwidget.cpp	Tue Feb 08 22:24:30 2011 +0300
@@ -33,7 +33,9 @@
 #include "proto.h"
 
 GameCFGWidget::GameCFGWidget(QWidget* parent) :
-  QGroupBox(parent), mainLayout(this)
+  QGroupBox(parent)
+  , mainLayout(this)
+  , seedRegexp("\\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\}")
 {
     mainLayout.setMargin(0);
 //  mainLayout.setSizeConstraint(QLayout::SetMinimumSize);
@@ -332,7 +334,7 @@
         }
         if (param == "SEED") {
             pMapContainer->setSeed(value);
-            if (!QRegExp("\\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\}").exactMatch(value)) {
+            if (!seedRegexp.exactMatch(value)) {
                 pMapContainer->seedEdit->setVisible(true);
                 }
             return;
@@ -371,6 +373,19 @@
         }
     }
 
+    if (slValue.size() == 3)
+    {
+        if (param == "FULLGENCFG")
+        {
+            QString seed = slValue[2];
+            if (!seedRegexp.exactMatch(seed))
+                pMapContainer->seedEdit->setVisible(true);
+
+            pMapContainer->setMapMapgenSeed(slValue[0], (MapGenerator)slValue[1].toUInt(), seed);
+            return;
+        }
+    }
+
     qWarning("Got bad config param from net");
 }