diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index a84c4bbe7..b8205980f 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -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; diff --git a/src/game/editor/editor.h b/src/game/editor/editor.h index 5a1a6a71d..47fc71c41 100644 --- a/src/game/editor/editor.h +++ b/src/game/editor/editor.h @@ -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(); diff --git a/src/game/editor/popups.cpp b/src/game/editor/popups.cpp index 4819c1caf..a935276e5 100644 --- a/src/game/editor/popups.cpp +++ b/src/game/editor/popups.cpp @@ -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++)