Editor entity naming

This commit is contained in:
2016-01-19 11:42:26 +01:00
parent b62e42567c
commit 68af853a03
4 changed files with 37 additions and 1 deletions
+6
View File
@@ -26,6 +26,7 @@ EditorSystem::EditorSystem(World* world, EventBroker* eventBroker, IRenderer* re
m_EditorGUI->SetEntityCreateCallback(std::bind(&EditorSystem::OnEntityCreate, this, std::placeholders::_1));
m_EditorGUI->SetEntityDeleteCallback(std::bind(&EditorSystem::OnEntityDelete, this, std::placeholders::_1));
m_EditorGUI->SetEntityChangeParentCallback(std::bind(&EditorSystem::OnEntityChangeParent, this, std::placeholders::_1, std::placeholders::_2));
m_EditorGUI->SetEntityChangeNameCallback(std::bind(&EditorSystem::OnEntityChangeName, this, std::placeholders::_1, std::placeholders::_2));
m_EditorGUI->SetComponentAttachCallback(std::bind(&EditorSystem::OnComponentAttach, this, std::placeholders::_1, std::placeholders::_2));
m_EditorGUI->SetComponentDeleteCallback(std::bind(&EditorSystem::OnComponentDelete, this, std::placeholders::_1, std::placeholders::_2));
@@ -85,6 +86,11 @@ void EditorSystem::OnEntityChangeParent(EntityWrapper entity, EntityWrapper pare
entity.World->SetParent(entity.ID, parent.ID);
}
void EditorSystem::OnEntityChangeName(EntityWrapper entity, const std::string& name)
{
entity.World->SetName(entity.ID, name);
}
void EditorSystem::OnComponentAttach(EntityWrapper entity, const std::string& componentType)
{
entity.World->AttachComponent(entity.ID, componentType);