# HG changeset patch # User unc0rr # Date 1256474447 0 # Node ID cc049fbb65efb14c2ab9f985e3cb9ffbf5c60d56 # Parent f8da275981e563d2832c7c09f9f5f515071ddd73 Change mission file format to allow more flexible config diff -r f8da275981e5 -r cc049fbb65ef QTfrontend/game.cpp --- a/QTfrontend/game.cpp Sun Oct 25 12:19:47 2009 +0000 +++ b/QTfrontend/game.cpp Sun Oct 25 12:40:47 2009 +0000 @@ -136,13 +136,6 @@ QByteArray traincfg; HWProto::addStringToBuffer(traincfg, "TL"); - HWTeam team1; - team1.difficulty = 0; - team1.teamColor = *color1; - team1.numHedgehogs = 1; - HWProto::addStringListToBuffer(traincfg, - team1.TeamGameConfig(100)); - QFile file(datadir->absolutePath() + "/Trainings/" + training + ".txt"); if(!file.open(QFile::ReadOnly)) { @@ -153,7 +146,14 @@ QTextStream stream(&file); while(!stream.atEnd()) { - HWProto::addStringToBuffer(traincfg, "e" + stream.readLine()); + QString line = stream.readLine(); + if(!line.isEmpty() && !line.startsWith("#")) + if(line != "") + HWProto::addStringToBuffer(traincfg, "e" + line); + else + for(int i = 0; i < BINDS_NUMBER; i++) + if(!cbinds[i].strbind.isEmpty()) + HWProto::addStringToBuffer(traincfg, "ebind " + cbinds[i].strbind + " " + cbinds[i].action); } RawSendIPC(traincfg); diff -r f8da275981e5 -r cc049fbb65ef share/hedgewars/Data/Trainings/001_Shotgun.txt --- a/share/hedgewars/Data/Trainings/001_Shotgun.txt Sun Oct 25 12:19:47 2009 +0000 +++ b/share/hedgewars/Data/Trainings/001_Shotgun.txt Sun Oct 25 12:40:47 2009 +0000 @@ -7,7 +7,16 @@ map mushrooms theme nature ammstore 00009000000000000000000000000000000000000000000000000000000000000000000000000000 + +addteam 14483456 Team + +grave Simple +fort Island +voicepack Default +addhh 0 100 hedgehog 0 +hat NoHat hhcoords 2334 1254 + addtrig s2147483649 1 1 30 2154 1274 1 addtrig s1 1 1 30 2334 1914 2 addtrig s2 1 1 30 2774 1484 3 diff -r f8da275981e5 -r cc049fbb65ef tools/MissionsEditor/editor.cpp --- a/tools/MissionsEditor/editor.cpp Sun Oct 25 12:19:47 2009 +0000 +++ b/tools/MissionsEditor/editor.cpp Sun Oct 25 12:40:47 2009 +0000 @@ -55,6 +55,12 @@ if (line.startsWith("seed")) ui->leSeed->setText(line.mid(5)); else + if (line.startsWith("map")) + ui->leMap->setText(line.mid(4)); + else + if (line.startsWith("theme")) + ui->leTheme->setText(line.mid(6)); + else if (line.startsWith("$turntime")) ui->sbTurnTime->setValue(line.mid(10).toInt()); else diff -r f8da275981e5 -r cc049fbb65ef tools/MissionsEditor/editor.ui --- a/tools/MissionsEditor/editor.ui Sun Oct 25 12:19:47 2009 +0000 +++ b/tools/MissionsEditor/editor.ui Sun Oct 25 12:40:47 2009 +0000 @@ -18,7 +18,7 @@ - 1 + 0 @@ -33,7 +33,7 @@ - + @@ -43,7 +43,27 @@ - + + + + + + Map + + + + + + + Theme + + + + + + + +