mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 06:28:19 +00:00
Close editor popups when opening file dialog
As the popups would render above the file dialog, they should be closed before opening it.
This commit is contained in:
parent
db08cc01cd
commit
ac592b2a54
|
@ -4667,6 +4667,7 @@ void CEditor::InvokeFileDialog(int StorageType, int FileType, const char *pTitle
|
|||
const char *pBasePath, const char *pDefaultName,
|
||||
void (*pfnFunc)(const char *pFileName, int StorageType, void *pUser), void *pUser)
|
||||
{
|
||||
UiClosePopupMenus();
|
||||
m_FileDialogStorageType = StorageType;
|
||||
m_pFileDialogTitle = pTitle;
|
||||
m_pFileDialogButtonText = pButtonText;
|
||||
|
|
|
@ -1096,6 +1096,7 @@ public:
|
|||
|
||||
void UiInvokePopupMenu(void *pID, int Flags, float X, float Y, float W, float H, int (*pfnFunc)(CEditor *pEditor, CUIRect Rect, void *pContext), void *pContext = nullptr);
|
||||
void UiDoPopupMenu();
|
||||
void UiClosePopupMenus();
|
||||
bool UiPopupExists(void *pID);
|
||||
bool UiPopupOpen();
|
||||
|
||||
|
|
|
@ -104,6 +104,14 @@ void CEditor::UiDoPopupMenu()
|
|||
}
|
||||
}
|
||||
|
||||
void CEditor::UiClosePopupMenus()
|
||||
{
|
||||
m_LockMouse = false;
|
||||
UI()->SetActiveItem(nullptr);
|
||||
g_UiNumPopups = 0;
|
||||
m_PopupEventWasActivated = false;
|
||||
}
|
||||
|
||||
bool CEditor::UiPopupExists(void *pid)
|
||||
{
|
||||
for(int i = 0; i < g_UiNumPopups; i++)
|
||||
|
|
Loading…
Reference in a new issue