Merge pull request #14 from antopilo/feature/NK-73-creating-new-project-doesnt-add-project-suffix
Creating New Project doesn't add .project
This commit is contained in:
@@ -1248,14 +1248,18 @@ namespace Nuake {
|
||||
|
||||
void NewProject()
|
||||
{
|
||||
if (Engine::GetProject())
|
||||
if (Engine::GetProject() && Engine::GetProject()->FileExist())
|
||||
Engine::GetProject()->Save();
|
||||
|
||||
|
||||
std::string selectedProject = FileDialog::SaveFile("Project file\0*.project");
|
||||
if (selectedProject == "") // Hit cancel
|
||||
|
||||
if(!String::EndsWith(selectedProject, ".project"))
|
||||
selectedProject += ".project";
|
||||
|
||||
if (selectedProject.empty()) // Hit cancel
|
||||
return;
|
||||
|
||||
Ref<Project> project = Project::New("Unnamed project", "no description", selectedProject + ".project");
|
||||
|
||||
Ref<Project> project = Project::New("Unnamed project", "no description", selectedProject);
|
||||
Engine::LoadProject(project);
|
||||
Engine::LoadScene(Scene::New());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user