diff options
Diffstat (limited to 'engines/titanic/game/pickup/pick_up_lemon.cpp')
-rw-r--r-- | engines/titanic/game/pickup/pick_up_lemon.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/engines/titanic/game/pickup/pick_up_lemon.cpp b/engines/titanic/game/pickup/pick_up_lemon.cpp index 772114f76c..5109c36304 100644 --- a/engines/titanic/game/pickup/pick_up_lemon.cpp +++ b/engines/titanic/game/pickup/pick_up_lemon.cpp @@ -21,9 +21,15 @@ */ #include "titanic/game/pickup/pick_up_lemon.h" +#include "titanic/core/project_item.h" namespace Titanic { +BEGIN_MESSAGE_MAP(CPickUpLemon, CPickUp) + ON_MESSAGE(MouseButtonDownMsg) + ON_MESSAGE(MouseDragStartMsg) +END_MESSAGE_MAP() + void CPickUpLemon::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); CPickUp::save(file, indent); @@ -34,4 +40,23 @@ void CPickUpLemon::load(SimpleFile *file) { CPickUp::load(file); } +bool CPickUpLemon::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + return true; +} + +bool CPickUpLemon::MouseDragStartMsg(CMouseDragStartMsg *msg) { + if (!checkStartDragging(msg)) + return true; + if (!_enabled) + return false; + + CVisibleMsg visibleMsg; + visibleMsg.execute("Lemon"); + CPassOnDragStartMsg passMsg(msg->_mousePos, 1); + passMsg.execute("Lemon"); + + msg->_dragItem = getRoot()->findByName("Lemon"); + return true; +} + } // End of namespace Titanic |