mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-03 04:06:40 +00:00
Fix controls disabling
This commit is contained in:
parent
2f2b3173e3
commit
0eb24da2e7
3 changed files with 3 additions and 9 deletions
|
@ -216,9 +216,9 @@ namespace MWInput
|
||||||
void InputManager::update(float dt, bool disableControls, bool disableEvents)
|
void InputManager::update(float dt, bool disableControls, bool disableEvents)
|
||||||
{
|
{
|
||||||
mInputWrapper->setMouseVisible(MWBase::Environment::get().getWindowManager()->getCursorVisible());
|
mInputWrapper->setMouseVisible(MWBase::Environment::get().getWindowManager()->getCursorVisible());
|
||||||
|
|
||||||
mInputWrapper->capture(disableEvents);
|
mInputWrapper->capture(disableEvents);
|
||||||
|
|
||||||
|
mKeyboardManager->setControlsDisabled(disableControls);
|
||||||
if (disableControls)
|
if (disableControls)
|
||||||
{
|
{
|
||||||
updateCursorMode();
|
updateCursorMode();
|
||||||
|
@ -231,7 +231,6 @@ namespace MWInput
|
||||||
updateCursorMode();
|
updateCursorMode();
|
||||||
|
|
||||||
bool controllerMove = mControllerManager->update(dt, disableControls);
|
bool controllerMove = mControllerManager->update(dt, disableControls);
|
||||||
mKeyboardManager->update(dt, disableControls);
|
|
||||||
mMouseManager->update(dt, disableControls);
|
mMouseManager->update(dt, disableControls);
|
||||||
mSensorManager->update(dt, mGuiCursorEnabled);
|
mSensorManager->update(dt, mGuiCursorEnabled);
|
||||||
mActionManager->update(dt, controllerMove);
|
mActionManager->update(dt, controllerMove);
|
||||||
|
|
|
@ -27,11 +27,6 @@ namespace MWInput
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyboardManager::update(float dt, bool disableControls)
|
|
||||||
{
|
|
||||||
mControlsDisabled = disableControls;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool KeyboardManager::actionIsActive (int id)
|
bool KeyboardManager::actionIsActive (int id)
|
||||||
{
|
{
|
||||||
return (mInputBinder->getChannel(id)->getValue ()==1.0);
|
return (mInputBinder->getChannel(id)->getValue ()==1.0);
|
||||||
|
|
|
@ -25,12 +25,12 @@ namespace MWInput
|
||||||
|
|
||||||
virtual ~KeyboardManager() = default;
|
virtual ~KeyboardManager() = default;
|
||||||
|
|
||||||
void update(float dt, bool disableControls);
|
|
||||||
|
|
||||||
virtual void textInput(const SDL_TextInputEvent &arg);
|
virtual void textInput(const SDL_TextInputEvent &arg);
|
||||||
virtual void keyPressed(const SDL_KeyboardEvent &arg);
|
virtual void keyPressed(const SDL_KeyboardEvent &arg);
|
||||||
virtual void keyReleased(const SDL_KeyboardEvent &arg);
|
virtual void keyReleased(const SDL_KeyboardEvent &arg);
|
||||||
|
|
||||||
|
void setControlsDisabled(bool disabled) { mControlsDisabled = disabled; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool actionIsActive(int id);
|
bool actionIsActive(int id);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue