| 2261 | } |
| 2262 | |
| 2263 | void OpenScene() |
| 2264 | { |
| 2265 | // Parse the project and load it. |
| 2266 | std::string projectPath = FileDialog::OpenFile(".scene"); |
| 2267 | if (projectPath.empty() || !FileSystem::FileExists(projectPath, true)) |
| 2268 | { |
| 2269 | return; |
| 2270 | } |
| 2271 | |
| 2272 | Ref<Scene> scene = Scene::New(); |
| 2273 | const std::string& fileContent = FileSystem::ReadFile(projectPath, true); |
| 2274 | if (!scene->Deserialize(json::parse(fileContent))) |
| 2275 | { |
| 2276 | Logger::Log("Error failed loading scene: " + projectPath, "editor", CRITICAL); |
| 2277 | return; |
| 2278 | } |
| 2279 | |
| 2280 | scene->Path = FileSystem::AbsoluteToRelative(projectPath); |
| 2281 | Engine::SetCurrentScene(scene); |
| 2282 | } |
| 2283 | |
| 2284 | void EditorInterface::DrawMenuBar() |
| 2285 | { |
no test coverage detected