aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/game/search_point.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-27 20:44:44 -0400
committerPaul Gilbert2016-08-27 20:44:44 -0400
commit67be58f56204d6662a56f902b0a0f017c176b643 (patch)
tree9a95bf73bdc01556734064ca8afd1c30cbcd51dd /engines/titanic/game/search_point.cpp
parent311006c84cd85897cb9c536e948bc6f5d36b3805 (diff)
downloadscummvm-rg350-67be58f56204d6662a56f902b0a0f017c176b643.tar.gz
scummvm-rg350-67be58f56204d6662a56f902b0a0f017c176b643.tar.bz2
scummvm-rg350-67be58f56204d6662a56f902b0a0f017c176b643.zip
TITANIC: Implemented more game classes, fleshed out season handling
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