diff options
-rw-r--r-- | engines/titanic/game/wheel_spin_horn.cpp | 27 | ||||
-rw-r--r-- | engines/titanic/game/wheel_spin_horn.h | 6 |
2 files changed, 27 insertions, 6 deletions
diff --git a/engines/titanic/game/wheel_spin_horn.cpp b/engines/titanic/game/wheel_spin_horn.cpp index b01cc678df..c299ffc8ff 100644 --- a/engines/titanic/game/wheel_spin_horn.cpp +++ b/engines/titanic/game/wheel_spin_horn.cpp @@ -24,20 +24,39 @@ namespace Titanic { +BEGIN_MESSAGE_MAP(CWheelSpinHorn, CWheelSpin) + ON_MESSAGE(MouseButtonDownMsg) +END_MESSAGE_MAP() + void CWheelSpinHorn::save(SimpleFile *file, int indent) { file->writeNumberLine(1, indent); - file->writeQuotedLine(_string1, indent); - file->writeQuotedLine(_string2, indent); + file->writeQuotedLine(_soundName, indent); + file->writeQuotedLine(_message, indent); CWheelSpin::save(file, indent); } void CWheelSpinHorn::load(SimpleFile *file) { file->readNumber(); - _string1 = file->readString(); - _string2 = file->readString(); + _soundName = file->readString(); + _message = file->readString(); CWheelSpin::load(file); } +bool CWheelSpinHorn::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { + if (_active) { + if (!_soundName.empty()) + playSound(_soundName); + + if (!_message.empty()) + petDisplayMessage(_message); + + CActMsg actMsg("Honk"); + actMsg.execute("CaptainsWheel"); + } + + return true; +} + } // End of namespace Titanic diff --git a/engines/titanic/game/wheel_spin_horn.h b/engines/titanic/game/wheel_spin_horn.h index 21182253b3..b8546b01b6 100644 --- a/engines/titanic/game/wheel_spin_horn.h +++ b/engines/titanic/game/wheel_spin_horn.h @@ -28,9 +28,11 @@ namespace Titanic { class CWheelSpinHorn : public CWheelSpin { + DECLARE_MESSAGE_MAP; + bool MouseButtonDownMsg(CMouseButtonDownMsg *msg); public: - CString _string1; - CString _string2; + CString _soundName; + CString _message; public: CLASSDEF; |