Fix cursor issue when loading savegame from within mouselook-mode and a warning pops up

openmw-35
scrawl 10 years ago
parent 7b4665c623
commit 3ce22d31d8

@ -302,22 +302,8 @@ namespace MWInput
} }
} }
void InputManager::update(float dt, bool disableControls, bool disableEvents) void InputManager::updateCursorMode()
{ {
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);
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) 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;
@ -337,6 +323,28 @@ namespace MWInput
{ {
mInputManager->warpMouse(mMouseX, mMouseY); mInputManager->warpMouse(mMouseX, mMouseY);
} }
}
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);
if (mControlsDisabled)
{
updateCursorMode();
return;
}
// update values of channels (as a result of pressed keys)
mInputBinder->update(dt);
updateCursorMode();
// Disable movement in Gui mode // Disable movement in Gui mode
if (!(MWBase::Environment::get().getWindowManager()->isGuiMode() if (!(MWBase::Environment::get().getWindowManager()->isGuiMode()

@ -176,6 +176,8 @@ namespace MWInput
void setPlayerControlsEnabled(bool enabled); void setPlayerControlsEnabled(bool enabled);
void updateCursorMode();
private: private:
void toggleMainMenu(); void toggleMainMenu();
void toggleSpell(); void toggleSpell();

Loading…
Cancel
Save