mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Don't grab the cursor while the console is opened
This commit is contained in:
parent
065f14579f
commit
d619d0fa25
@ -274,7 +274,8 @@ namespace MWInput
|
|||||||
if (!loading)
|
if (!loading)
|
||||||
mInputBinder->update(dt);
|
mInputBinder->update(dt);
|
||||||
|
|
||||||
bool main_menu = 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;
|
||||||
|
|
||||||
bool was_relative = mInputManager->getMouseRelative();
|
bool was_relative = mInputManager->getMouseRelative();
|
||||||
bool is_relative = !MWBase::Environment::get().getWindowManager()->isGuiMode();
|
bool is_relative = !MWBase::Environment::get().getWindowManager()->isGuiMode();
|
||||||
@ -284,7 +285,7 @@ namespace MWInput
|
|||||||
mInputManager->setMouseRelative(is_relative);
|
mInputManager->setMouseRelative(is_relative);
|
||||||
|
|
||||||
//we let the mouse escape in the main menu
|
//we let the mouse escape in the main menu
|
||||||
mInputManager->setGrabPointer(!main_menu);
|
mInputManager->setGrabPointer(grab);
|
||||||
|
|
||||||
//we switched to non-relative mode, move our cursor to where the in-game
|
//we switched to non-relative mode, move our cursor to where the in-game
|
||||||
//cursor is
|
//cursor is
|
||||||
|
Loading…
x
Reference in New Issue
Block a user