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

Method activate

source/modes/MenuModeMain.cpp:142–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142void MenuModeMain::activate()
143{
144 // Loads the corresponding Gui sheet.
145 getModeManager().getGui().loadGuiSheet(Gui::mainMenu);
146 CEGUI::Window* window = getModeManager().getGui().getGuiSheet(Gui::mainMenu);
147 OD_ASSERT_TRUE(window != nullptr);
148
149 window->getChild(WINDOW_SKIRMISH)->hide();
150 window->getChild(WINDOW_MULTIPLAYER)->hide();
151 window->getChild(WINDOW_EDITOR)->hide();
152
153 giveFocus();
154
155 TextRenderer::getSingleton().setText(ODApplication::POINTER_INFO_STRING, "");
156
157 // Play the main menu music
158 MusicPlayer::getSingleton().play(ConfigManager::getSingleton().getMainMenuMusic());
159
160 GameMap* gameMap = ODFrameListener::getSingletonPtr()->getClientGameMap();
161 gameMap->clearAll();
162 gameMap->setGamePaused(true);
163
164 ODFrameListener::getSingleton().stopGameRenderer();
165 ODFrameListener::getSingleton().createMainMenuScene();
166}
167
168void MenuModeMain::connectModeChangeEvent(const std::string& buttonName, AbstractModeManager::ModeType mode)
169{

Callers

nothing calls this directly

Calls 10

loadGuiSheetMethod · 0.80
getGuiSheetMethod · 0.80
hideMethod · 0.80
setTextMethod · 0.80
getClientGameMapMethod · 0.80
clearAllMethod · 0.80
setGamePausedMethod · 0.80
createMainMenuSceneMethod · 0.80
playMethod · 0.45
stopGameRendererMethod · 0.45

Tested by

no test coverage detected