diff options
author | Paul Gilbert | 2017-02-20 21:49:53 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-02-20 21:49:53 -0500 |
commit | 75571a80fd78065a7765903f457769fa9fdd4748 (patch) | |
tree | f0f787fca29f77cbb7547836f618259e13293b2b /engines/titanic/game | |
parent | 90e4e8a06403dc54b862cc08676718a29fdf6f94 (diff) | |
download | scummvm-rg350-75571a80fd78065a7765903f457769fa9fdd4748.tar.gz scummvm-rg350-75571a80fd78065a7765903f457769fa9fdd4748.tar.bz2 scummvm-rg350-75571a80fd78065a7765903f457769fa9fdd4748.zip |
TITANIC: Fix the steering wheel horn
Diffstat (limited to 'engines/titanic/game')
-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; |