diff --git a/include/NazaraEditor/Core/Application/BaseApplication.hpp b/include/NazaraEditor/Core/Application/BaseApplication.hpp index eaa15e8..49b4e36 100644 --- a/include/NazaraEditor/Core/Application/BaseApplication.hpp +++ b/include/NazaraEditor/Core/Application/BaseApplication.hpp @@ -18,7 +18,7 @@ namespace Nz : public Nz::Application { public: - NazaraSignal(OnWorldChanged, Nz::Level&); + NazaraSignal(OnLevelChanged, Nz::Level&); // Entity lifetime events NazaraSignal(OnEntityCreated, entt::handle); diff --git a/src/NazaraEditor/Core/Application/BaseApplication.cpp b/src/NazaraEditor/Core/Application/BaseApplication.cpp index dc41d78..dab2efd 100644 --- a/src/NazaraEditor/Core/Application/BaseApplication.cpp +++ b/src/NazaraEditor/Core/Application/BaseApplication.cpp @@ -61,6 +61,11 @@ namespace Nz bool EditorBaseApplication::NewLevel() { - return m_level.CreateNewLevel(); + bool bRes = m_level.CreateNewLevel(); + if (bRes) + { + OnLevelChanged(m_level); + } + return bRes; } } \ No newline at end of file diff --git a/src/NazaraEditor/Editor/UI/LevelWindow.cpp b/src/NazaraEditor/Editor/UI/LevelWindow.cpp index 5bb33df..dca33a8 100644 --- a/src/NazaraEditor/Editor/UI/LevelWindow.cpp +++ b/src/NazaraEditor/Editor/UI/LevelWindow.cpp @@ -9,7 +9,7 @@ namespace NzEditor , m_currentLevel(app->GetLevel()) , m_dirty(true) { - app->OnWorldChanged.Connect([this](Nz::Level&) { m_dirty = true; }); + app->OnLevelChanged.Connect([this](Nz::Level&) { m_dirty = true; }); app->OnEntityCreated.Connect([this](entt::handle) { m_dirty = true; }); app->OnEntityDestroyed.Connect([this](entt::handle) { m_dirty = true; }); app->OnEntityParentChanged.Connect([this](entt::handle) { m_dirty = true; });