Nerfed/Nerfed.Editor/Project/EditorProjectGui.cs

67 lines
1.8 KiB
C#
Raw Normal View History

2024-07-19 15:24:50 +02:00
using ImGuiNET;
2024-07-24 23:53:37 +02:00
namespace Nerfed.Editor.Project;
2024-07-19 15:24:50 +02:00
2024-07-25 22:58:07 +02:00
internal static class EditorProjectGui
2024-07-24 23:53:37 +02:00
{
private static string projectDirectory = string.Empty;
private static string projectName = string.Empty;
private static string projectFilePath = string.Empty;
2024-07-19 15:24:50 +02:00
2024-07-24 23:53:37 +02:00
internal static void OnGui()
{
ImGui.Begin("Project");
ImGui.BeginGroup();
2024-07-19 15:24:50 +02:00
2024-07-24 23:53:37 +02:00
ImGui.InputText("Project Directory", ref projectDirectory, 512);
ImGui.InputText("Project Name", ref projectName, 512);
2024-07-21 14:03:40 +02:00
2024-07-24 23:53:37 +02:00
string newProjectFilePath = Path.Combine(projectDirectory, ".project");
ImGui.Text(newProjectFilePath);
2024-07-19 15:24:50 +02:00
2024-07-24 23:53:37 +02:00
if (ImGui.Button("Create Project"))
{
EditorProject.Create(newProjectFilePath, projectName);
}
2024-07-21 14:03:40 +02:00
2024-07-24 23:53:37 +02:00
ImGui.EndGroup();
ImGui.BeginGroup();
2024-07-19 15:24:50 +02:00
2024-07-24 23:53:37 +02:00
ImGui.InputText("Project File Path", ref projectFilePath, 512);
if (ImGui.Button("Open Project"))
{
EditorProject.Open(projectFilePath);
}
2024-07-19 15:24:50 +02:00
2024-07-24 23:53:37 +02:00
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");
}
2024-07-21 14:03:40 +02:00
2024-07-24 23:53:37 +02:00
ImGui.EndGroup();
ImGui.BeginGroup();
2024-07-21 14:03:40 +02:00
2024-07-24 23:53:37 +02:00
if (ImGui.Button("Generate Solution"))
{
EditorProject.GenerateSolution();
}
2024-07-21 14:03:40 +02:00
2024-07-24 23:53:37 +02:00
if (ImGui.Button("Compile"))
{
EditorProject.Compile();
2024-07-19 15:24:50 +02:00
}
2024-07-24 23:53:37 +02:00
ImGui.EndGroup();
ImGui.End();
2024-07-19 15:24:50 +02:00
}
}