fixed bug about starting campaign page with not descriptions/images and with wrong description/image mathcing spacecampaign
authorPeriklis Ntanasis <pntanasis@gmail.com>
Fri, 28 Jun 2013 19:55:16 +0300
branchspacecampaign
changeset 9286 c89b992ff5fe
parent 9284 13b76fa362b4
child 9288 180cab35c9c1
fixed bug about starting campaign page with not descriptions/images and with wrong description/image mathcing
QTfrontend/campaign.cpp
QTfrontend/hwform.cpp
--- a/QTfrontend/campaign.cpp	Fri Jun 28 19:32:11 2013 +0300
+++ b/QTfrontend/campaign.cpp	Fri Jun 28 19:55:16 2013 +0300
@@ -127,7 +127,8 @@
 		for(unsigned int i=1;i<=unlockedMissions;i++)
 		{
 			QString missionNum = QString("%1").arg(i);
-			descriptionList += m_info.value(campaignName+"-"+ getCampaignMissionName(campaignName,i) + ".desc",
+			int missionNumber = teamfile.value("Campaign " + campaignName + "/Mission"+missionNum, -1).toInt();
+			descriptionList += m_info.value(campaignName+"-"+ getCampaignMissionName(campaignName,missionNumber) + ".desc",
                                             QObject::tr("No description available")).toString();
 		}
 	}
@@ -183,7 +184,8 @@
 		for(unsigned int i=1;i<=unlockedMissions;i++)
 		{
 			QString missionNum = QString("%1").arg(i);
-			imageList += campfile.value(QString("Mission %1/Script").arg(i)).toString().replace(QString(".lua"),QString(".png"));
+			int missionNumber = teamfile.value("Campaign " + campaignName + "/Mission"+missionNum, -1).toInt();
+			imageList += campfile.value(QString("Mission %1/Script").arg(missionNumber)).toString().replace(QString(".lua"),QString(".png"));
 		}
 	}
 	return imageList;
--- a/QTfrontend/hwform.cpp	Fri Jun 28 19:32:11 2013 +0300
+++ b/QTfrontend/hwform.cpp	Fri Jun 28 19:55:16 2013 +0300
@@ -199,6 +199,7 @@
     UpdateTeamsLists();
     InitCampaignPage();
     UpdateCampaignPage(0);
+    UpdateCampaignPageMission(0);
     UpdateWeapons();
 
     // connect all goBack signals