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

Method activate

source/modes/MenuModeMultiplayerClient.cpp:63–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void 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
88bool MenuModeMultiplayerClient::clientButtonPressed(const CEGUI::EventArgs&)
89{

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