feat: add editor project switching workflow
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "SceneManager.h"
|
||||
#include "Core/EventBus.h"
|
||||
#include "Core/EditorEvents.h"
|
||||
#include "Utils/ProjectFileUtils.h"
|
||||
#include <XCEngine/Components/ComponentFactoryRegistry.h>
|
||||
#include <XCEngine/Components/CameraComponent.h>
|
||||
#include <XCEngine/Components/LightComponent.h>
|
||||
@@ -387,6 +388,14 @@ std::string SceneManager::GetScenesDirectory(const std::string& projectPath) {
|
||||
std::string SceneManager::ResolveDefaultScenePath(const std::string& projectPath) {
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
if (const auto descriptor = ProjectFileUtils::LoadProjectDescriptor(projectPath)) {
|
||||
const std::string configuredScenePath =
|
||||
ProjectFileUtils::ResolveProjectPath(projectPath, descriptor->startupScene);
|
||||
if (IsSceneFileUsable(configuredScenePath)) {
|
||||
return configuredScenePath;
|
||||
}
|
||||
}
|
||||
|
||||
const fs::path scenesDir = GetScenesDirectory(projectPath);
|
||||
const fs::path mainXC = scenesDir / "Main.xc";
|
||||
if (fs::exists(mainXC)) {
|
||||
|
||||
Reference in New Issue
Block a user