| 3243 | } |
| 3244 | |
| 3245 | bool EditorInterface::LoadProject(const std::string& projectPath) |
| 3246 | { |
| 3247 | FileSystem::SetRootDirectory(FileSystem::GetParentPath(projectPath)); |
| 3248 | |
| 3249 | auto project = Project::New(); |
| 3250 | auto projectFileData = FileSystem::ReadFile(projectPath, true); |
| 3251 | Logger::Log("Reading file project: " + projectFileData, "window", VERBOSE); |
| 3252 | try |
| 3253 | { |
| 3254 | Logger::Log("Starting deserializing", "window", VERBOSE); |
| 3255 | project->Deserialize(json::parse(projectFileData)); |
| 3256 | project->FullPath = projectPath; |
| 3257 | |
| 3258 | Engine::LoadProject(project); |
| 3259 | |
| 3260 | filesystem->m_CurrentDirectory = Nuake::FileSystem::RootDirectory; |
| 3261 | } |
| 3262 | catch (std::exception exception) |
| 3263 | { |
| 3264 | Logger::Log("Error loading project: " + projectPath, "editor", CRITICAL); |
| 3265 | SetStatusMessage("Error loading project: " + projectPath); |
| 3266 | Logger::Log(exception.what()); |
| 3267 | return false; |
| 3268 | } |
| 3269 | |
| 3270 | return true; |
| 3271 | } |
| 3272 | |
| 3273 | } |
nothing calls this directly
no test coverage detected