From b4c8b8308fc5a5bddae48f2643c20c4a21033d19 Mon Sep 17 00:00:00 2001 From: Petr Mikheev Date: Sun, 3 Sep 2023 02:43:55 +0200 Subject: [PATCH] Lock actiovation when the game is paused; Lock movement controls when UI is opened. --- files/data/scripts/omw/activationhandlers.lua | 3 +++ files/data/scripts/omw/playercontrols.lua | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/files/data/scripts/omw/activationhandlers.lua b/files/data/scripts/omw/activationhandlers.lua index 7d185cf9da..2f63f59e92 100644 --- a/files/data/scripts/omw/activationhandlers.lua +++ b/files/data/scripts/omw/activationhandlers.lua @@ -23,6 +23,9 @@ local handlersPerType = {} handlersPerType[types.ESM4Door] = { ESM4DoorActivation } local function onActivate(obj, actor) + if world.isWorldPaused() then + return + end local handlers = handlersPerObject[obj.id] if handlers then for i = #handlers, 1, -1 do diff --git a/files/data/scripts/omw/playercontrols.lua b/files/data/scripts/omw/playercontrols.lua index 56a0b962e6..bea7e5392f 100644 --- a/files/data/scripts/omw/playercontrols.lua +++ b/files/data/scripts/omw/playercontrols.lua @@ -107,7 +107,8 @@ local function processAttacking() end local function onFrame(dt) - local controlsAllowed = input.getControlSwitch(input.CONTROL_SWITCH.Controls) and not core.isWorldPaused() + local controlsAllowed = input.getControlSwitch(input.CONTROL_SWITCH.Controls) + and not core.isWorldPaused() and not I.UI.getMode() if not movementControlsOverridden then if controlsAllowed then processMovement() @@ -165,7 +166,7 @@ local function onInputAction(action) end end - if core.isWorldPaused() then + if core.isWorldPaused() or I.UI.getMode() then return end