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

Method EditorMode

source/modes/EditorMode.cpp:79–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79EditorMode::EditorMode(ModeManager* modeManager):
80 GameEditorModeBase(modeManager, ModeManager::EDITOR, modeManager->getGui().getGuiSheet(Gui::guiSheet::editorModeGui)),
81 mCurrentTileVisual(TileVisual::nullTileVisual),
82 mCurrentFullness(100.0),
83 mCurrentCreatureIndex(0),
84 mMouseX(0),
85 mMouseY(0),
86 mSettings(SettingsWindow(mRootWindow))
87{
88 // Set per default the input on the map
89 mModeManager->getInputManager().mMouseDownOnCEGUIWindow = false;
90
91 ODFrameListener::getSingleton().getCameraManager()->setDefaultView();
92
93 // The Quit menu handlers
94 addEventConnection(
95 mRootWindow->getChild("ConfirmExit")->subscribeEvent(
96 CEGUI::FrameWindow::EventCloseClicked,
97 CEGUI::Event::Subscriber(&EditorMode::hideQuitMenu, this)
98 ));
99 addEventConnection(
100 mRootWindow->getChild("ConfirmExit/NoOption")->subscribeEvent(
101 CEGUI::Window::EventMouseClick,
102 CEGUI::Event::Subscriber(&EditorMode::hideQuitMenu, this)
103 ));
104 addEventConnection(
105 mRootWindow->getChild("ConfirmExit/YesOption")->subscribeEvent(
106 CEGUI::Window::EventMouseClick,
107 CEGUI::Event::Subscriber(&EditorMode::onClickYesQuitMenu, this)
108 ));
109
110 // The options menu handlers
111 addEventConnection(
112 mRootWindow->getChild("OptionsButton")->subscribeEvent(
113 CEGUI::Window::EventMouseClick,
114 CEGUI::Event::Subscriber(&EditorMode::toggleOptionsWindow, this)
115 ));
116 addEventConnection(
117 mRootWindow->getChild("EditorOptionsWindow")->subscribeEvent(
118 CEGUI::FrameWindow::EventCloseClicked,
119 CEGUI::Event::Subscriber(&EditorMode::toggleOptionsWindow, this)
120 ));
121 addEventConnection(
122 mRootWindow->getChild("EditorOptionsWindow/SaveLevelButton")->subscribeEvent(
123 CEGUI::Window::EventMouseClick,
124 CEGUI::Event::Subscriber(&EditorMode::onSaveButtonClickFromOptions, this)
125 ));
126 addEventConnection(
127 mRootWindow->getChild("EditorOptionsWindow/SettingsButton")->subscribeEvent(
128 CEGUI::PushButton::EventClicked,
129 CEGUI::Event::Subscriber(&EditorMode::showSettingsFromOptions, this)
130 )
131 );
132 addEventConnection(
133 mRootWindow->getChild("EditorOptionsWindow/QuitEditorButton")->subscribeEvent(
134 CEGUI::Window::EventMouseClick,
135 CEGUI::Event::Subscriber(&EditorMode::showQuitMenuFromOptions, this)
136 ));

Callers

nothing calls this directly

Calls 5

SettingsWindowClass · 0.85
RoomSelectorClass · 0.85
getGuiSheetMethod · 0.80
setDefaultViewMethod · 0.80
getCameraManagerMethod · 0.80

Tested by

no test coverage detected