| 495 | return true; |
| 496 | } |
| 497 | bool FileDialog::IsDone(const std::string& key) |
| 498 | { |
| 499 | bool isMe = m_currentKey == key; |
| 500 | |
| 501 | if (isMe && m_isOpen) { |
| 502 | if (!m_calledOpenPopup) { |
| 503 | ImGui::SetNextWindowSize(ImVec2(600, 400), ImGuiCond_FirstUseEver); |
| 504 | ImGui::OpenPopup(m_currentTitle.c_str()); |
| 505 | m_calledOpenPopup = true; |
| 506 | } |
| 507 | |
| 508 | if (ImGui::BeginPopupModal(m_currentTitle.c_str(), &m_isOpen, ImGuiWindowFlags_NoScrollbar)) { |
| 509 | m_renderFileDialog(); |
| 510 | ImGui::EndPopup(); |
| 511 | } |
| 512 | else m_isOpen = false; |
| 513 | } |
| 514 | |
| 515 | return isMe && !m_isOpen; |
| 516 | } |
| 517 | void FileDialog::Close() |
| 518 | { |
| 519 | m_currentKey.clear(); |