When GUI inactive, unlock mouse and don't render popup menus

When the GUI is deactivated by pressing Tab, the popup menus were still rendered, which they shouldn't be, because they belong to the GUI.

The mouse needs to be unlocked when deactivating the GUI, because it can otherwise not be moved while the GUI is inactive.
This commit is contained in:
Robert Müller 2022-12-22 23:13:15 +01:00
parent ac592b2a54
commit 0e476dfd70

View file

@ -5962,7 +5962,8 @@ void CEditor::Render()
m_PopupEventWasActivated = true;
}
UiDoPopupMenu();
if(m_GuiActive)
UiDoPopupMenu();
if(m_Dialog == DIALOG_NONE && !m_MouseInsidePopup && UI()->MouseInside(&View))
{
@ -6469,7 +6470,11 @@ void CEditor::OnRender()
{
// toggle gui
if(Input()->KeyPress(KEY_TAB))
{
m_GuiActive = !m_GuiActive;
if(!m_GuiActive)
m_LockMouse = false;
}
if(Input()->KeyPress(KEY_F10))
m_ShowMousePointer = false;