Fixes #1236: Disable all controls while playing movie

actorid
scrawl 11 years ago
parent 30666f2cce
commit d5dd864404

@ -114,6 +114,7 @@ namespace MWInput
, mTimeIdle(0.f)
, mOverencumberedMessageDelay(0.f)
, mAlwaysRunActive(false)
, mControlsDisabled(false)
{
Ogre::RenderWindow* window = ogre.getWindow ();
@ -265,19 +266,20 @@ namespace MWInput
void InputManager::update(float dt, bool disableControls, bool disableEvents)
{
mControlsDisabled = disableControls;
mInputManager->setMouseVisible(MWBase::Environment::get().getWindowManager()->getCursorVisible());
mInputManager->capture(disableEvents);
// inject some fake mouse movement to force updating MyGUI's widget states
MyGUI::InputManager::getInstance().injectMouseMove( int(mMouseX), int(mMouseY), mMouseWheel);
// update values of channels (as a result of pressed keys)
if (!disableControls)
mInputBinder->update(dt);
if (disableControls)
if (mControlsDisabled)
return;
// update values of channels (as a result of pressed keys)
mInputBinder->update(dt);
bool grab = !MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_MainMenu)
&& 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);

@ -68,7 +68,7 @@ namespace MWInput
/// Clear all savegame-specific data
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; }
@ -145,6 +145,8 @@ namespace MWInput
bool mInvertY;
bool mControlsDisabled;
float mCameraSensitivity;
float mUISensitivity;
float mCameraYMultiplier;

Loading…
Cancel
Save