| 84 | } |
| 85 | |
| 86 | void MenuModeMasterServerJoin::activate() |
| 87 | { |
| 88 | // Loads the corresponding Gui sheet. |
| 89 | Gui& gui = getModeManager().getGui(); |
| 90 | gui.loadGuiSheet(Gui::guiSheet::multiMasterServerJoinMenu); |
| 91 | |
| 92 | giveFocus(); |
| 93 | |
| 94 | // Play the main menu music |
| 95 | MusicPlayer::getSingleton().play(ConfigManager::getSingleton().getMainMenuMusic()); |
| 96 | |
| 97 | GameMap* gameMap = ODFrameListener::getSingleton().getClientGameMap(); |
| 98 | gameMap->clearAll(); |
| 99 | gameMap->setGamePaused(true); |
| 100 | |
| 101 | CEGUI::Window* mainWin = gui.getGuiSheet(Gui::guiSheet::multiMasterServerJoinMenu); |
| 102 | mainWin->getChild("LoadingText")->setText(""); |
| 103 | |
| 104 | CEGUI::Editbox* editNick = static_cast<CEGUI::Editbox*>( |
| 105 | mainWin->getChild("LevelWindowFrame/NickEdit")); |
| 106 | ConfigManager& config = ConfigManager::getSingleton(); |
| 107 | std::string nickname = config.getGameValue(Config::NICKNAME, std::string(), false); |
| 108 | if (!nickname.empty()) |
| 109 | editNick->setText(reinterpret_cast<const CEGUI::utf8*>(nickname.c_str())); |
| 110 | |
| 111 | refreshList(); |
| 112 | } |
| 113 | |
| 114 | void MenuModeMasterServerJoin::refreshList() |
| 115 | { |
nothing calls this directly
no test coverage detected