mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
Fix cursor issue when loading savegame from within mouselook-mode and a warning pops up
This commit is contained in:
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)
|
||||
&& MWBase::Environment::get().getWindowManager()->getMode() != MWGui::GM_Console;
|
||||
|
||||
@ -337,6 +323,28 @@ namespace MWInput
|
||||
{
|
||||
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
|
||||
if (!(MWBase::Environment::get().getWindowManager()->isGuiMode()
|
||||
|
@ -176,6 +176,8 @@ namespace MWInput
|
||||
|
||||
void setPlayerControlsEnabled(bool enabled);
|
||||
|
||||
void updateCursorMode();
|
||||
|
||||
private:
|
||||
void toggleMainMenu();
|
||||
void toggleSpell();
|
||||
|
Loading…
Reference in New Issue
Block a user