renaming OnWorldChanged to OnLevelChanged and invoking callback
This commit is contained in:
parent
46fe2d296b
commit
7e01282973
|
|
@ -18,7 +18,7 @@ namespace Nz
|
||||||
: public Nz::Application<Nz::Graphics, Nz::Imgui, Nz::EditorCore>
|
: public Nz::Application<Nz::Graphics, Nz::Imgui, Nz::EditorCore>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NazaraSignal(OnWorldChanged, Nz::Level&);
|
NazaraSignal(OnLevelChanged, Nz::Level&);
|
||||||
|
|
||||||
// Entity lifetime events
|
// Entity lifetime events
|
||||||
NazaraSignal(OnEntityCreated, entt::handle);
|
NazaraSignal(OnEntityCreated, entt::handle);
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,11 @@ namespace Nz
|
||||||
|
|
||||||
bool EditorBaseApplication::NewLevel()
|
bool EditorBaseApplication::NewLevel()
|
||||||
{
|
{
|
||||||
return m_level.CreateNewLevel();
|
bool bRes = m_level.CreateNewLevel();
|
||||||
|
if (bRes)
|
||||||
|
{
|
||||||
|
OnLevelChanged(m_level);
|
||||||
|
}
|
||||||
|
return bRes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -9,7 +9,7 @@ namespace NzEditor
|
||||||
, m_currentLevel(app->GetLevel())
|
, m_currentLevel(app->GetLevel())
|
||||||
, m_dirty(true)
|
, 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->OnEntityCreated.Connect([this](entt::handle) { m_dirty = true; });
|
||||||
app->OnEntityDestroyed.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; });
|
app->OnEntityParentChanged.Connect([this](entt::handle) { m_dirty = true; });
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue