When opening a project without any default scene, open a new one on project load
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user