QTfrontend/ui/widget/mapContainer.cpp
changeset 10472 8d04cebedb16
parent 10471 d968b1ac130c
child 10477 b219c5a2317f
--- a/QTfrontend/ui/widget/mapContainer.cpp	Sat Nov 08 10:11:16 2014 -0500
+++ b/QTfrontend/ui/widget/mapContainer.cpp	Sat Nov 08 11:26:16 2014 -0500
@@ -61,6 +61,8 @@
     m_missionsViewSetup = false;
     m_staticViewSetup = false;
     m_script = QString();
+    m_prevMapFeatureSize = 50;
+    m_mapFeatureSize = 50;
 
     hhSmall.load(":/res/hh_small.png");
     hhLimit = 18;
@@ -227,7 +229,7 @@
     mapFeatureSize->setMaximum(100);
     mapFeatureSize->setMinimum(1);
     //mapFeatureSize->setFixedWidth(259);
-    mapFeatureSize->setValue(50);
+    mapFeatureSize->setValue(m_mapFeatureSize);
     mapFeatureSize->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
     bottomLeftLayout->addWidget(mapFeatureSize, 0);
     connect(mapFeatureSize, SIGNAL(valueChanged(int)), this, SLOT(mapFeatureSizeChanged(int)));
@@ -322,7 +324,8 @@
                    get_mapgen(),
                    getMazeSize(),
                    getDrawnMapData(),
-                   m_script
+                   m_script,
+		   m_mapFeatureSize
                   );
 
     setHHLimit(0);
@@ -403,6 +406,11 @@
     return generationStyles->currentRow();
 }
 
+quint32 HWMapContainer::getFeatureSize() const
+{
+    return m_mapFeatureSize;
+}
+
 void HWMapContainer::resizeEvent ( QResizeEvent * event )
 {
     Q_UNUSED(event);
@@ -811,8 +819,15 @@
     emit mapgenChanged(mapgen);
 }
 
-void HWMapContainer::mapFeatureSizeChanged(int index)
+void HWMapContainer::mapFeatureSizeChanged(int val)
 {
+    // needs to be per map type, scales will be different
+    m_mapFeatureSize = val;
+    if (qAbs(m_prevMapFeatureSize-m_mapFeatureSize) > 8)
+    {
+	m_prevMapFeatureSize = m_mapFeatureSize;
+	updatePreview();
+    }
 }
 
 // unused because I needed the space for the slider