fixed bug about starting campaign page with not descriptions/images and with wrong description/image mathcing
--- 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