equal
deleted
inserted
replaced
217 |
217 |
218 previousCampaignName = ""; |
218 previousCampaignName = ""; |
219 previousTeamName = ""; |
219 previousTeamName = ""; |
220 UpdateTeamsLists(); |
220 UpdateTeamsLists(); |
221 InitCampaignPage(); |
221 InitCampaignPage(); |
|
222 RestoreSingleplayerTeamSelection(); |
222 UpdateCampaignPage(0); |
223 UpdateCampaignPage(0); |
223 UpdateCampaignPageTeam(0); |
224 UpdateCampaignPageTeam(0); |
224 UpdateCampaignPageMission(0); |
225 UpdateCampaignPageMission(0); |
225 UpdateWeapons(); |
226 UpdateWeapons(); |
226 |
227 |
926 { |
927 { |
927 stopAnim = true; |
928 stopAnim = true; |
928 GoBack(); |
929 GoBack(); |
929 } |
930 } |
930 |
931 |
|
932 if (curid == ID_PAGE_CAMPAIGN) |
|
933 config->setValue("frontend/lastSingleplayerTeam", ui.pageCampaign->CBTeam->currentText()); |
|
934 if (curid == ID_PAGE_TRAINING) |
|
935 config->setValue("frontend/lastSingleplayerTeam", ui.pageTraining->CBTeam->currentText()); |
|
936 |
931 if (curid == ID_PAGE_ROOMSLIST || curid == ID_PAGE_CONNECTING) NetDisconnect(); |
937 if (curid == ID_PAGE_ROOMSLIST || curid == ID_PAGE_CONNECTING) NetDisconnect(); |
932 if (curid == ID_PAGE_NETGAME && hwnet && hwnet->isInRoom()) hwnet->partRoom(); |
938 if (curid == ID_PAGE_NETGAME && hwnet && hwnet->isInRoom()) hwnet->partRoom(); |
933 // need to work on this, can cause invalid state for admin quit trying to prevent bad state message on kick |
939 // need to work on this, can cause invalid state for admin quit trying to prevent bad state message on kick |
934 //if (curid == ID_PAGE_NETGAME && (!game || game->gameState != gsStarted)) hwnet->partRoom(); |
940 //if (curid == ID_PAGE_NETGAME && (!game || game->gameState != gsStarted)) hwnet->partRoom(); |
935 |
941 |
2051 for(unsigned int i = 0; i < n; i++) |
2057 for(unsigned int i = 0; i < n; i++) |
2052 { |
2058 { |
2053 const QString & campaignName = entries[i]; |
2059 const QString & campaignName = entries[i]; |
2054 QString tName = team.name(); |
2060 QString tName = team.name(); |
2055 ui.pageCampaign->CBCampaign->addItem(getRealCampName(campaignName), campaignName); |
2061 ui.pageCampaign->CBCampaign->addItem(getRealCampName(campaignName), campaignName); |
|
2062 } |
|
2063 |
|
2064 } |
|
2065 |
|
2066 void HWForm::RestoreSingleplayerTeamSelection() |
|
2067 { |
|
2068 QString lastTeam = config->value("frontend/lastSingleplayerTeam", QString()).toString(); |
|
2069 if (!lastTeam.isNull() && !lastTeam.isEmpty()) |
|
2070 { |
|
2071 int index = ui.pageCampaign->CBTeam->findData(lastTeam, Qt::DisplayRole); |
|
2072 if(index != -1) |
|
2073 ui.pageCampaign->CBTeam->setCurrentIndex(index); |
|
2074 index = ui.pageTraining->CBTeam->findData(lastTeam, Qt::DisplayRole); |
|
2075 if(index != -1) |
|
2076 ui.pageTraining->CBTeam->setCurrentIndex(index); |
2056 } |
2077 } |
2057 } |
2078 } |
2058 |
2079 |
2059 void HWForm::UpdateCampaignPage(int index) |
2080 void HWForm::UpdateCampaignPage(int index) |
2060 { |
2081 { |