QTfrontend/gamecfgwidget.cpp
changeset 4941 90572c338e60
parent 4936 d65d438acd23
child 4976 088d40d8aba2
equal deleted inserted replaced
4940:e247addb947c 4941:90572c338e60
   137     //GBoxOptionsLayout->addWidget(bindEntries, 2, 2);
   137     //GBoxOptionsLayout->addWidget(bindEntries, 2, 2);
   138 
   138 
   139     connect(pMapContainer, SIGNAL(seedChanged(const QString &)), this, SLOT(seedChanged(const QString &)));
   139     connect(pMapContainer, SIGNAL(seedChanged(const QString &)), this, SLOT(seedChanged(const QString &)));
   140     connect(pMapContainer, SIGNAL(mapChanged(const QString &)), this, SLOT(mapChanged(const QString &)));
   140     connect(pMapContainer, SIGNAL(mapChanged(const QString &)), this, SLOT(mapChanged(const QString &)));
   141     connect(pMapContainer, SIGNAL(mapgenChanged(MapGenerator)), this, SLOT(mapgenChanged(MapGenerator)));
   141     connect(pMapContainer, SIGNAL(mapgenChanged(MapGenerator)), this, SLOT(mapgenChanged(MapGenerator)));
   142     connect(pMapContainer, SIGNAL(maze_sizeChanged(int)), this, SLOT(maze_sizeChanged(int)));
   142     connect(pMapContainer, SIGNAL(mazeSizeChanged(int)), this, SLOT(maze_sizeChanged(int)));
   143     connect(pMapContainer, SIGNAL(themeChanged(const QString &)), this, SLOT(themeChanged(const QString &)));
   143     connect(pMapContainer, SIGNAL(themeChanged(const QString &)), this, SLOT(themeChanged(const QString &)));
   144     connect(pMapContainer, SIGNAL(newTemplateFilter(int)), this, SLOT(templateFilterChanged(int)));
   144     connect(pMapContainer, SIGNAL(newTemplateFilter(int)), this, SLOT(templateFilterChanged(int)));
   145     connect(pMapContainer, SIGNAL(drawMapRequested()), this, SIGNAL(goToDrawMap()));
   145     connect(pMapContainer, SIGNAL(drawMapRequested()), this, SIGNAL(goToDrawMap()));
   146     connect(pMapContainer, SIGNAL(drawnMapChanged(const QByteArray &)), this, SLOT(onDrawnMapChanged(const QByteArray &)));
   146     connect(pMapContainer, SIGNAL(drawnMapChanged(const QByteArray &)), this, SLOT(onDrawnMapChanged(const QByteArray &)));
   147 }
   147 }
   244     bcfg << QString("e$mapgen %1").arg(mapgen).toUtf8();
   244     bcfg << QString("e$mapgen %1").arg(mapgen).toUtf8();
   245 
   245 
   246     switch (mapgen)
   246     switch (mapgen)
   247     {
   247     {
   248         case MAPGEN_MAZE:
   248         case MAPGEN_MAZE:
   249             bcfg << QString("e$maze_size %1").arg(pMapContainer->get_maze_size()).toUtf8();
   249             bcfg << QString("e$maze_size %1").arg(pMapContainer->getMazeSize()).toUtf8();
   250             break;
   250             break;
   251 
   251 
   252         case MAPGEN_DRAWN:
   252         case MAPGEN_DRAWN:
   253         {
   253         {
   254             QByteArray data = pMapContainer->getDrawnMapData();
   254             QByteArray data = pMapContainer->getDrawnMapData();
   313 
   313 
   314     schemeChanged(GameSchemes->currentIndex());
   314     schemeChanged(GameSchemes->currentIndex());
   315     scriptChanged(Scripts->currentIndex());
   315     scriptChanged(Scripts->currentIndex());
   316 
   316 
   317     mapgenChanged(pMapContainer->get_mapgen());
   317     mapgenChanged(pMapContainer->get_mapgen());
   318     maze_sizeChanged(pMapContainer->get_maze_size());
   318     maze_sizeChanged(pMapContainer->getMazeSize());
   319 
   319 
   320     // map must be the last
   320     // map must be the last
   321     QString map = pMapContainer->getCurrentMap();
   321     QString map = pMapContainer->getCurrentMap();
   322     if (map.size())
   322     if (map.size())
   323         mapChanged(map);
   323         mapChanged(map);
   350         if (param == "MAPGEN") {
   350         if (param == "MAPGEN") {
   351             pMapContainer->setMapgen((MapGenerator)value.toUInt());
   351             pMapContainer->setMapgen((MapGenerator)value.toUInt());
   352             return;
   352             return;
   353         }
   353         }
   354         if (param == "MAZE_SIZE") {
   354         if (param == "MAZE_SIZE") {
   355             pMapContainer->setMaze_size(value.toUInt());
   355             pMapContainer->setMazeSize(value.toUInt());
   356             return;
   356             return;
   357         }
   357         }
   358         if (param == "SCRIPT") {
   358         if (param == "SCRIPT") {
   359             Scripts->setCurrentIndex(Scripts->findText(value));
   359             Scripts->setCurrentIndex(Scripts->findText(value));
   360             return;
   360             return;
   371             setNetAmmo(slValue[0], slValue[1]);
   371             setNetAmmo(slValue[0], slValue[1]);
   372             return;
   372             return;
   373         }
   373         }
   374     }
   374     }
   375 
   375 
   376     if (slValue.size() == 3)
   376     if (slValue.size() == 5)
   377     {
   377     {
   378         if (param == "FULLGENCFG")
   378         if (param == "FULLMAPCONFIG")
   379         {
   379         {
   380             QString seed = slValue[2];
   380             QString seed = slValue[3];
   381             if (!seedRegexp.exactMatch(seed))
   381             if (!seedRegexp.exactMatch(seed))
   382                 pMapContainer->seedEdit->setVisible(true);
   382                 pMapContainer->seedEdit->setVisible(true);
   383 
   383 
   384             pMapContainer->setMapMapgenSeed(slValue[0], (MapGenerator)slValue[1].toUInt(), seed);
   384             pMapContainer->setAllMapParameters(
       
   385                     slValue[0],
       
   386                     (MapGenerator)slValue[1].toUInt(),
       
   387                     slValue[2].toUInt(),
       
   388                     seed,
       
   389                     slValue[4].toUInt()
       
   390                     );
   385             return;
   391             return;
   386         }
   392         }
   387     }
   393     }
   388 
   394 
   389     qWarning("Got bad config param from net");
   395     qWarning("Got bad config param from net");