QTfrontend/hwform.cpp
changeset 1343 7a47a80b20ad
parent 1339 8a11157c6c81
child 1344 4004e597f1bf
equal deleted inserted replaced
1342:ae6c4f10ace2 1343:7a47a80b20ad
   256 }
   256 }
   257 
   257 
   258 void HWForm::OnPageShown(quint8 id, quint8 lastid)
   258 void HWForm::OnPageShown(quint8 id, quint8 lastid)
   259 {
   259 {
   260 	if (id == ID_PAGE_MULTIPLAYER || id == ID_PAGE_NETCFG) {
   260 	if (id == ID_PAGE_MULTIPLAYER || id == ID_PAGE_NETCFG) {
   261 		QStringList tmNames=config->GetTeamsList();
   261 		QStringList tmNames = config->GetTeamsList();
   262 		TeamSelWidget* curTeamSelWidget;
   262 		TeamSelWidget* curTeamSelWidget;
       
   263 		
   263 		if(id == ID_PAGE_MULTIPLAYER) {
   264 		if(id == ID_PAGE_MULTIPLAYER) {
   264 		  curTeamSelWidget=ui.pageMultiplayer->teamsSelect;
   265 		  curTeamSelWidget = ui.pageMultiplayer->teamsSelect;
   265 		} else {
   266 		} else {
   266 		  curTeamSelWidget=ui.pageNetGame->pNetTeamsWidget;
   267 		  curTeamSelWidget = ui.pageNetGame->pNetTeamsWidget;
   267 		}
   268 		}
       
   269 		
   268 		QList<HWTeam> teamsList;
   270 		QList<HWTeam> teamsList;
   269 		for(QStringList::iterator it=tmNames.begin(); it!=tmNames.end(); it++) {
   271 		for(QStringList::iterator it = tmNames.begin(); it != tmNames.end(); it++) {
   270 		  HWTeam team(*it);
   272 		  HWTeam team(*it);
   271 		  team.LoadFromFile();
   273 		  team.LoadFromFile();
   272 		  teamsList.push_back(team);
   274 		  teamsList.push_back(team);
   273 		}
   275 		}
   274 		if(lastid==ID_PAGE_SETUP) { // _TEAM
   276 		
       
   277 		if(lastid == ID_PAGE_SETUP) { // _TEAM
   275 		  if (editedTeam) {
   278 		  if (editedTeam) {
   276 		    curTeamSelWidget->addTeam(*editedTeam);
   279 		    curTeamSelWidget->addTeam(*editedTeam);
   277 		  }
   280 		  }
   278 		} else {
   281 		} else {
   279 		  curTeamSelWidget->resetPlayingTeams(teamsList);
   282 		  curTeamSelWidget->resetPlayingTeams(teamsList);
   551   ui.pageNetGame->pNetTeamsWidget->addTeam(team);
   554   ui.pageNetGame->pNetTeamsWidget->addTeam(team);
   552 }
   555 }
   553 
   556 
   554 void HWForm::StartMPGame()
   557 void HWForm::StartMPGame()
   555 {
   558 {
   556 	QString ammo=ui.pageSelectWeapon->pWeapons->getWeaponsString(ui.pageMultiplayer->gameCFG->WeaponsName->currentText());
   559 	QString ammo = ui.pageSelectWeapon->pWeapons->getWeaponsString(ui.pageMultiplayer->gameCFG->WeaponsName->currentText());
   557 
   560 
   558 	CreateGame(ui.pageMultiplayer->gameCFG, ui.pageMultiplayer->teamsSelect, ammo);
   561 	CreateGame(ui.pageMultiplayer->gameCFG, ui.pageMultiplayer->teamsSelect, ammo);
   559 
   562 
   560 	game->StartLocal();
   563 	game->StartLocal();
   561 }
   564 }