| 101 | } |
| 102 | |
| 103 | void MenuModeMultiplayerServer::activate() |
| 104 | { |
| 105 | // Loads the corresponding Gui sheet. |
| 106 | Gui& gui = getModeManager().getGui(); |
| 107 | gui.loadGuiSheet(Gui::multiplayerServerMenu); |
| 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 | ConfigManager& config = ConfigManager::getSingleton(); |
| 119 | |
| 120 | CEGUI::Window* mainWin = gui.getGuiSheet(Gui::guiSheet::multiplayerServerMenu); |
| 121 | |
| 122 | CEGUI::Editbox* editNick = static_cast<CEGUI::Editbox*>(mainWin->getChild(Gui::MPM_EDIT_NICK)); |
| 123 | std::string nickname = config.getGameValue(Config::NICKNAME, std::string(), false); |
| 124 | if (!nickname.empty()) |
| 125 | editNick->setText(reinterpret_cast<const CEGUI::utf8*>(nickname.c_str())); |
| 126 | |
| 127 | CEGUI::Combobox* levelTypeCb = static_cast<CEGUI::Combobox*>(mainWin->getChild(MPM_LIST_LEVEL_TYPES)); |
| 128 | levelTypeCb->setItemSelectState(static_cast<size_t>(0), true); |
| 129 | |
| 130 | updateFilesList(); |
| 131 | } |
| 132 | |
| 133 | bool MenuModeMultiplayerServer::updateFilesList(const CEGUI::EventArgs&) |
| 134 | { |
nothing calls this directly
no test coverage detected