QTfrontend/gamecfgwidget.cpp
changeset 5352 7f57d0c7816a
parent 5238 46ddaf14509d
child 5468 8a7264a094fb
equal deleted inserted replaced
5349:ce527b35d063 5352:7f57d0c7816a
   227 QByteArray GameCFGWidget::getFullConfig() const
   227 QByteArray GameCFGWidget::getFullConfig() const
   228 {
   228 {
   229     QList<QByteArray> bcfg;
   229     QList<QByteArray> bcfg;
   230     int mapgen = pMapContainer->get_mapgen();
   230     int mapgen = pMapContainer->get_mapgen();
   231 
   231 
       
   232     QString currentMap = pMapContainer->getCurrentMap();
       
   233     if (currentMap.size() > 0)
       
   234     {
       
   235         bcfg << QString("emap " + currentMap).toUtf8();
       
   236         if(pMapContainer->getCurrentIsMission())
       
   237             bcfg << QString("escript Maps/%1/map.lua").arg(currentMap).toUtf8();
       
   238     }
       
   239     bcfg << QString("etheme " + pMapContainer->getCurrentTheme()).toUtf8();
       
   240 
       
   241     if (Scripts->currentIndex() > 0)
       
   242     {
       
   243         bcfg << QString("escript Scripts/Multiplayer/%1.lua").arg(Scripts->itemData(Scripts->currentIndex()).toList()[0].toString()).toUtf8();
       
   244     }
       
   245 
   232     bcfg << QString("eseed " + pMapContainer->getCurrentSeed()).toUtf8();
   246     bcfg << QString("eseed " + pMapContainer->getCurrentSeed()).toUtf8();
   233     bcfg << QString("e$gmflags %1").arg(getGameFlags()).toUtf8();
   247     bcfg << QString("e$gmflags %1").arg(getGameFlags()).toUtf8();
   234     bcfg << QString("e$damagepct %1").arg(schemeData(25).toInt()).toUtf8();
   248     bcfg << QString("e$damagepct %1").arg(schemeData(25).toInt()).toUtf8();
   235     bcfg << QString("e$turntime %1").arg(schemeData(26).toInt() * 1000).toUtf8();
   249     bcfg << QString("e$turntime %1").arg(schemeData(26).toInt() * 1000).toUtf8();
   236     bcfg << QString("e$sd_turns %1").arg(schemeData(28).toInt()).toUtf8();
   250     bcfg << QString("e$sd_turns %1").arg(schemeData(28).toInt()).toUtf8();
   268             break;
   282             break;
   269         }
   283         }
   270         default: ;
   284         default: ;
   271     }
   285     }
   272 
   286 
   273     QString currentMap = pMapContainer->getCurrentMap();
       
   274     if (currentMap.size() > 0)
       
   275     {
       
   276         bcfg << QString("emap " + currentMap).toUtf8();
       
   277         if(pMapContainer->getCurrentIsMission())
       
   278             bcfg << QString("escript Maps/%1/map.lua").arg(currentMap).toUtf8();
       
   279     }
       
   280     bcfg << QString("etheme " + pMapContainer->getCurrentTheme()).toUtf8();
       
   281 
       
   282     if (Scripts->currentIndex() > 0)
       
   283     {
       
   284         bcfg << QString("escript Scripts/Multiplayer/%1.lua").arg(Scripts->itemData(Scripts->currentIndex()).toList()[0].toString()).toUtf8();
       
   285     }
       
   286 
       
   287     QByteArray result;
   287     QByteArray result;
   288 
   288 
   289     foreach(QByteArray ba, bcfg)
   289     foreach(QByteArray ba, bcfg)
   290         HWProto::addByteArrayToBuffer(result, ba);
   290         HWProto::addByteArrayToBuffer(result, ba);
   291 
   291