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

Method activate

source/modes/GameMode.cpp:295–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293}
294
295void GameMode::activate()
296{
297 // Loads the corresponding Gui sheet.
298 Gui& gui = getModeManager().getGui();
299 gui.loadGuiSheet(Gui::inGameMenu);
300
301 // We free the menu scene as it is not required anymore
302 ODFrameListener::getSingleton().freeMainMenuScene();
303
304 buildPlayerSettingsWindow();
305
306 // Hides the exit pop-up and certain buttons only used by the editor.
307 CEGUI::Window* guiSheet = mRootWindow;
308 guiSheet->getChild(Gui::EXIT_CONFIRMATION_POPUP)->hide();
309 guiSheet->getChild("ObjectivesWindow")->hide();
310 guiSheet->getChild("PlayerSettingsWindow")->hide();
311 guiSheet->getChild("SkillTreeWindow")->hide();
312 guiSheet->getChild("SettingsWindow")->hide();
313 guiSheet->getChild("GameOptionsWindow")->hide();
314 guiSheet->getChild("GameChatWindow/GameChatEditBox")->hide();
315 guiSheet->getChild("GameHelpWindow")->hide();
316
317 giveFocus();
318
319 // Play the game music.
320 MusicPlayer::getSingleton().play(mGameMap->getLevelMusicFile()); // in game music
321
322 std::string colorStr = Helper::getImageColoursStringFromColourValue(mGameMap->getLocalPlayer()->getSeat()->getColorValue());
323 guiSheet->getChild("HorizontalPipe")->setProperty("ImageColours", colorStr);
324
325 if(mGameMap->getTurnNumber() != -1)
326 {
327 /* The game has been resumed from another mode (like console).
328 Let's refresh the exit popup */
329 popupExit(mGameMap->getGamePaused());
330 }
331 else
332 {
333 mGameMap->setGamePaused(false);
334 }
335
336 // Update available options
337 refreshGuiSkill(true);
338
339 syncPlayerSettings();
340}
341
342bool GameMode::mouseMoved(const OIS::MouseEvent &arg)
343{

Callers 3

enterConsoleMethod · 0.45
checkModeChangeMethod · 0.45
keyPressedNormalMethod · 0.45

Calls 10

loadGuiSheetMethod · 0.80
freeMainMenuSceneMethod · 0.80
hideMethod · 0.80
getLocalPlayerMethod · 0.80
getTurnNumberMethod · 0.80
getGamePausedMethod · 0.80
setGamePausedMethod · 0.80
playMethod · 0.45
getSeatMethod · 0.45

Tested by

no test coverage detected