Update campaign drop-down list after campaign victory
authorWuzzy <almikes@aol.com>
Wed, 04 May 2016 04:44:41 +0200
changeset 11960 d72a177dbaea
parent 11959 62be63822a96
child 11961 221b38978401
Update campaign drop-down list after campaign victory
QTfrontend/hwform.cpp
share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/epil.lua
--- a/QTfrontend/hwform.cpp	Wed May 04 04:32:31 2016 +0200
+++ b/QTfrontend/hwform.cpp	Wed May 04 04:44:41 2016 +0200
@@ -1941,6 +1941,14 @@
             break;
         }
     }
+    int i = ui.pageCampaign->CBCampaign->currentIndex();
+    QString campaignName = ui.pageCampaign->CBCampaign->currentText().replace(QString(" "),QString("_"));
+    HWTeam team(ui.pageCampaign->CBTeam->currentText());
+    QString tName = team.name();
+    if(isCampWon(campaignName, tName))
+        ui.pageCampaign->CBCampaign->setItemIcon(i, finishedIcon);
+    else
+        ui.pageCampaign->CBCampaign->setItemIcon(i, QIcon());
 }
 
 // used for --set-everything [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen] [show FPS] [alternate damage] [timer value] [reduced quality]
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/epil.lua	Wed May 04 04:32:31 2016 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/epil.lua	Wed May 04 04:44:41 2016 +0200
@@ -83,6 +83,7 @@
   AddNewEvent(CheckCrateTaken, {}, DoCrateTaken, {}, 1)
   TurnTimeLeft = 0
   ShowMission("Epilogue", "That's all folks!", "You have successfully finished the campaign!|If you wish to replay, there are other possible endings, too!|You can practice moving around and using utilities in this mission.|However, it will never end!", 1, 0)
+  SaveCampaignVar("Progress", "10")
   SaveCampaignVar("Won", "true")
 end