| 77 | } |
| 78 | |
| 79 | EditorMode::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 | )); |
nothing calls this directly
no test coverage detected