| 444 | } |
| 445 | |
| 446 | void MenuModeConfigureSeats::activatePlayerConfig() |
| 447 | { |
| 448 | mIsActivePlayerConfig = true; |
| 449 | GameMap* gameMap = ODFrameListener::getSingleton().getClientGameMap(); |
| 450 | CEGUI::Window* listPlayersWindow = getModeManager().getGui().getGuiSheet(Gui::guiSheet::configureSeats)->getChild("ListPlayers"); |
| 451 | listPlayersWindow->setText("Please configure map : " + gameMap->getLevelName()); |
| 452 | bool enabled = true; |
| 453 | |
| 454 | for(int seatId : mSeatIds) |
| 455 | { |
| 456 | Seat* seat = gameMap->getSeatById(seatId); |
| 457 | |
| 458 | std::string name; |
| 459 | CEGUI::Combobox* combo; |
| 460 | |
| 461 | name = COMBOBOX_PLAYER_FACTION_PREFIX + Helper::toString(seatId); |
| 462 | combo = static_cast<CEGUI::Combobox*>(listPlayersWindow->getChild(name)); |
| 463 | if(combo->getItemCount() > 1) |
| 464 | combo->setEnabled(enabled); |
| 465 | |
| 466 | name = COMBOBOX_PLAYER_PREFIX + Helper::toString(seatId); |
| 467 | combo = static_cast<CEGUI::Combobox*>(listPlayersWindow->getChild(name)); |
| 468 | if(enabled) |
| 469 | { |
| 470 | if(seat->getPlayerType().compare(Seat::PLAYER_TYPE_INACTIVE) != 0) |
| 471 | combo->setEnabled(enabled); |
| 472 | } |
| 473 | else |
| 474 | combo->setEnabled(enabled); |
| 475 | |
| 476 | name = COMBOBOX_TEAM_ID_PREFIX + Helper::toString(seatId); |
| 477 | combo = static_cast<CEGUI::Combobox*>(listPlayersWindow->getChild(name)); |
| 478 | if(combo->getItemCount() > 1) |
| 479 | combo->setEnabled(enabled); |
| 480 | } |
| 481 | |
| 482 | CEGUI::Window* startButton = getModeManager().getGui().getGuiSheet(Gui::guiSheet::configureSeats)->getChild("ListPlayers/LaunchGameButton"); |
| 483 | startButton->setEnabled(enabled); |
| 484 | } |
| 485 | |
| 486 | void MenuModeConfigureSeats::refreshSeatConfiguration(ODPacket& packet) |
| 487 | { |
no test coverage detected