mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-05 00:36:57 +00:00
TITANIC: Fix the steering wheel horn
This commit is contained in:
parent
90e4e8a064
commit
75571a80fd
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user