diff --git a/CMakeLists.txt b/CMakeLists.txt index d50cbe919..47575e0ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -206,7 +206,12 @@ IF(BOOST_STATIC) endif() find_package(OGRE REQUIRED) + find_package(MyGUI REQUIRED) +if (${MYGUI_VERSION} VERSION_LESS "3.2.1") + message(FATAL_ERROR "OpenMW requires MyGUI 3.2.1 or later, please install the latest version from http://mygui.info") +endif() + find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS}) find_package(SDL2 REQUIRED) find_package(OpenAL REQUIRED) diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 7c0baaffe..7096f3d89 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -207,14 +207,12 @@ namespace MWGui mVideoWidget->setNeedMouseFocus(true); mVideoWidget->setNeedKeyFocus(true); -#if MYGUI_VERSION >= MYGUI_DEFINE_VERSION(3,2,1) // Removes default MyGUI system clipboard implementation, which supports windows only MyGUI::ClipboardManager::getInstance().eventClipboardChanged.clear(); MyGUI::ClipboardManager::getInstance().eventClipboardRequested.clear(); MyGUI::ClipboardManager::getInstance().eventClipboardChanged += MyGUI::newDelegate(this, &WindowManager::onClipboardChanged); MyGUI::ClipboardManager::getInstance().eventClipboardRequested += MyGUI::newDelegate(this, &WindowManager::onClipboardRequested); -#endif } void WindowManager::initUI() diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index 132ed3326..e1f7c31fc 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -498,48 +498,6 @@ namespace MWInput void InputManager::keyPressed( const SDL_KeyboardEvent &arg ) { -#if MYGUI_VERSION <= MYGUI_DEFINE_VERSION(3,2,0) - // Cut, copy & paste - MyGUI::Widget* focus = MyGUI::InputManager::getInstance().getKeyFocusWidget(); - if (focus) - { - MyGUI::EditBox* edit = focus->castType(false); - if (edit && !edit->getEditReadOnly()) - { - if (arg.keysym.sym == SDLK_v && (arg.keysym.mod & SDL_Keymod(KMOD_CTRL))) - { - char* text = SDL_GetClipboardText(); - - if (text) - { - edit->insertText(MyGUI::UString(text), edit->getTextCursor()); - SDL_free(text); - } - } - if (arg.keysym.sym == SDLK_x && (arg.keysym.mod & SDL_Keymod(KMOD_CTRL))) - { - // Discard color codes and other escape characters - std::string text = MyGUI::TextIterator::getOnlyText(edit->getTextSelection()); - if (text.length()) - { - SDL_SetClipboardText(text.c_str()); - edit->deleteTextSelection(); - } - } - } - if (edit && !edit->getEditStatic()) - { - if (arg.keysym.sym == SDLK_c && (arg.keysym.mod & SDL_Keymod(KMOD_CTRL))) - { - // Discard color codes and other escape characters - std::string text = MyGUI::TextIterator::getOnlyText(edit->getTextSelection()); - if (text.length()) - SDL_SetClipboardText(text.c_str()); - } - } - } -#endif - OIS::KeyCode kc = mInputManager->sdl2OISKeyCode(arg.keysym.sym); bool consumed = false; @@ -552,12 +510,6 @@ namespace MWInput } if (!mControlsDisabled && !consumed) mInputBinder->keyPressed (arg); - - // Clear MyGUI's clipboard, so it doesn't interfere with our own clipboard implementation. - // We do not use MyGUI's clipboard manager because it doesn't support system clipboard integration with SDL. -#if MYGUI_VERSION <= MYGUI_DEFINE_VERSION(3,2,0) - MyGUI::ClipboardManager::getInstance().clearClipboardData("Text"); -#endif } void InputManager::textInput(const SDL_TextInputEvent &arg)