mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 16:15:31 +00:00
Check if onOpen/onClose reversed visibility change before forwarding it to the VR GUI Manager.
This commit is contained in:
parent
9e7df26f0f
commit
490d9e0086
1 changed files with 10 additions and 5 deletions
|
@ -62,11 +62,16 @@ void WindowBase::setVisible(bool visible)
|
|||
onClose();
|
||||
|
||||
#ifdef USE_OPENXR
|
||||
auto* vrGUIManager = MWVR::Environment::get().getGUIManager();
|
||||
if (!vrGUIManager)
|
||||
// May end up here before before rendering has been fully set up
|
||||
return;
|
||||
vrGUIManager->setVisible(this, visible);
|
||||
// Check that onOpen/onClose didn't reverse the change before forwarding it
|
||||
// to the VR GUI manager.
|
||||
if (this->isVisible() == visible)
|
||||
{
|
||||
auto* vrGUIManager = MWVR::Environment::get().getGUIManager();
|
||||
if (!vrGUIManager)
|
||||
// May end up here before before rendering has been fully set up
|
||||
return;
|
||||
vrGUIManager->setVisible(this, visible);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue