105 |
108 |
106 UpdateTeamsLists(); |
109 UpdateTeamsLists(); |
107 UpdateCampaignPage(0); |
110 UpdateCampaignPage(0); |
108 UpdateWeapons(); |
111 UpdateWeapons(); |
109 |
112 |
|
113 pageSwitchMapper = new QSignalMapper(this); |
|
114 connect(pageSwitchMapper, SIGNAL(mapped(int)), this, SLOT(GoToPage(int))); |
|
115 |
110 connect(config, SIGNAL(frontendFullscreen(bool)), this, SLOT(onFrontendFullscreen(bool))); |
116 connect(config, SIGNAL(frontendFullscreen(bool)), this, SLOT(onFrontendFullscreen(bool))); |
111 onFrontendFullscreen(config->isFrontendFullscreen()); |
117 onFrontendFullscreen(config->isFrontendFullscreen()); |
112 |
118 |
113 connect(ui.pageMain->BtnSinglePlayer, SIGNAL(clicked()), this, SLOT(GoToSinglePlayer())); |
119 connect(ui.pageMain->BtnSinglePlayer, SIGNAL(clicked()), pageSwitchMapper, SLOT(map())); |
114 connect(ui.pageMain->BtnSetup, SIGNAL(clicked()), this, SLOT(GoToSetup())); |
120 pageSwitchMapper->setMapping(ui.pageMain->BtnSinglePlayer, ID_PAGE_SINGLEPLAYER); |
115 connect(ui.pageMain->BtnNet, SIGNAL(clicked()), this, SLOT(GoToNetType())); |
121 |
116 connect(ui.pageMain->BtnInfo, SIGNAL(clicked()), this, SLOT(GoToInfo())); |
122 connect(ui.pageMain->BtnSetup, SIGNAL(clicked()), pageSwitchMapper, SLOT(map())); |
|
123 pageSwitchMapper->setMapping(ui.pageMain->BtnSetup, ID_PAGE_SETUP); |
|
124 |
|
125 connect(ui.pageMain->BtnNet, SIGNAL(clicked()), pageSwitchMapper, SLOT(map())); |
|
126 pageSwitchMapper->setMapping(ui.pageMain->BtnNet, ID_PAGE_NETTYPE); |
|
127 connect(ui.pageMain->BtnInfo, SIGNAL(clicked()), pageSwitchMapper, SLOT(map())); |
|
128 pageSwitchMapper->setMapping(ui.pageMain->BtnInfo, ID_PAGE_INFO); |
|
129 |
117 connect(ui.pageMain->BtnExit, SIGNAL(pressed()), this, SLOT(btnExitPressed())); |
130 connect(ui.pageMain->BtnExit, SIGNAL(pressed()), this, SLOT(btnExitPressed())); |
118 connect(ui.pageMain->BtnExit, SIGNAL(clicked()), this, SLOT(btnExitClicked())); |
131 connect(ui.pageMain->BtnExit, SIGNAL(clicked()), this, SLOT(btnExitClicked())); |
119 |
132 |
120 connect(ui.pageEditTeam->BtnTeamSave, SIGNAL(clicked()), this, SLOT(TeamSave())); |
133 connect(ui.pageEditTeam->BtnTeamSave, SIGNAL(clicked()), this, SLOT(TeamSave())); |
121 connect(ui.pageEditTeam->BtnTeamDiscard, SIGNAL(clicked()), this, SLOT(TeamDiscard())); |
134 connect(ui.pageEditTeam->BtnTeamDiscard, SIGNAL(clicked()), this, SLOT(TeamDiscard())); |
125 |
138 |
126 connect(ui.pageMultiplayer->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
139 connect(ui.pageMultiplayer->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
127 connect(ui.pageMultiplayer->BtnStartMPGame, SIGNAL(clicked()), this, SLOT(StartMPGame())); |
140 connect(ui.pageMultiplayer->BtnStartMPGame, SIGNAL(clicked()), this, SLOT(StartMPGame())); |
128 connect(ui.pageMultiplayer->teamsSelect, SIGNAL(setEnabledGameStart(bool)), |
141 connect(ui.pageMultiplayer->teamsSelect, SIGNAL(setEnabledGameStart(bool)), |
129 ui.pageMultiplayer->BtnStartMPGame, SLOT(setEnabled(bool))); |
142 ui.pageMultiplayer->BtnStartMPGame, SLOT(setEnabled(bool))); |
130 connect(ui.pageMultiplayer->teamsSelect, SIGNAL(SetupClicked()), this, SLOT(IntermediateSetup())); |
143 connect(ui.pageMultiplayer, SIGNAL(SetupClicked()), this, SLOT(IntermediateSetup())); |
131 connect(ui.pageMultiplayer->gameCFG, SIGNAL(goToSchemes()), this, SLOT(GoToSchemes())); |
144 connect(ui.pageMultiplayer->gameCFG, SIGNAL(goToSchemes(int)), this, SLOT(GoToScheme(int))); |
132 connect(ui.pageMultiplayer->gameCFG, SIGNAL(goToWeapons(const QString &)), this, SLOT(GoToSelectWeaponSet(const QString &))); |
145 connect(ui.pageMultiplayer->gameCFG, SIGNAL(goToWeapons(int)), this, SLOT(GoToSelectWeaponSet(int))); |
|
146 connect(ui.pageMultiplayer->gameCFG, SIGNAL(goToDrawMap()), pageSwitchMapper, SLOT(map())); |
|
147 pageSwitchMapper->setMapping(ui.pageMultiplayer->gameCFG, ID_PAGE_DRAWMAP); |
|
148 |
133 |
149 |
134 connect(ui.pagePlayDemo->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
150 connect(ui.pagePlayDemo->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
135 connect(ui.pagePlayDemo->BtnPlayDemo, SIGNAL(clicked()), this, SLOT(PlayDemo())); |
151 connect(ui.pagePlayDemo->BtnPlayDemo, SIGNAL(clicked()), this, SLOT(PlayDemo())); |
136 connect(ui.pagePlayDemo->DemosList, SIGNAL(doubleClicked (const QModelIndex &)), this, SLOT(PlayDemo())); |
152 connect(ui.pagePlayDemo->DemosList, SIGNAL(doubleClicked (const QModelIndex &)), this, SLOT(PlayDemo())); |
137 |
153 |
144 #ifndef __APPLE__ |
160 #ifndef __APPLE__ |
145 connect(ui.pageOptions->BtnAssociateFiles, SIGNAL(clicked()), this, SLOT(AssociateFiles())); |
161 connect(ui.pageOptions->BtnAssociateFiles, SIGNAL(clicked()), this, SLOT(AssociateFiles())); |
146 #endif |
162 #endif |
147 |
163 |
148 connect(ui.pageOptions->WeaponEdit, SIGNAL(clicked()), this, SLOT(GoToSelectWeapon())); |
164 connect(ui.pageOptions->WeaponEdit, SIGNAL(clicked()), this, SLOT(GoToSelectWeapon())); |
149 connect(ui.pageOptions->WeaponsButt, SIGNAL(clicked()), this, SLOT(GoToSelectNewWeapon())); |
165 connect(ui.pageOptions->WeaponNew, SIGNAL(clicked()), this, SLOT(GoToSelectNewWeapon())); |
|
166 connect(ui.pageOptions->WeaponDelete, SIGNAL(clicked()), this, SLOT(DeleteWeaponSet())); |
|
167 connect(ui.pageOptions->SchemeEdit, SIGNAL(clicked()), this, SLOT(GoToEditScheme())); |
|
168 connect(ui.pageOptions->SchemeNew, SIGNAL(clicked()), this, SLOT(GoToNewScheme())); |
|
169 connect(ui.pageOptions->SchemeDelete, SIGNAL(clicked()), this, SLOT(DeleteScheme())); |
150 connect(ui.pageSelectWeapon->pWeapons, SIGNAL(weaponsChanged()), this, SLOT(UpdateWeapons())); |
170 connect(ui.pageSelectWeapon->pWeapons, SIGNAL(weaponsChanged()), this, SLOT(UpdateWeapons())); |
151 |
171 |
152 connect(ui.pageNet->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
172 connect(ui.pageNet->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
153 connect(ui.pageNet->BtnSpecifyServer, SIGNAL(clicked()), this, SLOT(NetConnect())); |
173 connect(ui.pageNet->BtnSpecifyServer, SIGNAL(clicked()), this, SLOT(NetConnect())); |
154 connect(ui.pageNet->BtnNetSvrStart, SIGNAL(clicked()), this, SLOT(GoToNetServer())); |
174 connect(ui.pageNet->BtnNetSvrStart, SIGNAL(clicked()), pageSwitchMapper, SLOT(map())); |
|
175 pageSwitchMapper->setMapping(ui.pageNet->BtnNetSvrStart, ID_PAGE_NETSERVER); |
|
176 |
155 connect(ui.pageNet, SIGNAL(connectClicked(const QString &, quint16)), this, SLOT(NetConnectServer(const QString &, quint16))); |
177 connect(ui.pageNet, SIGNAL(connectClicked(const QString &, quint16)), this, SLOT(NetConnectServer(const QString &, quint16))); |
156 |
178 |
157 connect(ui.pageNetServer->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
179 connect(ui.pageNetServer->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
158 connect(ui.pageNetServer->BtnStart, SIGNAL(clicked()), this, SLOT(NetStartServer())); |
180 connect(ui.pageNetServer->BtnStart, SIGNAL(clicked()), this, SLOT(NetStartServer())); |
159 |
181 |
160 connect(ui.pageNetGame->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
182 connect(ui.pageNetGame->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
161 connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(setEnabledGameStart(bool)), |
183 connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(setEnabledGameStart(bool)), |
162 ui.pageNetGame->BtnGo, SLOT(setEnabled(bool))); |
184 ui.pageNetGame->BtnGo, SLOT(setEnabled(bool))); |
163 connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(setEnabledGameStart(bool)), |
185 connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(setEnabledGameStart(bool)), |
164 ui.pageNetGame->BtnStart, SLOT(setEnabled(bool))); |
186 ui.pageNetGame->BtnStart, SLOT(setEnabled(bool))); |
165 connect(ui.pageNetGame->pNetTeamsWidget, SIGNAL(SetupClicked()), this, SLOT(IntermediateSetup())); |
187 connect(ui.pageNetGame, SIGNAL(SetupClicked()), this, SLOT(IntermediateSetup())); |
166 connect(ui.pageNetGame->pGameCFG, SIGNAL(goToSchemes()), this, SLOT(GoToSchemes())); |
188 connect(ui.pageNetGame->pGameCFG, SIGNAL(goToSchemes(int)), this, SLOT(GoToScheme(int))); |
167 connect(ui.pageNetGame->pGameCFG, SIGNAL(goToWeapons(const QString &)), this, SLOT(GoToSelectWeaponSet(const QString &))); |
189 connect(ui.pageNetGame->pGameCFG, SIGNAL(goToWeapons(int)), this, SLOT(GoToSelectWeaponSet(int))); |
|
190 connect(ui.pageNetGame->pGameCFG, SIGNAL(goToDrawMap()), pageSwitchMapper, SLOT(map())); |
|
191 pageSwitchMapper->setMapping(ui.pageNetGame->pGameCFG, ID_PAGE_DRAWMAP); |
168 |
192 |
169 connect(ui.pageRoomsList->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
193 connect(ui.pageRoomsList->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
170 connect(ui.pageRoomsList->BtnAdmin, SIGNAL(clicked()), this, SLOT(GoToAdmin())); |
194 connect(ui.pageRoomsList->BtnAdmin, SIGNAL(clicked()), pageSwitchMapper, SLOT(map())); |
|
195 pageSwitchMapper->setMapping(ui.pageRoomsList->BtnAdmin, ID_PAGE_ADMIN); |
171 |
196 |
172 connect(ui.pageInfo->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
197 connect(ui.pageInfo->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
173 |
198 |
174 connect(ui.pageGameStats->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
199 connect(ui.pageGameStats->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
175 |
200 |
176 connect(ui.pageSinglePlayer->BtnSimpleGamePage, SIGNAL(clicked()), this, SLOT(SimpleGame())); |
201 connect(ui.pageSinglePlayer->BtnSimpleGamePage, SIGNAL(clicked()), this, SLOT(SimpleGame())); |
177 connect(ui.pageSinglePlayer->BtnTrainPage, SIGNAL(clicked()), this, SLOT(GoToTraining())); |
202 connect(ui.pageSinglePlayer->BtnTrainPage, SIGNAL(clicked()), pageSwitchMapper, SLOT(map())); |
178 connect(ui.pageSinglePlayer->BtnCampaignPage, SIGNAL(clicked()), this, SLOT(GoToCampaign())); |
203 pageSwitchMapper->setMapping(ui.pageSinglePlayer->BtnTrainPage, ID_PAGE_TRAINING); |
179 connect(ui.pageSinglePlayer->BtnMultiplayer, SIGNAL(clicked()), this, SLOT(GoToMultiplayer())); |
204 |
|
205 connect(ui.pageSinglePlayer->BtnCampaignPage, SIGNAL(clicked()), pageSwitchMapper, SLOT(map())); |
|
206 pageSwitchMapper->setMapping(ui.pageSinglePlayer->BtnCampaignPage, ID_PAGE_CAMPAIGN); |
|
207 |
|
208 connect(ui.pageSinglePlayer->BtnMultiplayer, SIGNAL(clicked()), pageSwitchMapper, SLOT(map())); |
|
209 pageSwitchMapper->setMapping(ui.pageSinglePlayer->BtnMultiplayer, ID_PAGE_MULTIPLAYER); |
|
210 |
180 connect(ui.pageSinglePlayer->BtnLoad, SIGNAL(clicked()), this, SLOT(GoToSaves())); |
211 connect(ui.pageSinglePlayer->BtnLoad, SIGNAL(clicked()), this, SLOT(GoToSaves())); |
181 connect(ui.pageSinglePlayer->BtnDemos, SIGNAL(clicked()), this, SLOT(GoToDemos())); |
212 connect(ui.pageSinglePlayer->BtnDemos, SIGNAL(clicked()), this, SLOT(GoToDemos())); |
182 connect(ui.pageSinglePlayer->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
213 connect(ui.pageSinglePlayer->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
183 |
214 |
184 connect(ui.pageTraining->BtnStartTrain, SIGNAL(clicked()), this, SLOT(StartTraining())); |
215 connect(ui.pageTraining->BtnStartTrain, SIGNAL(clicked()), this, SLOT(StartTraining())); |
192 |
223 |
193 connect(ui.pageSelectWeapon->BtnDelete, SIGNAL(clicked()), |
224 connect(ui.pageSelectWeapon->BtnDelete, SIGNAL(clicked()), |
194 ui.pageSelectWeapon->pWeapons, SLOT(deleteWeaponsName())); // executed first |
225 ui.pageSelectWeapon->pWeapons, SLOT(deleteWeaponsName())); // executed first |
195 connect(ui.pageSelectWeapon->pWeapons, SIGNAL(weaponsDeleted()), |
226 connect(ui.pageSelectWeapon->pWeapons, SIGNAL(weaponsDeleted()), |
196 this, SLOT(UpdateWeapons())); // executed second |
227 this, SLOT(UpdateWeapons())); // executed second |
197 connect(ui.pageSelectWeapon->pWeapons, SIGNAL(weaponsDeleted()), |
228 //connect(ui.pageSelectWeapon->pWeapons, SIGNAL(weaponsDeleted()), |
198 this, SLOT(GoBack())); // executed third |
229 // this, SLOT(GoBack())); // executed third |
199 |
230 |
200 connect(ui.pageScheme->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
231 connect(ui.pageScheme->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
201 |
232 |
202 connect(ui.pageAdmin->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
233 connect(ui.pageAdmin->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
203 |
234 |
204 connect(ui.pageNetType->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
235 connect(ui.pageNetType->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
205 connect(ui.pageNetType->BtnLAN, SIGNAL(clicked()), this, SLOT(GoToNet())); |
236 connect(ui.pageNetType->BtnLAN, SIGNAL(clicked()), this, SLOT(GoToNet())); |
206 connect(ui.pageNetType->BtnOfficialServer, SIGNAL(clicked()), this, SLOT(NetConnectOfficialServer())); |
237 connect(ui.pageNetType->BtnOfficialServer, SIGNAL(clicked()), this, SLOT(NetConnectOfficialServer())); |
207 |
238 |
|
239 connect(ui.pageDrawMap->BtnBack, SIGNAL(clicked()), this, SLOT(GoBack())); |
|
240 |
208 |
241 |
209 ammoSchemeModel = new AmmoSchemeModel(this, cfgdir->absolutePath() + "/schemes.ini"); |
242 ammoSchemeModel = new AmmoSchemeModel(this, cfgdir->absolutePath() + "/schemes.ini"); |
210 ui.pageScheme->setModel(ammoSchemeModel); |
243 ui.pageScheme->setModel(ammoSchemeModel); |
211 ui.pageMultiplayer->gameCFG->GameSchemes->setModel(ammoSchemeModel); |
244 ui.pageMultiplayer->gameCFG->GameSchemes->setModel(ammoSchemeModel); |
|
245 ui.pageOptions->SchemesName->setModel(ammoSchemeModel); |
212 |
246 |
213 wBackground = NULL; |
247 wBackground = NULL; |
214 if (config->isFrontendEffects()) { |
248 if (config->isFrontendEffects()) { |
215 wBackground = new BGWidget(this); |
249 wBackground = new BGWidget(this); |
216 wBackground->setFixedSize(this->width(), this->height()); |
250 wBackground->setFixedSize(this->width(), this->height()); |
334 ui.pageOptions->CBTeamName->addItems(teamslist); |
371 ui.pageOptions->CBTeamName->addItems(teamslist); |
335 ui.pageCampaign->CBTeam->clear(); |
372 ui.pageCampaign->CBTeam->clear(); |
336 ui.pageCampaign->CBTeam->addItems(teamslist); |
373 ui.pageCampaign->CBTeam->addItems(teamslist); |
337 } |
374 } |
338 |
375 |
339 void HWForm::GoToMain() |
|
340 { |
|
341 GoToPage(ID_PAGE_MAIN); |
|
342 } |
|
343 |
|
344 void HWForm::GoToSinglePlayer() |
|
345 { |
|
346 GoToPage(ID_PAGE_SINGLEPLAYER); |
|
347 } |
|
348 |
|
349 void HWForm::GoToTraining() |
|
350 { |
|
351 GoToPage(ID_PAGE_TRAINING); |
|
352 } |
|
353 |
|
354 void HWForm::GoToCampaign() |
|
355 { |
|
356 GoToPage(ID_PAGE_CAMPAIGN); |
|
357 } |
|
358 |
|
359 void HWForm::GoToSetup() |
|
360 { |
|
361 GoToPage(ID_PAGE_SETUP); |
|
362 } |
|
363 |
|
364 void HWForm::GoToSelectNewWeapon() |
376 void HWForm::GoToSelectNewWeapon() |
365 { |
377 { |
366 ui.pageSelectWeapon->pWeapons->setWeaponsName(tr("new")); |
378 ui.pageSelectWeapon->pWeapons->newWeaponsName(); |
367 GoToPage(ID_PAGE_SELECTWEAPON); |
379 GoToPage(ID_PAGE_SELECTWEAPON); |
368 } |
380 } |
369 |
381 |
370 void HWForm::GoToSelectWeapon() |
382 void HWForm::GoToSelectWeapon() |
371 { |
383 { |
372 ui.pageSelectWeapon->pWeapons->setWeaponsName(ui.pageOptions->WeaponsName->currentText()); |
384 ui.pageSelectWeapon->selectWeaponSet->setCurrentIndex(ui.pageOptions->WeaponsName->currentIndex()); |
373 GoToPage(ID_PAGE_SELECTWEAPON); |
385 GoToPage(ID_PAGE_SELECTWEAPON); |
374 } |
386 } |
375 |
387 |
376 void HWForm::GoToSelectWeaponSet(const QString & name) |
388 void HWForm::GoToSelectWeaponSet(int index) |
377 { |
389 { |
378 ui.pageSelectWeapon->pWeapons->setWeaponsName(name); |
390 ui.pageSelectWeapon->selectWeaponSet->setCurrentIndex(index); |
379 GoToPage(ID_PAGE_SELECTWEAPON); |
391 GoToPage(ID_PAGE_SELECTWEAPON); |
380 } |
392 } |
381 |
393 |
382 void HWForm::GoToInfo() |
|
383 { |
|
384 GoToPage(ID_PAGE_INFO); |
|
385 } |
|
386 |
|
387 void HWForm::GoToMultiplayer() |
|
388 { |
|
389 GoToPage(ID_PAGE_MULTIPLAYER); |
|
390 } |
|
391 |
|
392 void HWForm::GoToSaves() |
394 void HWForm::GoToSaves() |
393 { |
395 { |
394 ui.pagePlayDemo->FillFromDir(PagePlayDemo::RT_Save); |
396 ui.pagePlayDemo->FillFromDir(PagePlayDemo::RT_Save); |
395 |
397 |
396 GoToPage(ID_PAGE_DEMOS); |
398 GoToPage(ID_PAGE_DEMOS); |
408 ui.pageNet->updateServersList(); |
410 ui.pageNet->updateServersList(); |
409 |
411 |
410 GoToPage(ID_PAGE_NET); |
412 GoToPage(ID_PAGE_NET); |
411 } |
413 } |
412 |
414 |
413 void HWForm::GoToNetType() |
415 void HWForm::GoToScheme(int index) |
414 { |
416 { |
415 GoToPage(ID_PAGE_NETTYPE); |
417 ui.pageScheme->selectScheme->setCurrentIndex(index); |
416 } |
|
417 |
|
418 void HWForm::GoToNetServer() |
|
419 { |
|
420 GoToPage(ID_PAGE_NETSERVER); |
|
421 } |
|
422 |
|
423 void HWForm::GoToSchemes() |
|
424 { |
|
425 GoToPage(ID_PAGE_SCHEME); |
418 GoToPage(ID_PAGE_SCHEME); |
426 } |
419 } |
427 |
420 |
428 void HWForm::GoToAdmin() |
421 void HWForm::GoToNewScheme() |
429 { |
422 { |
430 GoToPage(ID_PAGE_ADMIN); |
423 ui.pageScheme->newRow(); |
|
424 GoToPage(ID_PAGE_SCHEME); |
|
425 } |
|
426 |
|
427 void HWForm::GoToEditScheme() |
|
428 { |
|
429 ui.pageScheme->selectScheme->setCurrentIndex(ui.pageOptions->SchemesName->currentIndex()); |
|
430 GoToPage(ID_PAGE_SCHEME); |
431 } |
431 } |
432 |
432 |
433 void HWForm::OnPageShown(quint8 id, quint8 lastid) |
433 void HWForm::OnPageShown(quint8 id, quint8 lastid) |
434 { |
434 { |
435 #ifdef USE_XFIRE |
435 #ifdef USE_XFIRE |
436 updateXfire(); |
436 updateXfire(); |
437 #endif |
437 #endif |
|
438 if(id == ID_PAGE_DRAWMAP) |
|
439 { |
|
440 DrawMapScene * scene; |
|
441 if(lastid == ID_PAGE_MULTIPLAYER) |
|
442 scene = ui.pageMultiplayer->gameCFG->pMapContainer->getDrawMapScene(); |
|
443 else |
|
444 scene = ui.pageNetGame->pGameCFG->pMapContainer->getDrawMapScene(); |
|
445 |
|
446 ui.pageDrawMap->drawMapWidget->setScene(scene); |
|
447 } |
|
448 if(lastid == ID_PAGE_DRAWMAP) |
|
449 { |
|
450 if(id == ID_PAGE_MULTIPLAYER) |
|
451 ui.pageMultiplayer->gameCFG->pMapContainer->mapDrawingFinished(); |
|
452 else |
|
453 ui.pageNetGame->pGameCFG->pMapContainer->mapDrawingFinished(); |
|
454 } |
|
455 |
438 if (id == ID_PAGE_MULTIPLAYER || id == ID_PAGE_NETGAME) { |
456 if (id == ID_PAGE_MULTIPLAYER || id == ID_PAGE_NETGAME) { |
439 QStringList tmNames = config->GetTeamsList(); |
457 QStringList tmNames = config->GetTeamsList(); |
440 TeamSelWidget* curTeamSelWidget; |
458 TeamSelWidget* curTeamSelWidget; |
441 ui.pageOptions->BtnNewTeam->setVisible(false); |
459 ui.pageOptions->BtnNewTeam->setVisible(false); |
442 ui.pageOptions->BtnEditTeam->setVisible(false); |
460 ui.pageOptions->BtnEditTeam->setVisible(false); |
488 else if(lastid == ID_PAGE_ROOMSLIST) // leaving the lobby |
506 else if(lastid == ID_PAGE_ROOMSLIST) // leaving the lobby |
489 ui.pageRoomsList->chatWidget->saveLists(ui.pageOptions->editNetNick->text()); |
507 ui.pageRoomsList->chatWidget->saveLists(ui.pageOptions->editNetNick->text()); |
490 |
508 |
491 if(id == ID_PAGE_NETGAME) // joining a room |
509 if(id == ID_PAGE_NETGAME) // joining a room |
492 ui.pageNetGame->pChatWidget->loadLists(ui.pageOptions->editNetNick->text()); |
510 ui.pageNetGame->pChatWidget->loadLists(ui.pageOptions->editNetNick->text()); |
493 else if(id == ID_PAGE_ROOMSLIST) // joining the lobby |
511 // joining the lobby |
|
512 else if(id == ID_PAGE_ROOMSLIST) { |
|
513 if ( hwnet && game && game->gameState == gsStarted) { // abnormal exit - kick or room destruction - send kills. |
|
514 game->netSuspend = true; |
|
515 game->KillAllTeams(); |
|
516 } |
494 ui.pageRoomsList->chatWidget->loadLists(ui.pageOptions->editNetNick->text()); |
517 ui.pageRoomsList->chatWidget->loadLists(ui.pageOptions->editNetNick->text()); |
495 } |
518 } |
496 |
519 } |
497 void HWForm::GoToPage(quint8 id) |
520 |
498 { |
521 void HWForm::GoToPage(int id) |
499 quint8 lastid = ui.Pages->currentIndex(); |
522 { |
|
523 int lastid = ui.Pages->currentIndex(); |
500 PagesStack.push(ui.Pages->currentIndex()); |
524 PagesStack.push(ui.Pages->currentIndex()); |
501 OnPageShown(id, lastid); |
525 OnPageShown(id, lastid); |
502 ui.Pages->setCurrentIndex(id); |
526 ui.Pages->setCurrentIndex(id); |
503 } |
527 } |
504 |
528 |
505 void HWForm::GoBack() |
529 void HWForm::GoBack() |
506 { |
530 { |
507 quint8 id = PagesStack.isEmpty() ? ID_PAGE_MAIN : PagesStack.pop(); |
531 int id = PagesStack.isEmpty() ? ID_PAGE_MAIN : PagesStack.pop(); |
508 quint8 curid = ui.Pages->currentIndex(); |
532 int curid = ui.Pages->currentIndex(); |
509 ui.Pages->setCurrentIndex(id); |
533 ui.Pages->setCurrentIndex(id); |
510 OnPageShown(id, curid); |
534 OnPageShown(id, curid); |
511 |
535 |
512 if (id == ID_PAGE_CONNECTING) |
536 if (id == ID_PAGE_CONNECTING) |
513 GoBack(); |
537 GoBack(); |
676 connect(hwnet, SIGNAL(AskForRunGame()), this, SLOT(CreateNetGame())); |
724 connect(hwnet, SIGNAL(AskForRunGame()), this, SLOT(CreateNetGame())); |
677 connect(hwnet, SIGNAL(Connected()), this, SLOT(NetConnected())); |
725 connect(hwnet, SIGNAL(Connected()), this, SLOT(NetConnected())); |
678 connect(hwnet, SIGNAL(EnteredGame()), this, SLOT(NetGameEnter())); |
726 connect(hwnet, SIGNAL(EnteredGame()), this, SLOT(NetGameEnter())); |
679 connect(hwnet, SIGNAL(LeftRoom()), this, SLOT(NetLeftRoom())); |
727 connect(hwnet, SIGNAL(LeftRoom()), this, SLOT(NetLeftRoom())); |
680 connect(hwnet, SIGNAL(AddNetTeam(const HWTeam&)), this, SLOT(AddNetTeam(const HWTeam&))); |
728 connect(hwnet, SIGNAL(AddNetTeam(const HWTeam&)), this, SLOT(AddNetTeam(const HWTeam&))); |
681 connect(ui.pageNetGame->BtnBack, SIGNAL(clicked()), hwnet, SLOT(partRoom())); |
729 //connect(ui.pageNetGame->BtnBack, SIGNAL(clicked()), hwnet, SLOT(partRoom())); |
682 |
730 |
683 // rooms list page stuff |
731 // rooms list page stuff |
684 connect(hwnet, SIGNAL(roomsList(const QStringList&)), |
732 connect(hwnet, SIGNAL(roomsList(const QStringList&)), |
685 ui.pageRoomsList, SLOT(setRoomsList(const QStringList&))); |
733 ui.pageRoomsList, SLOT(setRoomsList(const QStringList&))); |
686 connect(hwnet, SIGNAL(adminAccess(bool)), |
734 connect(hwnet, SIGNAL(adminAccess(bool)), |