| 102 | } |
| 103 | |
| 104 | void MenuModeSkirmish::activate() |
| 105 | { |
| 106 | // Loads the corresponding Gui sheet. |
| 107 | getModeManager().getGui().loadGuiSheet(Gui::guiSheet::skirmishMenu); |
| 108 | |
| 109 | giveFocus(); |
| 110 | |
| 111 | // Play the main menu music |
| 112 | MusicPlayer::getSingleton().play(ConfigManager::getSingleton().getMainMenuMusic()); |
| 113 | |
| 114 | GameMap* gameMap = ODFrameListener::getSingleton().getClientGameMap(); |
| 115 | gameMap->clearAll(); |
| 116 | gameMap->setGamePaused(true); |
| 117 | |
| 118 | // Select skirmish |
| 119 | CEGUI::Combobox* levelTypeCb = static_cast<CEGUI::Combobox*>(getModeManager().getGui(). |
| 120 | getGuiSheet(Gui::skirmishMenu)->getChild(Gui::SKM_LIST_LEVEL_TYPES)); |
| 121 | levelTypeCb->setItemSelectState(static_cast<size_t>(0), true); |
| 122 | updateFilesList(); |
| 123 | |
| 124 | // Set the player name if valid. (Will use the defaut one if not.) |
| 125 | ConfigManager& config = ConfigManager::getSingleton(); |
| 126 | std::string nickname = config.getGameValue(Config::NICKNAME, std::string(), false); |
| 127 | if (!nickname.empty()) |
| 128 | ODFrameListener::getSingleton().getClientGameMap()->setLocalPlayerNick(nickname); |
| 129 | } |
| 130 | |
| 131 | bool MenuModeSkirmish::updateFilesList(const CEGUI::EventArgs&) |
| 132 | { |
nothing calls this directly
no test coverage detected