| 91 | } |
| 92 | |
| 93 | void WelcomeWindow::LoadQueuedProject() |
| 94 | { |
| 95 | FileSystem::SetRootDirectory(FileSystem::GetParentPath(queuedProjectPath)); |
| 96 | auto project = Project::New(); |
| 97 | auto projectFileData = FileSystem::ReadFile(queuedProjectPath, true); |
| 98 | try |
| 99 | { |
| 100 | project->Deserialize(nlohmann::json::parse(projectFileData)); |
| 101 | project->FullPath = queuedProjectPath; |
| 102 | |
| 103 | Engine::LoadProject(project); |
| 104 | |
| 105 | _Editor->filesystem->m_CurrentDirectory = Nuake::FileSystem::RootDirectory; |
| 106 | } |
| 107 | catch (std::exception exception) |
| 108 | { |
| 109 | Logger::Log("Error loading project: " + queuedProjectPath, "editor", CRITICAL); |
| 110 | Logger::Log(exception.what()); |
| 111 | return; |
| 112 | } |
| 113 | |
| 114 | queuedProjectPath = ""; |
| 115 | Engine::GetCurrentWindow()->SetTitle("Nuake Engine - Editing " + project->Name); |
| 116 | } |
| 117 | |
| 118 | void WelcomeWindow::ImportProject(const std::string& file) |
| 119 | { |
no test coverage detected