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

Function OpenProject

Editor/Source/Editor/Windows/EditorInterface.cpp:2239–2261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

DrawMenuBarMethod · 0.85

Calls 5

parseFunction · 0.85
LogFunction · 0.85
GetCurrentWindowFunction · 0.85
DeserializeMethod · 0.45
SetTitleMethod · 0.45

Tested by

no test coverage detected