| 61 | } |
| 62 | |
| 63 | void MenuModeMultiplayerClient::activate() |
| 64 | { |
| 65 | // Loads the corresponding Gui sheet. |
| 66 | Gui& gui = getModeManager().getGui(); |
| 67 | gui.loadGuiSheet(Gui::guiSheet::multiplayerClientMenu); |
| 68 | |
| 69 | giveFocus(); |
| 70 | |
| 71 | // Play the main menu music |
| 72 | MusicPlayer::getSingleton().play(ConfigManager::getSingleton().getMainMenuMusic()); |
| 73 | |
| 74 | GameMap* gameMap = ODFrameListener::getSingleton().getClientGameMap(); |
| 75 | gameMap->clearAll(); |
| 76 | gameMap->setGamePaused(true); |
| 77 | |
| 78 | CEGUI::Window* mainWin = gui.getGuiSheet(Gui::guiSheet::multiplayerClientMenu); |
| 79 | mainWin->getChild(Gui::MPM_TEXT_LOADING)->setText(""); |
| 80 | |
| 81 | CEGUI::Editbox* editNick = static_cast<CEGUI::Editbox*>(mainWin->getChild(Gui::MPM_EDIT_NICK)); |
| 82 | ConfigManager& config = ConfigManager::getSingleton(); |
| 83 | std::string nickname = config.getGameValue(Config::NICKNAME, std::string(), false); |
| 84 | if (!nickname.empty()) |
| 85 | editNick->setText(reinterpret_cast<const CEGUI::utf8*>(nickname.c_str())); |
| 86 | } |
| 87 | |
| 88 | bool MenuModeMultiplayerClient::clientButtonPressed(const CEGUI::EventArgs&) |
| 89 | { |
nothing calls this directly
no test coverage detected