diff options
Diffstat (limited to 'engines/titanic/gfx')
-rw-r--r-- | engines/titanic/gfx/move_object_button.cpp | 15 | ||||
-rw-r--r-- | engines/titanic/gfx/move_object_button.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/engines/titanic/gfx/move_object_button.cpp b/engines/titanic/gfx/move_object_button.cpp index bdc90a673c..bcd2b2bd76 100644 --- a/engines/titanic/gfx/move_object_button.cpp +++ b/engines/titanic/gfx/move_object_button.cpp @@ -21,9 +21,14 @@ */ #include "titanic/gfx/move_object_button.h" +#include "titanic/core/project_item.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CMoveObjectButton, CSTButton) + ON_MESSAGE(MouseButtonUpMsg) +END_MESSAGE_MAP() + CMoveObjectButton::CMoveObjectButton() : CSTButton(), _field11C(1) { } @@ -43,4 +48,14 @@ void CMoveObjectButton::load(SimpleFile *file) { CSTButton::load(file); } +bool CMoveObjectButton::MouseButtonUpMsg(CMouseButtonUpMsg *msg) { + CGameObject *obj = dynamic_cast<CGameObject *>(getRoot()->findByName(_actionTarget)); + if (obj) { + obj->petAddToInventory(); + obj->setVisible(_field11C); + } + + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/gfx/move_object_button.h b/engines/titanic/gfx/move_object_button.h index eb2fdc4ff2..46c49c36e2 100644 --- a/engines/titanic/gfx/move_object_button.h +++ b/engines/titanic/gfx/move_object_button.h @@ -28,6 +28,8 @@ namespace Titanic { class CMoveObjectButton : public CSTButton { + DECLARE_MESSAGE_MAP; + bool MouseButtonUpMsg(CMouseButtonUpMsg *msg); private: Point _pos1; int _field11C; |