From d696b673788e84497eda7b26697590760cf62640 Mon Sep 17 00:00:00 2001 From: antopilo Date: Fri, 3 Mar 2023 12:38:10 -0500 Subject: [PATCH] Fixed not being able to boot into project manager --- Editor/Editor.cpp | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/Editor/Editor.cpp b/Editor/Editor.cpp index b047563a..4b6d67ad 100644 --- a/Editor/Editor.cpp +++ b/Editor/Editor.cpp @@ -105,24 +105,28 @@ int main(int argc, char* argv[]) GizmoDrawer gizmoDrawer = GizmoDrawer(); - FileSystem::SetRootDirectory(projectPath + "/../"); - - auto project = Project::New(); - auto projectFileData = FileSystem::ReadFile(projectPath, true); - try + if (shouldLoadProject) { - project->Deserialize(projectFileData); - project->FullPath = projectPath; + FileSystem::SetRootDirectory(projectPath + "/../"); - Engine::LoadProject(project); + auto project = Project::New(); + auto projectFileData = FileSystem::ReadFile(projectPath, true); + try + { + project->Deserialize(projectFileData); + project->FullPath = projectPath; - editor.filesystem->m_CurrentDirectory = Nuake::FileSystem::RootDirectory; - } - catch (std::exception exception) - { - Logger::Log("Error loading project: " + projectPath, CRITICAL); - Logger::Log(exception.what()); + Engine::LoadProject(project); + + editor.filesystem->m_CurrentDirectory = Nuake::FileSystem::RootDirectory; + } + catch (std::exception exception) + { + Logger::Log("Error loading project: " + projectPath, CRITICAL); + Logger::Log(exception.what()); + } } + while (!window->ShouldClose()) { Nuake::Engine::Tick();