aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game/search_point.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/game/search_point.cpp')
-rw-r--r--engines/titanic/game/search_point.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/engines/titanic/game/search_point.cpp b/engines/titanic/game/search_point.cpp
index f60a3132b7..bbe923267a 100644
--- a/engines/titanic/game/search_point.cpp
+++ b/engines/titanic/game/search_point.cpp
@@ -24,6 +24,10 @@
namespace Titanic {
+BEGIN_MESSAGE_MAP(CSearchPoint, CGameObject)
+ ON_MESSAGE(MouseButtonDownMsg)
+END_MESSAGE_MAP()
+
void CSearchPoint::save(SimpleFile *file, int indent) {
file->writeNumberLine(1, indent);
file->writeNumberLine(_value, indent);
@@ -36,4 +40,21 @@ void CSearchPoint::load(SimpleFile *file) {
CGameObject::load(file);
}
+bool CSearchPoint::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
+ if (_value > 0) {
+ CGameObject *child = dynamic_cast<CGameObject *>(getFirstChild());
+ if (child) {
+ child->petAddToInventory();
+ CVisibleMsg visibleMsg(true);
+ visibleMsg.execute(child->getName());
+ playSound("z#47.wav");
+ }
+
+ if (--_value == 0)
+ _cursorId = CURSOR_ARROW;
+ }
+
+ return true;
+}
+
} // End of namespace Titanic