diff options
author | Paul Gilbert | 2016-08-18 22:45:58 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-18 22:45:58 -0400 |
commit | dc91d30b76ded7ed7a648a0b0b43d8fe99c00cf6 (patch) | |
tree | 12e445180f88ffdd5f9ad0a200f1b9c39faa6180 /engines/titanic/core | |
parent | df5f78037cc33fb63bdb5233a8ed378db77d9832 (diff) | |
download | scummvm-rg350-dc91d30b76ded7ed7a648a0b0b43d8fe99c00cf6.tar.gz scummvm-rg350-dc91d30b76ded7ed7a648a0b0b43d8fe99c00cf6.tar.bz2 scummvm-rg350-dc91d30b76ded7ed7a648a0b0b43d8fe99c00cf6.zip |
TITANIC: Implementing game classes
Diffstat (limited to 'engines/titanic/core')
-rw-r--r-- | engines/titanic/core/click_responder.cpp | 21 | ||||
-rw-r--r-- | engines/titanic/core/click_responder.h | 4 |
2 files changed, 20 insertions, 5 deletions
diff --git a/engines/titanic/core/click_responder.cpp b/engines/titanic/core/click_responder.cpp index f9694557df..9a0e0de7ab 100644 --- a/engines/titanic/core/click_responder.cpp +++ b/engines/titanic/core/click_responder.cpp @@ -24,20 +24,33 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CClickResponder, CGameObject) + ON_MESSAGE(MouseButtonDownMsg) +END_MESSAGE_MAP() + void CClickResponder::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeQuotedLine(_string1, indent); - file->writeQuotedLine(_string2, indent); + file->writeQuotedLine(_message, indent); + file->writeQuotedLine(_soundName, indent); CGameObject::save(file, indent); } void CClickResponder::load(SimpleFile *file) { file->readNumber(); - _string1 = file->readString(); - _string2 = file->readString(); + _message = file->readString(); + _soundName = file->readString(); CGameObject::load(file); } +bool CClickResponder::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + if (!_soundName.empty()) + playSound(_soundName); + if (!_message.empty()) + petDisplayMessage(_message); + + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/core/click_responder.h b/engines/titanic/core/click_responder.h index 78381b9948..40f22d7906 100644 --- a/engines/titanic/core/click_responder.h +++ b/engines/titanic/core/click_responder.h @@ -28,8 +28,10 @@ namespace Titanic { class CClickResponder : public CGameObject { + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); protected: - CString _string1, _string2; + CString _message, _soundName; public: CLASSDEF; |