-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
115 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using ImGuiNET; | ||
|
||
namespace Pulsar4X.SDL2UI.ModFileEditing; | ||
|
||
public static class FileDialog | ||
{ | ||
public enum SaveOrLoad | ||
{ | ||
Save, | ||
Load | ||
} | ||
private static byte[] _strInputBuffer = new byte[128]; | ||
private static string _pathString; | ||
|
||
public static SaveOrLoad DialogType = SaveOrLoad.Save; | ||
|
||
public static void Display(string path) | ||
{ | ||
_pathString = path; | ||
ImGui.Begin("File Dialog"); | ||
ImGui.Text("Name:"); | ||
ImGui.SameLine(); | ||
ImGui.InputText("##Name", _strInputBuffer, 128); | ||
|
||
ImGui.Columns(2); | ||
ImGui.SetColumnWidth(0,128); | ||
|
||
ImGui.NextColumn(); | ||
|
||
ImGui.BeginTable("", 4); | ||
|
||
ImGui.TableHeader("Name"); | ||
ImGui.TableNextColumn(); | ||
ImGui.TableHeader("Size"); | ||
ImGui.TableNextColumn(); | ||
ImGui.TableHeader("Type"); | ||
ImGui.TableNextColumn(); | ||
ImGui.TableHeader("Modified"); | ||
ImGui.TableNextColumn(); | ||
|
||
var files = System.IO.Directory.EnumerateFiles(_pathString); | ||
foreach (var file in files) | ||
{ | ||
|
||
} | ||
|
||
ImGui.EndTable(); | ||
|
||
|
||
ImGui.End(); | ||
} | ||
} |