1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-07 12:54:00 +00:00

Enable Lua mouse engine handlers while in UI

This commit is contained in:
uramer 2024-02-11 23:49:26 +01:00
parent f4fed4ca5f
commit 63a1bbb88d
2 changed files with 7 additions and 7 deletions

View File

@ -119,9 +119,10 @@ namespace MWInput
mBindingsManager->setPlayerControlsEnabled(!guiMode);
mBindingsManager->mouseReleased(arg, id);
MWBase::Environment::get().getLuaManager()->inputEvent(
{ MWBase::LuaManager::InputEvent::MouseButtonReleased, arg.button });
}
MWBase::Environment::get().getLuaManager()->inputEvent(
{ MWBase::LuaManager::InputEvent::MouseButtonReleased, arg.button });
}
void MouseManager::mouseWheelMoved(const SDL_MouseWheelEvent& arg)
@ -130,11 +131,11 @@ namespace MWInput
if (mBindingsManager->isDetectingBindingState() || !input->controlsDisabled())
{
mBindingsManager->mouseWheelMoved(arg);
MWBase::Environment::get().getLuaManager()->inputEvent({ MWBase::LuaManager::InputEvent::MouseWheel,
MWBase::LuaManager::InputEvent::WheelChange{ arg.x, arg.y } });
}
input->setJoystickLastUsed(false);
MWBase::Environment::get().getLuaManager()->inputEvent({ MWBase::LuaManager::InputEvent::MouseWheel,
MWBase::LuaManager::InputEvent::WheelChange{ arg.x, arg.y } });
}
void MouseManager::mousePressed(const SDL_MouseButtonEvent& arg, Uint8 id)
@ -170,9 +171,9 @@ namespace MWInput
if ((!settingsWindow || !settingsWindow->isVisible()) && !input->controlsDisabled())
{
mBindingsManager->mousePressed(arg, id);
MWBase::Environment::get().getLuaManager()->inputEvent(
{ MWBase::LuaManager::InputEvent::MouseButtonPressed, arg.button });
}
MWBase::Environment::get().getLuaManager()->inputEvent(
{ MWBase::LuaManager::InputEvent::MouseButtonPressed, arg.button });
}
void MouseManager::updateCursorMode()

View File

@ -181,7 +181,6 @@ return {
onKeyPress = function(key)
bindButton(key.code ~= input.KEY.Escape and 'keyboard' or nil, key.code)
end,
-- TODO: currently never triggers, because mouse events are disabled while inside settings
onMouseButtonPress = function(button)
bindButton('mouse', button)
end,