MCPcopy Create free account
hub / github.com/antopilo/Nuake / OpenScene

Function OpenScene

Editor/Source/Editor/Windows/EditorInterface.cpp:2263–2282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 2

DrawMenuBarMethod · 0.85
DrawMethod · 0.85

Calls 4

parseFunction · 0.85
LogFunction · 0.85
emptyMethod · 0.45
DeserializeMethod · 0.45

Tested by

no test coverage detected