When opening a project without any default scene, open a new one on project load

This commit is contained in:
antopilo
2025-02-02 13:47:25 -05:00
parent 5cc18788f7
commit b10e437e35
2 changed files with 16 additions and 1 deletions

View File

@@ -2166,6 +2166,13 @@ namespace Nuake {
prefabEditors.push_back(CreateRef<PrefabEditorWindow>(newPrefab));
}
void EditorInterface::OpenSceneWindow(Ref<Scene> scene)
{
Ref<SceneEditorWindow> sceneEditor = CreateRef<SceneEditorWindow>(scene);
sceneEditor->DockTo(SceneEditorDockspaceNodeID);
sceneEditors.push_back(sceneEditor);
}
void EditorInterface::OpenSceneWindow(const std::string& scenePath)
{
if (!FileSystem::FileExists(scenePath))
@@ -2548,7 +2555,14 @@ namespace Nuake {
_WelcomeWindow->LoadQueuedProject();
auto project = Engine::GetProject();
OpenSceneWindow(project->DefaultScene->Path);
auto sceneToLoad = project->DefaultScene;
if (!sceneToLoad)
{
sceneToLoad = CreateRef<Scene>();
}
OpenSceneWindow(sceneToLoad);
isLoadingProjectQueue = false;

View File

@@ -131,6 +131,7 @@ namespace Nuake
void OnRequestCloseEditorWindow(std::string windowName);
void OpenPrefabWindow(const std::string& prefabPath);
void OpenSceneWindow(Ref<Scene> scene);
void OpenSceneWindow(const std::string& scenePath);
bool ShouldDrawAxis() const { return m_DrawAxis; }