| 2237 | |
| 2238 | ProjectInterface pInterface; |
| 2239 | void OpenProject() |
| 2240 | { |
| 2241 | // Parse the project and load it. |
| 2242 | std::string projectPath = FileDialog::OpenFile("Project file\0*.project"); |
| 2243 | |
| 2244 | if (projectPath == "") // Hit cancel. |
| 2245 | return; |
| 2246 | |
| 2247 | FileSystem::SetRootDirectory(FileSystem::GetParentPath(projectPath)); |
| 2248 | Ref<Project> project = Project::New(); |
| 2249 | if (!project->Deserialize(json::parse(FileSystem::ReadFile(projectPath, true)))) |
| 2250 | { |
| 2251 | Logger::Log("Error loading project: " + projectPath, "editor", CRITICAL); |
| 2252 | return; |
| 2253 | } |
| 2254 | |
| 2255 | project->FullPath = projectPath; |
| 2256 | Engine::LoadProject(project); |
| 2257 | |
| 2258 | pInterface.m_CurrentProject = project; |
| 2259 | |
| 2260 | Engine::GetCurrentWindow()->SetTitle("Nuake Engine - Editing " + project->Name); |
| 2261 | } |
| 2262 | |
| 2263 | void OpenScene() |
| 2264 | { |
no test coverage detected