mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 12:53:52 +00:00
Fixes #1236: Disable all controls while playing movie
This commit is contained in:
parent
30666f2cce
commit
d5dd864404
2 changed files with 12 additions and 7 deletions
|
@ -114,6 +114,7 @@ namespace MWInput
|
||||||
, mTimeIdle(0.f)
|
, mTimeIdle(0.f)
|
||||||
, mOverencumberedMessageDelay(0.f)
|
, mOverencumberedMessageDelay(0.f)
|
||||||
, mAlwaysRunActive(false)
|
, mAlwaysRunActive(false)
|
||||||
|
, mControlsDisabled(false)
|
||||||
{
|
{
|
||||||
|
|
||||||
Ogre::RenderWindow* window = ogre.getWindow ();
|
Ogre::RenderWindow* window = ogre.getWindow ();
|
||||||
|
@ -265,19 +266,20 @@ namespace MWInput
|
||||||
|
|
||||||
void InputManager::update(float dt, bool disableControls, bool disableEvents)
|
void InputManager::update(float dt, bool disableControls, bool disableEvents)
|
||||||
{
|
{
|
||||||
|
mControlsDisabled = disableControls;
|
||||||
|
|
||||||
mInputManager->setMouseVisible(MWBase::Environment::get().getWindowManager()->getCursorVisible());
|
mInputManager->setMouseVisible(MWBase::Environment::get().getWindowManager()->getCursorVisible());
|
||||||
|
|
||||||
mInputManager->capture(disableEvents);
|
mInputManager->capture(disableEvents);
|
||||||
// inject some fake mouse movement to force updating MyGUI's widget states
|
// inject some fake mouse movement to force updating MyGUI's widget states
|
||||||
MyGUI::InputManager::getInstance().injectMouseMove( int(mMouseX), int(mMouseY), mMouseWheel);
|
MyGUI::InputManager::getInstance().injectMouseMove( int(mMouseX), int(mMouseY), mMouseWheel);
|
||||||
|
|
||||||
// update values of channels (as a result of pressed keys)
|
if (mControlsDisabled)
|
||||||
if (!disableControls)
|
|
||||||
mInputBinder->update(dt);
|
|
||||||
|
|
||||||
if (disableControls)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// update values of channels (as a result of pressed keys)
|
||||||
|
mInputBinder->update(dt);
|
||||||
|
|
||||||
bool grab = !MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_MainMenu)
|
bool grab = !MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_MainMenu)
|
||||||
&& MWBase::Environment::get().getWindowManager()->getMode() != MWGui::GM_Console;
|
&& MWBase::Environment::get().getWindowManager()->getMode() != MWGui::GM_Console;
|
||||||
|
|
||||||
|
@ -509,7 +511,8 @@ namespace MWInput
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mInputBinder->keyPressed (arg);
|
if (!mControlsDisabled)
|
||||||
|
mInputBinder->keyPressed (arg);
|
||||||
|
|
||||||
OIS::KeyCode kc = mInputManager->sdl2OISKeyCode(arg.keysym.sym);
|
OIS::KeyCode kc = mInputManager->sdl2OISKeyCode(arg.keysym.sym);
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ namespace MWInput
|
||||||
/// Clear all savegame-specific data
|
/// Clear all savegame-specific data
|
||||||
virtual void clear();
|
virtual void clear();
|
||||||
|
|
||||||
virtual void update(float dt, bool disableControls, bool disableEvents=false);
|
virtual void update(float dt, bool disableControls=false, bool disableEvents=false);
|
||||||
|
|
||||||
void setPlayer (MWWorld::Player* player) { mPlayer = player; }
|
void setPlayer (MWWorld::Player* player) { mPlayer = player; }
|
||||||
|
|
||||||
|
@ -145,6 +145,8 @@ namespace MWInput
|
||||||
|
|
||||||
bool mInvertY;
|
bool mInvertY;
|
||||||
|
|
||||||
|
bool mControlsDisabled;
|
||||||
|
|
||||||
float mCameraSensitivity;
|
float mCameraSensitivity;
|
||||||
float mUISensitivity;
|
float mUISensitivity;
|
||||||
float mCameraYMultiplier;
|
float mCameraYMultiplier;
|
||||||
|
|
Loading…
Reference in a new issue