Refactor pass #3

This commit is contained in:
Antoine Pilote
2024-09-04 00:33:05 -04:00
parent db0ec40948
commit dc3c993962
6 changed files with 10 additions and 8 deletions

View File

@@ -598,7 +598,7 @@ namespace Nuake {
{
Engine::ExitPlayMode();
Engine::LoadScene(SceneSnapshot);
Engine::SetCurrentScene(SceneSnapshot);
Selection = EditorSelection();
SetStatusMessage("Ready");
}
@@ -2640,7 +2640,7 @@ namespace Nuake {
Ref<Project> project = Project::New(String::Split(fileName, '.')[0], "no description", finalPath);
Engine::LoadProject(project);
Engine::LoadScene(Scene::New());
Engine::SetCurrentScene(Scene::New());
Engine::GetCurrentWindow()->SetTitle("Nuake Engine - Editing " + project->Name);
}
@@ -2689,7 +2689,7 @@ namespace Nuake {
}
scene->Path = FileSystem::AbsoluteToRelative(projectPath);
Engine::LoadScene(scene);
Engine::SetCurrentScene(scene);
}
void EditorInterface::DrawMenuBar()
@@ -2735,7 +2735,7 @@ namespace Nuake {
ImGui::Separator();
if (ImGui::MenuItem("New scene"))
{
Engine::LoadScene(Scene::New());
Engine::SetCurrentScene(Scene::New());
Selection = EditorSelection();
SetStatusMessage("New scene created.");
}

View File

@@ -231,7 +231,7 @@ namespace Nuake
Nuake::FileSystem::SetRootDirectory(projectParentPath);
auto project = Nuake::Project::New(projectTitle, description, finalLocation);
Nuake::Engine::LoadProject(project);
Nuake::Engine::LoadScene(Nuake::Scene::New());
Nuake::Engine::SetCurrentScene(Nuake::Scene::New());
project->Settings.PrimaryColor = Nuake::Color(primaryColor.x, primaryColor.y, primaryColor.z, primaryColor.w);
project->Save();

View File

@@ -1,11 +1,13 @@
#include "TrenchbroomConfiguratorWindow.h"
#include <Engine.h>
#include <src/Resource/Project.h>
#include <src/UI/ImUI.h>
#include <src/Core/OS.h>
#include <src/Rendering/Textures/TextureManager.h>
#include <src/Resource/Prefab.h>
void TrenchbroomConfiguratorWindow::Update()
{

View File

@@ -309,7 +309,7 @@ namespace Nuake
// auto project = Project::New(String::Split(fileName, '.')[0], "no description", finalPath);
// Engine::LoadProject(project);
// Engine::LoadScene(Scene::New());
// Engine::SetCurrentScene(Scene::New());
// project->Save();
// auto projectPreview = ProjectPreview();

View File

@@ -24,7 +24,7 @@ Ref<Scene> SceneManager::GetScene(const UUID& uuid) const
return Ref<Scene>();
}
Ref<Scene> SceneManager::LoadScene(Ref<File> file)
Ref<Scene> SceneManager::SetCurrentScene(Ref<File> file)
{
return Ref<Scene>();

View File

@@ -19,7 +19,7 @@ namespace Nuake
bool IsSceneLoaded(const UUID& uuid) const;
Ref<Scene> GetScene(const UUID& uuid) const;
Ref<Scene> LoadScene(Ref<File> file);
Ref<Scene> SetCurrentScene(Ref<File> file);
void UnloadScene(const UUID& uuid);
private: