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

Method activate

source/modes/MenuModeMasterServerJoin.cpp:86–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void 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
114void MenuModeMasterServerJoin::refreshList()
115{

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected