68 lines
2.0 KiB
C#
68 lines
2.0 KiB
C#
using ImGuiNET;
|
|
|
|
namespace Nerfed.Editor.Project
|
|
{
|
|
internal static class ProjectGui
|
|
{
|
|
private static string projectPath = 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 Path", ref projectPath, 512);
|
|
ImGui.InputText("Project Name", ref projectName, 512);
|
|
|
|
string newProjectFilePath = Path.Combine(projectPath, ".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.ProjectPath);
|
|
ImGui.Text(EditorProject.ProjectContentPath);
|
|
ImGui.Text(EditorProject.ProjectTempPath);
|
|
}
|
|
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();
|
|
}
|
|
}
|
|
} |