Nerfed/Nerfed.Editor/Project/ProjectGui.cs
2024-07-24 23:53:37 +02:00

67 lines
1.8 KiB
C#

using ImGuiNET;
namespace Nerfed.Editor.Project;
internal static class ProjectGui
{
private static string projectDirectory = string.Empty;
private static string projectName = string.Empty;
private static string projectFilePath = string.Empty;
internal static void OnGui()
{
ImGui.Begin("Project");
ImGui.BeginGroup();
ImGui.InputText("Project Directory", ref projectDirectory, 512);
ImGui.InputText("Project Name", ref projectName, 512);
string newProjectFilePath = Path.Combine(projectDirectory, ".project");
ImGui.Text(newProjectFilePath);
if (ImGui.Button("Create Project"))
{
EditorProject.Create(newProjectFilePath, projectName);
}
ImGui.EndGroup();
ImGui.BeginGroup();
ImGui.InputText("Project File Path", ref projectFilePath, 512);
if (ImGui.Button("Open Project"))
{
EditorProject.Open(projectFilePath);
}
ImGui.Text("Loaded project: ");
if(EditorProject.Project != null)
{
ImGui.Text(EditorProject.Project.Name);
ImGui.Text(EditorProject.ProjectFilePath);
ImGui.Text(EditorProject.ProjectSolutionFilePath);
ImGui.Text(EditorProject.ProjectDirectory);
ImGui.Text(EditorProject.ProjectContentDirectory);
ImGui.Text(EditorProject.ProjectTempDirectory);
}
else
{
ImGui.Text("None");
}
ImGui.EndGroup();
ImGui.BeginGroup();
if (ImGui.Button("Generate Solution"))
{
EditorProject.GenerateSolution();
}
if (ImGui.Button("Compile"))
{
EditorProject.Compile();
}
ImGui.EndGroup();
ImGui.End();
}
}