mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 13:49:40 +00:00
Require MyGUI version 3.2.1 and remove legacy code (Fixes #1528)
This commit is contained in:
parent
1baf0f7bb2
commit
17dc01ec44
3 changed files with 5 additions and 50 deletions
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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<MyGUI::EditBox>(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)
|
||||
|
|
Loading…
Reference in a new issue