| 293 | } |
| 294 | |
| 295 | void 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 | |
| 342 | bool GameMode::mouseMoved(const OIS::MouseEvent &arg) |
| 343 | { |
no test coverage detected