From 4fd7891d2cf57e7531c07da0e288c6eed197f186 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 16 Jun 2013 20:26:27 +0200 Subject: [PATCH] Fix a message box issue --- apps/openmw/mwgui/tooltips.cpp | 15 +++------------ apps/openmw/mwgui/tooltips.hpp | 5 ----- apps/openmw/mwgui/windowmanagerimp.cpp | 5 ----- apps/openmw/mwinput/inputmanagerimp.cpp | 2 +- 4 files changed, 4 insertions(+), 23 deletions(-) diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index e73ed6b5e..9cbb3cced 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -18,7 +18,6 @@ namespace MWGui ToolTips::ToolTips() : Layout("openmw_tooltips.layout") - , mGameMode(true) , mFullHelp(false) , mEnabled(true) , mFocusToolTipX(0.0) @@ -73,7 +72,9 @@ namespace MWGui return; } - if (!mGameMode) + bool gameMode = MWBase::Environment::get().getWindowManager()->isGuiMode(); + + if (gameMode) { const MyGUI::IntPoint& mousePos = MyGUI::InputManager::getInstance().getMousePosition(); @@ -297,16 +298,6 @@ namespace MWGui } } - void ToolTips::enterGameMode() - { - mGameMode = true; - } - - void ToolTips::enterGuiMode() - { - mGameMode = false; - } - void ToolTips::setFocusObject(const MWWorld::Ptr& focus) { mFocusObject = focus; diff --git a/apps/openmw/mwgui/tooltips.hpp b/apps/openmw/mwgui/tooltips.hpp index f8f256167..a8524a4ca 100644 --- a/apps/openmw/mwgui/tooltips.hpp +++ b/apps/openmw/mwgui/tooltips.hpp @@ -43,9 +43,6 @@ namespace MWGui void onFrame(float frameDuration); - void enterGameMode(); - void enterGuiMode(); - void setEnabled(bool enabled); void toggleFullHelp(); ///< show extra info in item tooltips (owner, script) @@ -104,8 +101,6 @@ namespace MWGui int mLastMouseX; int mLastMouseY; - bool mGameMode; - bool mEnabled; bool mFullHelp; diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index c57fd7550..5ca82bc8a 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -356,11 +356,6 @@ namespace MWGui mInputBlocker->setVisible (gameMode); setCursorVisible(!gameMode); - if (gameMode) - mToolTips->enterGameMode(); - else - mToolTips->enterGuiMode(); - if (gameMode) setKeyFocusWidget (NULL); diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index 2fd8b4085..724caf874 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -408,6 +408,7 @@ namespace MWInput mMouseLookEnabled = !guiMode; if (guiMode) mWindows.showCrosshair(false); + mWindows.setCursorVisible(guiMode); // if not in gui mode, the camera decides whether to show crosshair or not. } @@ -470,7 +471,6 @@ namespace MWInput bool InputManager::keyPressed( const SDL_KeyboardEvent &arg ) { mInputBinder->keyPressed (arg); - unsigned int text = arg.keysym.unicode; if(arg.keysym.sym == SDLK_RETURN && MWBase::Environment::get().getWindowManager()->isGuiMode())