diff --git a/Editor/src/Windows/EditorInterface.cpp b/Editor/src/Windows/EditorInterface.cpp index ecff9d88..67ec3268 100644 --- a/Editor/src/Windows/EditorInterface.cpp +++ b/Editor/src/Windows/EditorInterface.cpp @@ -1258,10 +1258,27 @@ namespace Nuake { if (selectedProject.empty()) // Hit cancel return; + + auto backslashSplits = String::Split(selectedProject, '\\'); + auto fileName = backslashSplits[backslashSplits.size() - 1]; + + std::string finalPath = String::Split(selectedProject, '.')[0]; - Ref project = Project::New("Unnamed project", "no description", selectedProject); + // We need to create a folder + if (const auto& dirPath = finalPath; + !std::filesystem::create_directory(dirPath)) + { + // Should we continue? + Logger::Log("Failed creating project directory: " + dirPath); + } + + finalPath += "\\" + fileName; + + Ref project = Project::New(String::Split(fileName, '.')[0], "no description", finalPath); Engine::LoadProject(project); Engine::LoadScene(Scene::New()); + + Engine::GetCurrentWindow()->SetTitle("Nuake Engine - Editing " + project->Name); }