MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / activate

Method activate

source/modes/MenuModeMultiplayerServer.cpp:103–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void 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
133bool MenuModeMultiplayerServer::updateFilesList(const CEGUI::EventArgs&)
134{

Callers

nothing calls this directly

Calls 8

loadGuiSheetMethod · 0.80
getClientGameMapMethod · 0.80
clearAllMethod · 0.80
setGamePausedMethod · 0.80
getGuiSheetMethod · 0.80
getGameValueMethod · 0.80
setTextMethod · 0.80
playMethod · 0.45

Tested by

no test coverage detected