1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-06 00:55:50 +00:00

Update camera logic related to paused game / opened UI

This commit is contained in:
Petr Mikheev 2023-09-03 02:46:23 +02:00
parent 23a7661d0b
commit 65cd518b44
2 changed files with 5 additions and 6 deletions

View File

@ -138,14 +138,12 @@ namespace MWRender
if (mProcessViewChange) if (mProcessViewChange)
processViewChange(); processViewChange();
if (paused)
return;
// only show the crosshair in game mode // only show the crosshair in game mode
MWBase::WindowManager* wm = MWBase::Environment::get().getWindowManager(); MWBase::WindowManager* wm = MWBase::Environment::get().getWindowManager();
wm->showCrosshair(!wm->isGuiMode() && mShowCrosshair); wm->showCrosshair(!wm->isGuiMode() && mShowCrosshair);
updateFocalPointOffset(duration); if (!paused)
updateFocalPointOffset(duration);
updatePosition(); updatePosition();
} }

View File

@ -5,6 +5,7 @@ local util = require('openmw.util')
local self = require('openmw.self') local self = require('openmw.self')
local nearby = require('openmw.nearby') local nearby = require('openmw.nearby')
local async = require('openmw.async') local async = require('openmw.async')
local I = require('openmw.interfaces')
local Actor = require('openmw.types').Actor local Actor = require('openmw.types').Actor
@ -189,7 +190,7 @@ local function updateIdleTimer(dt)
end end
local function onFrame(dt) local function onFrame(dt)
if core.isWorldPaused() then return end if core.isWorldPaused() or I.UI.getMode() then return end
updateIdleTimer(dt) updateIdleTimer(dt)
local mode = camera.getMode() local mode = camera.getMode()
if (mode == MODE.FirstPerson or mode == MODE.ThirdPerson) and not camera.getQueuedMode() then if (mode == MODE.FirstPerson or mode == MODE.ThirdPerson) and not camera.getQueuedMode() then
@ -273,7 +274,7 @@ return {
onUpdate = onUpdate, onUpdate = onUpdate,
onFrame = onFrame, onFrame = onFrame,
onInputAction = function(action) 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 if action == input.ACTION.ZoomIn then
zoom(10) zoom(10)
elseif action == input.ACTION.ZoomOut then elseif action == input.ACTION.ZoomOut then