QTfrontend/game.cpp
changeset 14498 4b678aad50e9
parent 14488 4edcb655dc5a
child 14620 b86e6e4f3c58
--- a/QTfrontend/game.cpp	Wed Dec 19 05:50:02 2018 +0100
+++ b/QTfrontend/game.cpp	Wed Dec 19 19:10:42 2018 +0100
@@ -29,6 +29,8 @@
 
 #include "hwform.h"
 #include "ui/page/pageoptions.h"
+#include "ui/page/pagetraining.h"
+#include "ui/page/pagecampaign.h"
 #include "game.h"
 #include "hwconsts.h"
 #include "gameuiconfig.h"
@@ -183,6 +185,14 @@
 {
     QByteArray traincfg;
     HWProto::addStringToBuffer(traincfg, "TL");
+
+    HWTeam missionTeam = HWTeam();
+    missionTeam.setName(config->Form->ui.pageTraining->CBTeam->currentText());
+    missionTeam.loadFromFile();
+    missionTeam.setNumHedgehogs(HEDGEHOGS_PER_TEAM);
+    missionTeam.setMissionTeam(true);
+    HWProto::addStringListToBuffer(traincfg, missionTeam.teamGameConfig(100));
+
     HWProto::addStringToBuffer(traincfg, "eseed " + QUuid::createUuid().toString());
     HWProto::addStringToBuffer(traincfg, "escript " + trainingScript);
 
@@ -193,8 +203,15 @@
 {
     QByteArray campaigncfg;
     HWProto::addStringToBuffer(campaigncfg, "TL");
+
+    HWTeam missionTeam = HWTeam();
+    missionTeam.setName(config->Form->ui.pageCampaign->CBTeam->currentText());
+    missionTeam.loadFromFile();
+    missionTeam.setNumHedgehogs(HEDGEHOGS_PER_TEAM);
+    missionTeam.setMissionTeam(true);
+    HWProto::addStringListToBuffer(campaigncfg, missionTeam.teamGameConfig(100));
+
     HWProto::addStringToBuffer(campaigncfg, "eseed " + QUuid::createUuid().toString());
-
     HWProto::addStringToBuffer(campaigncfg, "escript " + campaignScript);
 
     RawSendIPC(campaigncfg);