SDK/Entity: Add OnEntity[Disabled|Enabled] signals
This commit is contained in:
parent
c4b7534ac1
commit
c09b2d3747
|
|
@ -269,6 +269,7 @@ Nazara Development Kit:
|
||||||
- Added TextAreaWidget support for outline
|
- Added TextAreaWidget support for outline
|
||||||
- Fixed possible crash when disabling BaseWidget background
|
- Fixed possible crash when disabling BaseWidget background
|
||||||
- Added BaseWidget::OnMouseWheelMoved
|
- Added BaseWidget::OnMouseWheelMoved
|
||||||
|
- Added Entity::OnEntity[Disabled|Enabled] signals
|
||||||
|
|
||||||
# 0.4:
|
# 0.4:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,8 @@ namespace Ndk
|
||||||
Entity& operator=(Entity&&) = delete;
|
Entity& operator=(Entity&&) = delete;
|
||||||
|
|
||||||
NazaraSignal(OnEntityDestruction, Entity* /*entity*/);
|
NazaraSignal(OnEntityDestruction, Entity* /*entity*/);
|
||||||
|
NazaraSignal(OnEntityDisabled, Entity* /*entity*/);
|
||||||
|
NazaraSignal(OnEntityEnabled, Entity* /*entity*/);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Entity(World* world, EntityId id);
|
Entity(World* world, EntityId id);
|
||||||
|
|
|
||||||
|
|
@ -111,11 +111,15 @@ namespace Ndk
|
||||||
{
|
{
|
||||||
for (std::size_t i = m_componentBits.FindFirst(); i != m_componentBits.npos; i = m_componentBits.FindNext(i))
|
for (std::size_t i = m_componentBits.FindFirst(); i != m_componentBits.npos; i = m_componentBits.FindNext(i))
|
||||||
m_components[i]->OnEntityEnabled();
|
m_components[i]->OnEntityEnabled();
|
||||||
|
|
||||||
|
OnEntityEnabled(this);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (std::size_t i = m_componentBits.FindFirst(); i != m_componentBits.npos; i = m_componentBits.FindNext(i))
|
for (std::size_t i = m_componentBits.FindFirst(); i != m_componentBits.npos; i = m_componentBits.FindNext(i))
|
||||||
m_components[i]->OnEntityDisabled();
|
m_components[i]->OnEntityDisabled();
|
||||||
|
|
||||||
|
OnEntityDisabled(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Invalidate();
|
Invalidate();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue