mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
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:
parent
ac592b2a54
commit
0e476dfd70
|
@ -5962,6 +5962,7 @@ void CEditor::Render()
|
|||
m_PopupEventWasActivated = true;
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue