mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
Merge pull request #590 from MgAl2O4/fix-fileDialogImgui
fixed asserts on closing imgui file dialog
This commit is contained in:
commit
886c088dec
1 changed files with 24 additions and 21 deletions
|
|
@ -50,14 +50,16 @@ namespace Dalamud.Interface.ImGuiFileDialog
|
|||
windowVisible = ImGui.Begin(name, ref this.visible, ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoNav);
|
||||
}
|
||||
|
||||
bool wasClosed = false;
|
||||
if (windowVisible)
|
||||
{
|
||||
if (!this.visible)
|
||||
{ // window closed
|
||||
this.isOk = false;
|
||||
return true;
|
||||
wasClosed = true;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (this.selectedFilter.Empty() && (this.filters.Count > 0))
|
||||
{
|
||||
this.selectedFilter = this.filters[0];
|
||||
|
|
@ -81,6 +83,7 @@ namespace Dalamud.Interface.ImGuiFileDialog
|
|||
this.DrawHeader();
|
||||
this.DrawContent();
|
||||
res = this.DrawFooter();
|
||||
}
|
||||
|
||||
if (this.isModal && !this.okResultToConfirm)
|
||||
{
|
||||
|
|
@ -93,7 +96,7 @@ namespace Dalamud.Interface.ImGuiFileDialog
|
|||
ImGui.End();
|
||||
}
|
||||
|
||||
return this.ConfirmOrOpenOverWriteFileDialogIfNeeded(res);
|
||||
return wasClosed || this.ConfirmOrOpenOverWriteFileDialogIfNeeded(res);
|
||||
}
|
||||
|
||||
private static void AddToIconMap(string[] extensions, char icon, Vector4 color)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue