From 65cd518b44bb39e724b2392cf7819da5a01fdbe8 Mon Sep 17 00:00:00 2001 From: Petr Mikheev Date: Sun, 3 Sep 2023 02:46:23 +0200 Subject: [PATCH] Update camera logic related to paused game / opened UI --- apps/openmw/mwrender/camera.cpp | 6 ++---- files/data/scripts/omw/camera/camera.lua | 5 +++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwrender/camera.cpp b/apps/openmw/mwrender/camera.cpp index fbe5c6b4c7..86d5699d75 100644 --- a/apps/openmw/mwrender/camera.cpp +++ b/apps/openmw/mwrender/camera.cpp @@ -138,14 +138,12 @@ namespace MWRender if (mProcessViewChange) processViewChange(); - if (paused) - return; - // only show the crosshair in game mode MWBase::WindowManager* wm = MWBase::Environment::get().getWindowManager(); wm->showCrosshair(!wm->isGuiMode() && mShowCrosshair); - updateFocalPointOffset(duration); + if (!paused) + updateFocalPointOffset(duration); updatePosition(); } diff --git a/files/data/scripts/omw/camera/camera.lua b/files/data/scripts/omw/camera/camera.lua index 6fcb46bb2f..a3d2ae7b3f 100644 --- a/files/data/scripts/omw/camera/camera.lua +++ b/files/data/scripts/omw/camera/camera.lua @@ -5,6 +5,7 @@ local util = require('openmw.util') local self = require('openmw.self') local nearby = require('openmw.nearby') local async = require('openmw.async') +local I = require('openmw.interfaces') local Actor = require('openmw.types').Actor @@ -189,7 +190,7 @@ local function updateIdleTimer(dt) end local function onFrame(dt) - if core.isWorldPaused() then return end + if core.isWorldPaused() or I.UI.getMode() then return end updateIdleTimer(dt) local mode = camera.getMode() if (mode == MODE.FirstPerson or mode == MODE.ThirdPerson) and not camera.getQueuedMode() then @@ -273,7 +274,7 @@ return { onUpdate = onUpdate, onFrame = onFrame, onInputAction = function(action) - if core.isWorldPaused() then return end + if core.isWorldPaused() or I.UI.getMode() then return end if action == input.ACTION.ZoomIn then zoom(10) elseif action == input.ACTION.ZoomOut then