[Scummvm-git-logs] scummvm master -> 75571a80fd78065a7765903f457769fa9fdd4748
dreammaster
dreammaster at scummvm.org
Tue Feb 21 03:49:57 CET 2017
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
75571a80fd TITANIC: Fix the steering wheel horn
Commit: 75571a80fd78065a7765903f457769fa9fdd4748
https://github.com/scummvm/scummvm/commit/75571a80fd78065a7765903f457769fa9fdd4748
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-02-20T21:49:53-05:00
Commit Message:
TITANIC: Fix the steering wheel horn
Changed paths:
engines/titanic/game/wheel_spin_horn.cpp
engines/titanic/game/wheel_spin_horn.h
diff --git a/engines/titanic/game/wheel_spin_horn.cpp b/engines/titanic/game/wheel_spin_horn.cpp
index b01cc67..c299ffc 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 2118225..b8546b0 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;
More information about the Scummvm-git-logs
mailing list