From 6e5335a266afa82a4a2a64e8d2b8244b93dae200 Mon Sep 17 00:00:00 2001 From: Tleety Date: Fri, 19 Feb 2016 13:16:26 +0100 Subject: [PATCH] Release now return name and entity of the entity that was previously klicked. --- include/Engine/GUI/EButtonReleased.h | 1 + src/Engine/GUI/ButtonSystem.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/Engine/GUI/EButtonReleased.h b/include/Engine/GUI/EButtonReleased.h index 90170518..ecd8dde2 100644 --- a/include/Engine/GUI/EButtonReleased.h +++ b/include/Engine/GUI/EButtonReleased.h @@ -7,6 +7,7 @@ namespace Events { struct ButtonReleased : public Event { + std::string EntityName; EntityWrapper Entity; }; diff --git a/src/Engine/GUI/ButtonSystem.cpp b/src/Engine/GUI/ButtonSystem.cpp index 7c66e456..93ae1811 100644 --- a/src/Engine/GUI/ButtonSystem.cpp +++ b/src/Engine/GUI/ButtonSystem.cpp @@ -56,7 +56,8 @@ bool ButtonSystem::OnMouseRelease(const Events::MouseRelease& e) EntityWrapper ent = EntityWrapper(m_World, m_PickData.Entity); Events::ButtonReleased eReleased; - eReleased.Entity = ent; + eReleased.EntityName = m_PickEntity.Name(); + eReleased.Entity = m_PickEntity; m_EventBroker->Publish(eReleased); if(m_World->HasComponent(m_PickData.Entity, "Button")) {