Recieve and parse DRAWNMAP config
authorunc0rr
Wed, 15 Dec 2010 22:03:46 +0300
changeset 4537 f95f7218531a
parent 4536 11bd8c7e4118
child 4538 4c2dc9d75742
Recieve and parse DRAWNMAP config
QTfrontend/gamecfgwidget.cpp
QTfrontend/mapContainer.cpp
QTfrontend/mapContainer.h
--- a/QTfrontend/gamecfgwidget.cpp	Wed Dec 15 21:48:54 2010 +0300
+++ b/QTfrontend/gamecfgwidget.cpp	Wed Dec 15 22:03:46 2010 +0300
@@ -351,6 +351,10 @@
             Scripts->setCurrentIndex(Scripts->findText(value));
             return;
         }
+        if (param == "DRAWNMAP") {
+            pMapContainer->setDrawnMapData(qUncompress(QByteArray::fromBase64(slValue[0].toLatin1())));
+            return;
+        }
     }
 
     if (slValue.size() == 2)
--- a/QTfrontend/mapContainer.cpp	Wed Dec 15 21:48:54 2010 +0300
+++ b/QTfrontend/mapContainer.cpp	Wed Dec 15 22:03:46 2010 +0300
@@ -539,6 +539,12 @@
     changeImage();
 }
 
+void HWMapContainer::setDrawnMapData(const QByteArray & ar)
+{
+    drawMapScene.decode(ar);
+    changeImage();
+}
+
 QByteArray HWMapContainer::getDrawnMapData()
 {
     return drawMapScene.encode();
--- a/QTfrontend/mapContainer.h	Wed Dec 15 21:48:54 2010 +0300
+++ b/QTfrontend/mapContainer.h	Wed Dec 15 22:03:46 2010 +0300
@@ -65,6 +65,7 @@
   void setTemplateFilter(int);
   void setMapgen(MapGenerator m);
   void setMaze_size(int size);
+  void setDrawnMapData(const QByteArray & ar);
 
  signals:
   void seedChanged(const QString & seed);