TITANIC: Fix handling of Gondolier sliders when arms are used on them

This commit is contained in:
Paul Gilbert 2017-07-27 21:18:35 -04:00
parent 00bbb73ce5
commit 27f51565c3
3 changed files with 17 additions and 16 deletions

View File

@ -61,10 +61,10 @@ void CGondolierBase::load(SimpleFile *file) {
_puzzleSolved = file->readNumber();
_volume1 = file->readNumber();
_slider1 = file->readNumber();
_rightSliderHooked = file->readNumber();
_leftSliderHooked = file->readNumber();
_volume2 = file->readNumber();
_slider2 = file->readNumber();
_leftSliderHooked = file->readNumber();
_rightSliderHooked = file->readNumber();
_priorLeftSliderHooked = file->readNumber();
_priorRightSliderHooked = file->readNumber();

View File

@ -144,7 +144,7 @@ bool CGondolierMixer::SignalObject(CSignalObject *msg) {
if (msg->_strValue == "Fly") {
_slider1 = CLIP(msg->_numValue, 0, 10);
if (!_leftSliderHooked) {
if (!_rightSliderHooked) {
_slider2 = 10 - _slider1;
CStatusChangeMsg statusMsg;
statusMsg._newStatus = _slider2;
@ -155,7 +155,7 @@ bool CGondolierMixer::SignalObject(CSignalObject *msg) {
if (msg->_strValue == "Tos") {
_slider2 = CLIP(msg->_numValue, 0, 10);
if (!_rightSliderHooked) {
if (!_leftSliderHooked) {
_slider1 = 10 - _slider2;
CStatusChangeMsg statusMsg;
statusMsg._newStatus = _slider1;
@ -163,7 +163,7 @@ bool CGondolierMixer::SignalObject(CSignalObject *msg) {
}
}
if (!_slider1 && !_slider2 && _rightSliderHooked && _leftSliderHooked) {
if (!_slider1 && !_slider2 && _leftSliderHooked && _rightSliderHooked) {
_puzzleSolved = true;
CStatusChangeMsg statusMsg;
statusMsg._newStatus = 1;

View File

@ -79,14 +79,14 @@ void CGondolierSlider::load(SimpleFile *file) {
bool CGondolierSlider::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
if (!_chestOpen)
return false;
if (_sliderNum ? _rightSliderHooked : _leftSliderHooked)
if (_sliderNum ? _leftSliderHooked : _rightSliderHooked)
return false;
return _thumbRect.contains(msg->_mousePos);
}
bool CGondolierSlider::MouseDragMoveMsg(CMouseDragMoveMsg *msg) {
if (!(_sliderNum ? _rightSliderHooked : _leftSliderHooked)) {
if (!(_sliderNum ? _leftSliderHooked : _rightSliderHooked)) {
int minVal = 0x7FFFFFFF;
int foundIndex = -1;
int yp = (_defaultThumbRect.top + _defaultThumbRect.bottom) / 2
@ -120,7 +120,7 @@ bool CGondolierSlider::EnterViewMsg(CEnterViewMsg *msg) {
bool CGondolierSlider::MouseDragStartMsg(CMouseDragStartMsg *msg) {
if (!_chestOpen)
return false;
if (_sliderNum ? _rightSliderHooked : _leftSliderHooked)
if (_sliderNum ? _leftSliderHooked : _rightSliderHooked)
return false;
_dragging = checkStartDragging(msg);
@ -143,7 +143,7 @@ bool CGondolierSlider::MouseDragEndMsg(CMouseDragEndMsg *msg) {
}
bool CGondolierSlider::IsHookedOnMsg(CIsHookedOnMsg *msg) {
if (_sliderNum ? _rightSliderHooked : _leftSliderHooked)
if (_sliderNum ? _leftSliderHooked : _rightSliderHooked)
return false;
if (!_thumbRect.intersects(msg->_rect)) {
@ -152,9 +152,9 @@ bool CGondolierSlider::IsHookedOnMsg(CIsHookedOnMsg *msg) {
} else {
_armName = msg->_armName;
if (_sliderNum) {
_rightSliderHooked = _priorLeftSliderHooked = true;
_leftSliderHooked = _priorLeftSliderHooked = true;
} else {
_leftSliderHooked = _priorRightSliderHooked = true;
_rightSliderHooked = _priorRightSliderHooked = true;
}
msg->_isHooked = true;
@ -164,7 +164,7 @@ bool CGondolierSlider::IsHookedOnMsg(CIsHookedOnMsg *msg) {
}
bool CGondolierSlider::FrameMsg(CFrameMsg *msg) {
if (_sliderNum ? _rightSliderHooked : _leftSliderHooked) {
if (_sliderNum ? _leftSliderHooked : _rightSliderHooked) {
if (_sliderIndex < 10) {
++_sliderIndex;
CSignalObject signalMsg;
@ -182,6 +182,7 @@ bool CGondolierSlider::FrameMsg(CFrameMsg *msg) {
}
} else if (_sliderNum ? _priorRightSliderHooked : _priorLeftSliderHooked) {
if (!_dragging && !_puzzleSolved && _sliderIndex > 0) {
--_sliderIndex;
CSignalObject signalMsg;
signalMsg.execute(this);
}
@ -208,11 +209,11 @@ bool CGondolierSlider::SignalObject(CSignalObject *msg) {
bool CGondolierSlider::ActMsg(CActMsg *msg) {
if (msg->_action == "Unhook") {
if (_sliderNum) {
_rightSliderHooked = _priorLeftSliderHooked = false;
_priorRightSliderHooked = _leftSliderHooked;
_leftSliderHooked = _priorLeftSliderHooked = false;
_priorRightSliderHooked = _rightSliderHooked;
} else {
_leftSliderHooked = _priorRightSliderHooked = false;
_priorLeftSliderHooked = _rightSliderHooked;
_rightSliderHooked = _priorRightSliderHooked = false;
_priorLeftSliderHooked = _leftSliderHooked;
}
}