169 |
170 |
170 connect(ui.pageGameStats->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
171 connect(ui.pageGameStats->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
171 |
172 |
172 connect(ui.pageSinglePlayer->BtnSimpleGamePage, SIGNAL(clicked()), this, SLOT(SimpleGame())); |
173 connect(ui.pageSinglePlayer->BtnSimpleGamePage, SIGNAL(clicked()), this, SLOT(SimpleGame())); |
173 connect(ui.pageSinglePlayer->BtnTrainPage, SIGNAL(clicked()), this, SLOT(GoToTraining())); |
174 connect(ui.pageSinglePlayer->BtnTrainPage, SIGNAL(clicked()), this, SLOT(GoToTraining())); |
|
175 connect(ui.pageSinglePlayer->BtnCampaignPage, SIGNAL(clicked()), this, SLOT(GoToCampaign())); |
174 connect(ui.pageSinglePlayer->BtnMultiplayer, SIGNAL(clicked()), this, SLOT(GoToMultiplayer())); |
176 connect(ui.pageSinglePlayer->BtnMultiplayer, SIGNAL(clicked()), this, SLOT(GoToMultiplayer())); |
175 connect(ui.pageSinglePlayer->BtnLoad, SIGNAL(clicked()), this, SLOT(GoToSaves())); |
177 connect(ui.pageSinglePlayer->BtnLoad, SIGNAL(clicked()), this, SLOT(GoToSaves())); |
176 connect(ui.pageSinglePlayer->BtnDemos, SIGNAL(clicked()), this, SLOT(GoToDemos())); |
178 connect(ui.pageSinglePlayer->BtnDemos, SIGNAL(clicked()), this, SLOT(GoToDemos())); |
177 connect(ui.pageSinglePlayer->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
179 connect(ui.pageSinglePlayer->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
178 |
180 |
179 connect(ui.pageTraining->BtnStartTrain, SIGNAL(clicked()), this, SLOT(StartTraining())); |
181 connect(ui.pageTraining->BtnStartTrain, SIGNAL(clicked()), this, SLOT(StartTraining())); |
180 connect(ui.pageTraining->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
182 connect(ui.pageTraining->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
|
183 |
|
184 connect(ui.pageCampaign->BtnStartCampaign, SIGNAL(clicked()), this, SLOT(StartCampaign())); |
|
185 connect(ui.pageCampaign->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
|
186 connect(ui.pageCampaign->CBTeam, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateCampaignPage(int))); |
181 |
187 |
182 connect(ui.pageSelectWeapon->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
188 connect(ui.pageSelectWeapon->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
183 |
189 |
184 connect(ui.pageSelectWeapon->BtnDelete, SIGNAL(clicked()), |
190 connect(ui.pageSelectWeapon->BtnDelete, SIGNAL(clicked()), |
185 ui.pageSelectWeapon->pWeapons, SLOT(deleteWeaponsName())); // executed first |
191 ui.pageSelectWeapon->pWeapons, SLOT(deleteWeaponsName())); // executed first |
308 } else { |
314 } else { |
309 teamslist = config->GetTeamsList(); |
315 teamslist = config->GetTeamsList(); |
310 } |
316 } |
311 |
317 |
312 if(teamslist.empty()) { |
318 if(teamslist.empty()) { |
313 HWTeam defaultTeam("DefaultTeam"); |
319 HWTeam defaultTeam(tr("DefaultTeam")); |
314 defaultTeam.SaveToFile(); |
320 defaultTeam.SaveToFile(); |
315 teamslist.push_back("DefaultTeam"); |
321 teamslist.push_back(tr("DefaultTeam")); |
316 } |
322 } |
317 |
323 |
318 ui.pageOptions->CBTeamName->clear(); |
324 ui.pageOptions->CBTeamName->clear(); |
319 ui.pageOptions->CBTeamName->addItems(teamslist); |
325 ui.pageOptions->CBTeamName->addItems(teamslist); |
|
326 ui.pageCampaign->CBTeam->clear(); |
|
327 ui.pageCampaign->CBTeam->addItems(teamslist); |
320 } |
328 } |
321 |
329 |
322 void HWForm::GoToMain() |
330 void HWForm::GoToMain() |
323 { |
331 { |
324 GoToPage(ID_PAGE_MAIN); |
332 GoToPage(ID_PAGE_MAIN); |
1073 if (wBackground) { |
1093 if (wBackground) { |
1074 wBackground->setFixedSize(w, h); |
1094 wBackground->setFixedSize(w, h); |
1075 wBackground->move(0, 0); |
1095 wBackground->move(0, 0); |
1076 } |
1096 } |
1077 } |
1097 } |
|
1098 |
|
1099 void HWForm::UpdateCampaignPage(int index) |
|
1100 { |
|
1101 HWTeam team(ui.pageCampaign->CBTeam->currentText()); |
|
1102 ui.pageCampaign->CBSelect->clear(); |
|
1103 |
|
1104 QDir tmpdir; |
|
1105 tmpdir.cd(datadir->absolutePath()); |
|
1106 tmpdir.cd("Missions/Campaign"); |
|
1107 tmpdir.setFilter(QDir::Files); |
|
1108 QStringList entries = tmpdir.entryList(QStringList("*#*.lua")); |
|
1109 //entries.sort(); |
|
1110 for(int i = 0; (i < entries.count()) && (i <= team.CampaignProgress); i++) |
|
1111 ui.pageCampaign->CBSelect->addItem(QString(entries[i]).replace(QRegExp("^(\\d+)#(.+)\\.lua"), QComboBox::tr("Mission") + " \\1: \\2"), QString(entries[i]).replace(QRegExp("^(.*)\\.lua"), "\\1")); |
|
1112 } |