mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 20:45:33 +00:00
Changed logic for updating GUI tracking
This commit is contained in:
parent
6474d703ae
commit
5fba3b17e7
4 changed files with 10 additions and 31 deletions
|
@ -1572,8 +1572,7 @@ namespace MWGui
|
||||||
return
|
return
|
||||||
!mGuiModes.empty() ||
|
!mGuiModes.empty() ||
|
||||||
isConsoleMode() ||
|
isConsoleMode() ||
|
||||||
(mMessageBoxManager && mMessageBoxManager->isInteractiveMessageBox()) ||
|
(mMessageBoxManager && mMessageBoxManager->isInteractiveMessageBox());
|
||||||
mVideoEnabled;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WindowManager::isConsoleMode() const
|
bool WindowManager::isConsoleMode() const
|
||||||
|
@ -1897,12 +1896,6 @@ namespace MWGui
|
||||||
mVideoEnabled = true;
|
mVideoEnabled = true;
|
||||||
mVideoWidget->playVideo("video\\" + name);
|
mVideoWidget->playVideo("video\\" + name);
|
||||||
|
|
||||||
#ifdef USE_OPENXR
|
|
||||||
// Temporary hack to force update of menu placement
|
|
||||||
// (Menu gets recreated next tick)
|
|
||||||
auto* xrMenuManager = MWVR::Environment::get().getGUIManager();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
mVideoWidget->eventKeyButtonPressed.clear();
|
mVideoWidget->eventKeyButtonPressed.clear();
|
||||||
mVideoBackground->eventKeyButtonPressed.clear();
|
mVideoBackground->eventKeyButtonPressed.clear();
|
||||||
if (allowSkipping)
|
if (allowSkipping)
|
||||||
|
@ -1940,15 +1933,6 @@ namespace MWGui
|
||||||
frameTimer.setStartTick();
|
frameTimer.setStartTick();
|
||||||
|
|
||||||
MWBase::Environment::get().getInputManager()->update(dt, true, false);
|
MWBase::Environment::get().getInputManager()->update(dt, true, false);
|
||||||
#ifdef USE_OPENXR
|
|
||||||
// Temporary hack to force update of menu placement
|
|
||||||
// (Menu gets recreated next tick)
|
|
||||||
if (xrMenuManager)
|
|
||||||
{
|
|
||||||
xrMenuManager->updateTracking();
|
|
||||||
xrMenuManager = nullptr;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!MWBase::Environment::get().getInputManager()->isWindowVisible())
|
if (!MWBase::Environment::get().getInputManager()->isWindowVisible())
|
||||||
OpenThreads::Thread::microSleep(5000);
|
OpenThreads::Thread::microSleep(5000);
|
||||||
|
|
|
@ -1056,9 +1056,16 @@ private:
|
||||||
mRealisticCombat.reset(new RealisticCombat::StateMachine(player));
|
mRealisticCombat.reset(new RealisticCombat::StateMachine(player));
|
||||||
bool enabled = !guiMode && mPlayer->getDrawState() == MWMechanics::DrawState_Weapon && !mPlayer->isDisabled();
|
bool enabled = !guiMode && mPlayer->getDrawState() == MWMechanics::DrawState_Weapon && !mPlayer->isDisabled();
|
||||||
mRealisticCombat->update(dt, enabled);
|
mRealisticCombat->update(dt, enabled);
|
||||||
}
|
};
|
||||||
|
|
||||||
updateHead();
|
updateHead();
|
||||||
|
|
||||||
|
// Update tracking every frame if player is not currently in GUI mode.
|
||||||
|
// This ensures certain widgets like Notifications will be visible.
|
||||||
|
if (!guiMode)
|
||||||
|
{
|
||||||
|
vrGuiManager->updateTracking();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenXRInputManager::processAction(const Action* action)
|
void OpenXRInputManager::processAction(const Action* action)
|
||||||
|
|
|
@ -580,15 +580,7 @@ void VRGUIManager::insertLayer(const std::string& name)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.trackingMode == TrackingMode::Menu)
|
if (config.trackingMode == TrackingMode::Menu)
|
||||||
{
|
|
||||||
// Update tracking when a menu is opened
|
|
||||||
// But don't automatically update it again until all menus have been closed
|
|
||||||
if (mVisibleMenus == 0)
|
|
||||||
updateTracking();
|
|
||||||
else
|
|
||||||
layer->updateTracking(mHeadPose);
|
layer->updateTracking(mHeadPose);
|
||||||
mVisibleMenus++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VRGUIManager::insertWidget(MWGui::Layout* widget)
|
void VRGUIManager::insertWidget(MWGui::Layout* widget)
|
||||||
|
@ -634,9 +626,6 @@ void VRGUIManager::removeLayer(const std::string& name)
|
||||||
if (it->second.get() == mFocusLayer)
|
if (it->second.get() == mFocusLayer)
|
||||||
setFocusLayer(nullptr);
|
setFocusLayer(nullptr);
|
||||||
|
|
||||||
if (it->second->mConfig.trackingMode == TrackingMode::Menu)
|
|
||||||
mVisibleMenus--;
|
|
||||||
|
|
||||||
mLayers.erase(it);
|
mLayers.erase(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,6 @@ namespace MWVR
|
||||||
std::map<std::string, std::shared_ptr<VRGUILayer>> mLayers;
|
std::map<std::string, std::shared_ptr<VRGUILayer>> mLayers;
|
||||||
std::vector<std::shared_ptr<VRGUILayer> > mSideBySideLayers;
|
std::vector<std::shared_ptr<VRGUILayer> > mSideBySideLayers;
|
||||||
|
|
||||||
int mVisibleMenus{ 0 };
|
|
||||||
Pose mHeadPose{};
|
Pose mHeadPose{};
|
||||||
osg::Vec2i mGuiCursor{};
|
osg::Vec2i mGuiCursor{};
|
||||||
VRGUILayer* mFocusLayer{ nullptr };
|
VRGUILayer* mFocusLayer{ nullptr };
|
||||||
|
|
Loading…
Reference in a new issue