Update training page after completing a training
authorWuzzy <Wuzzy2@mail.ru>
Tue, 18 Dec 2018 22:22:03 +0100
changeset 14488 4edcb655dc5a
parent 14487 734a7af2dfc2
child 14489 41f1b611cdd2
Update training page after completing a training
QTfrontend/game.cpp
QTfrontend/game.h
QTfrontend/hwform.cpp
--- a/QTfrontend/game.cpp	Tue Dec 18 18:37:58 2018 +0100
+++ b/QTfrontend/game.cpp	Tue Dec 18 22:22:03 2018 +0100
@@ -548,7 +548,11 @@
     emit GameStateChanged(state);
     if (gameType == gtCampaign)
     {
-      emit CampStateChanged(1);
+        emit CampStateChanged(1);
+    }
+    else if (gameType == gtTraining)
+    {
+        emit TrainingStateChanged(1);
     }
 }
 
--- a/QTfrontend/game.h	Tue Dec 18 18:37:58 2018 +0100
+++ b/QTfrontend/game.h	Tue Dec 18 22:22:03 2018 +0100
@@ -99,6 +99,7 @@
         void HaveRecord(RecordType type, const QByteArray & record);
         void ErrorMessage(const QString &);
         void CampStateChanged(int);
+        void TrainingStateChanged(int);
         void SendConsoleCommand(const QString & command);
 
     public slots:
--- a/QTfrontend/hwform.cpp	Tue Dec 18 18:37:58 2018 +0100
+++ b/QTfrontend/hwform.cpp	Tue Dec 18 22:22:03 2018 +0100
@@ -1795,6 +1795,7 @@
 {
     game = new HWGame(config, gamecfg, ammo, pTeamSelWidget);
     connect(game, SIGNAL(CampStateChanged(int)), this, SLOT(UpdateCampaignPageProgress(int)));
+    connect(game, SIGNAL(TrainingStateChanged(int)), this, SLOT(UpdateTrainingPageTeam(int)));
     connect(game, SIGNAL(GameStateChanged(GameState)), this, SLOT(GameStateChanged(GameState)));
     connect(game, SIGNAL(GameStats(char, const QString &)), ui.pageGameStats, SLOT(GameStats(char, const QString &)));
     connect(game, SIGNAL(ErrorMessage(const QString &)), this, SLOT(ShowFatalErrorMessage(const QString &)), Qt::QueuedConnection);