diff --git a/TODO.md b/TODO.md index 09f794ab7..18c43c49d 100644 --- a/TODO.md +++ b/TODO.md @@ -13,7 +13,6 @@ - maybe YMU759 ADPCM channel - ADPCM chips - more effects for FM param control -- store system presets in new file - Game Boy envelope macro/sequence - option to display chip names instead of "multi-system" on title bar - rewrite the system name detection function anyway diff --git a/src/gui/fileDialog.cpp b/src/gui/fileDialog.cpp index 3b8fdd46a..e50298c1a 100644 --- a/src/gui/fileDialog.cpp +++ b/src/gui/fileDialog.cpp @@ -95,6 +95,10 @@ bool FurnaceGUIFileDialog::render(const ImVec2& min, const ImVec2& max) { } } +bool FurnaceGUIFileDialog::isOpen() { + return opened; +} + String FurnaceGUIFileDialog::getPath() { if (sysDialog) { if (curPath.size()>1) { diff --git a/src/gui/fileDialog.h b/src/gui/fileDialog.h index 8d3ff787a..5eb67d853 100644 --- a/src/gui/fileDialog.h +++ b/src/gui/fileDialog.h @@ -24,6 +24,7 @@ class FurnaceGUIFileDialog { bool accepted(); void close(); bool render(const ImVec2& min, const ImVec2& max); + bool isOpen(); String getPath(); String getFileName(); explicit FurnaceGUIFileDialog(bool system): diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 932a7f81b..dd37ceae1 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -2882,6 +2882,19 @@ bool FurnaceGUI::loop() { #endif } + if (fileDialog->isOpen() && settings.sysFileDialog) { + ImGui::OpenPopup("System File Dialog Pending"); + } + + if (ImGui::BeginPopupModal("System File Dialog Pending",NULL,ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoBackground|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoMove)) { + if (!fileDialog->isOpen()) { + ImGui::CloseCurrentPopup(); + } + ImDrawList* dl=ImGui::GetForegroundDrawList(); + dl->AddRectFilled(ImVec2(0.0f,0.0f),ImVec2(scrW*dpiScale,scrH*dpiScale),ImGui::ColorConvertFloat4ToU32(uiColors[GUI_COLOR_MODAL_BACKDROP])); + ImGui::EndPopup(); + } + if (fileDialog->render(ImVec2(600.0f*dpiScale,400.0f*dpiScale),ImVec2(scrW*dpiScale,scrH*dpiScale))) { bool openOpen=false; //ImGui::GetIO().ConfigFlags&=~ImGuiConfigFlags_NavEnableKeyboard;