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

Method GameMode

source/modes/GameMode.cpp:71–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69const std::string TEXT_SEAT_TEAM_ID_PREFIX = "TextSeatTeam";
70
71GameMode::GameMode(ModeManager *modeManager):
72 GameEditorModeBase(modeManager, ModeManager::GAME, modeManager->getGui().getGuiSheet(Gui::guiSheet::inGameMenu)),
73 mDigSetBool(false),
74 mIndexEvent(0),
75 mSettings(SettingsWindow(mRootWindow)),
76 mIsSkillWindowOpen(false),
77 mCurrentSkillType(SkillType::nullSkillType),
78 mCurrentSkillProgress(0.0)
79{
80 // Set per default the input on the map
81 mModeManager->getInputManager().mMouseDownOnCEGUIWindow = false;
82
83 ODFrameListener::getSingleton().getCameraManager()->setDefaultView();
84
85 CEGUI::Window* guiSheet = mRootWindow;
86
87 //Help window
88 addEventConnection(
89 guiSheet->getChild("HelpButton")->subscribeEvent(
90 CEGUI::PushButton::EventClicked,
91 CEGUI::Event::Subscriber(&GameMode::toggleHelpWindow, this)
92 )
93 );
94
95 //Objectives window
96 addEventConnection(
97 guiSheet->getChild("ObjectivesButton")->subscribeEvent(
98 CEGUI::PushButton::EventClicked,
99 CEGUI::Event::Subscriber(&GameMode::toggleObjectivesWindow, this)
100 )
101 );
102 addEventConnection(
103 guiSheet->getChild("ObjectivesWindow")->subscribeEvent(
104 CEGUI::FrameWindow::EventCloseClicked,
105 CEGUI::Event::Subscriber(&GameMode::hideObjectivesWindow, this)
106 )
107 );
108
109 //Player settings window
110 addEventConnection(
111 guiSheet->getChild("PlayerSettingsButton")->subscribeEvent(
112 CEGUI::PushButton::EventClicked,
113 CEGUI::Event::Subscriber(&GameMode::togglePlayerSettingsWindow, this)
114 )
115 );
116 addEventConnection(
117 guiSheet->getChild("PlayerSettingsWindow")->subscribeEvent(
118 CEGUI::FrameWindow::EventCloseClicked,
119 CEGUI::Event::Subscriber(&GameMode::cancelPlayerSettings, this)
120 )
121 );
122 addEventConnection(
123 guiSheet->getChild("PlayerSettingsWindow/CancelButton")->subscribeEvent(
124 CEGUI::PushButton::EventClicked,
125 CEGUI::Event::Subscriber(&GameMode::cancelPlayerSettings, this)
126 )
127 );
128 addEventConnection(

Callers

nothing calls this directly

Calls 5

SettingsWindowClass · 0.85
getGuiSheetMethod · 0.80
setDefaultViewMethod · 0.80
getCameraManagerMethod · 0.80
isConnectedMethod · 0.45

Tested by

no test coverage detected