QTfrontend/ui/widget/mapContainer.cpp
changeset 11744 ac58a063d26a
parent 10959 1225f42f61e2
child 11753 5c192a4751d8
--- a/QTfrontend/ui/widget/mapContainer.cpp	Wed Apr 27 13:01:38 2016 +0200
+++ b/QTfrontend/ui/widget/mapContainer.cpp	Wed Apr 27 16:20:59 2016 +0200
@@ -109,6 +109,7 @@
     cType->insertItem(3, tr("Randomly generated"), MapModel::GeneratedMap);
     cType->insertItem(4, tr("Random maze"), MapModel::GeneratedMaze);
     cType->insertItem(5, tr("Random perlin"), MapModel::GeneratedPerlin);
+    cType->insertItem(6, tr("Forts"), MapModel::FortsMap);
     connect(cType, SIGNAL(currentIndexChanged(int)), this, SLOT(mapTypeChanged(int)));
     m_childWidgets << cType;
 
@@ -461,6 +462,10 @@
     {
         //changeMapType(MapModel::HandDrawnMap);
     }
+    else if (map == "+forts+")
+    {
+        //nuffin
+    }
     else if (m_staticMapModel->mapExists(map))
     {
         changeMapType(MapModel::StaticMap, m_staticMapModel->index(m_staticMapModel->findMap(map), 0));
@@ -500,6 +505,7 @@
         case MapModel::GeneratedMap:
         case MapModel::GeneratedMaze:
         case MapModel::GeneratedPerlin:
+        case MapModel::FortsMap:
             setRandomTheme();
             break;
         case MapModel::MissionMap:
@@ -588,6 +594,10 @@
                 m_mapInfo.type = MapModel::HandDrawnMap;
                 f = true;
                 break;
+            case MAPGEN_FORTS:
+                m_mapInfo.type = MapModel::FortsMap;
+                f = true;
+                break;
             case MAPGEN_MAP:
                 switch (m_mapInfo.type)
                 {
@@ -595,6 +605,7 @@
                     case MapModel::GeneratedMaze:
                     case MapModel::GeneratedPerlin:
                     case MapModel::HandDrawnMap:
+                    case MapModel::FortsMap:
                         m_mapInfo.type = MapModel::Invalid;
                     default:
                         break;
@@ -679,6 +690,7 @@
         case MapModel::GeneratedMaze:
         case MapModel::GeneratedPerlin:
         case MapModel::HandDrawnMap:
+        case MapModel::FortsMap:
             askForGeneratedPreview();
             break;
         default:
@@ -804,6 +816,11 @@
             staticMapList->show();
             emit mapChanged(m_curMap);
             break;
+        case MapModel::FortsMap:
+            mapgen = MAPGEN_FORTS;
+            setMapInfo(MapModel::MapInfoForts);
+            lblMapList->hide();
+            break;
         default:
             break;
     }