aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/gfx
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-06 07:55:55 -0400
committerPaul Gilbert2016-04-06 07:55:55 -0400
commit08ed54f6c9fd72313e759d494a0b92cace2218e8 (patch)
tree3900a8842e991b704999c9a9829f74f9841a63d9 /engines/titanic/gfx
parentcb2dc0c8c8ab5b73f1ea863105a514202513de35 (diff)
downloadscummvm-rg350-08ed54f6c9fd72313e759d494a0b92cace2218e8.tar.gz
scummvm-rg350-08ed54f6c9fd72313e759d494a0b92cace2218e8.tar.bz2
scummvm-rg350-08ed54f6c9fd72313e759d494a0b92cace2218e8.zip
TITANIC: Beginnings of CProximity class
Diffstat (limited to 'engines/titanic/gfx')
-rw-r--r--engines/titanic/gfx/st_button.cpp18
-rw-r--r--engines/titanic/gfx/st_button.h2
2 files changed, 10 insertions, 10 deletions
diff --git a/engines/titanic/gfx/st_button.cpp b/engines/titanic/gfx/st_button.cpp
index 0d17331477..387800430f 100644
--- a/engines/titanic/gfx/st_button.cpp
+++ b/engines/titanic/gfx/st_button.cpp
@@ -28,7 +28,7 @@ CSTButton::CSTButton() : CBackground() {
_statusInc = 0;
_statusTarget = "NULL";
_fieldF0 = 0;
- _newStatus = 0;
+ _currentStatus = 0;
_string4 = "NULL";
_string5 = "NULL";
_buttonFrame = 0;
@@ -39,7 +39,7 @@ void CSTButton::save(SimpleFile *file, int indent) const {
file->writeNumberLine(_statusInc, indent);
file->writeQuotedLine(_statusTarget, indent);
file->writeNumberLine(_fieldF0, indent);
- file->writeNumberLine(_newStatus, indent);
+ file->writeNumberLine(_currentStatus, indent);
file->writeQuotedLine(_string4, indent);
file->writeQuotedLine(_string5, indent);
file->writeNumberLine(_buttonFrame, indent);
@@ -52,7 +52,7 @@ void CSTButton::load(SimpleFile *file) {
_statusInc = file->readNumber();
_statusTarget = file->readString();
_fieldF0 = file->readNumber();
- _newStatus = file->readNumber();
+ _currentStatus = file->readNumber();
_string4 = file->readString();
_string5 = file->readString();
_buttonFrame = file->readNumber() != 0;
@@ -68,15 +68,15 @@ bool CSTButton::handleMessage(CMouseButtonDownMsg &msg) {
}
bool CSTButton::handleMessage(CMouseButtonUpMsg &msg) {
- int value1 = _newStatus;
- int value2 = _newStatus + _statusInc;
+ int oldStatus = _currentStatus;
+ int newStatus = _currentStatus + _statusInc;
- CStatusChangeMsg statusMsg(value1, value2, 0);
- _newStatus = value2;
+ CStatusChangeMsg statusMsg(oldStatus, newStatus, false);
+ _currentStatus = newStatus;
statusMsg.execute(_statusTarget);
- if (statusMsg._value3) {
- _newStatus -= _statusInc;
+ if (!statusMsg._success) {
+ _currentStatus -= _statusInc;
}
return true;
diff --git a/engines/titanic/gfx/st_button.h b/engines/titanic/gfx/st_button.h
index 3e2ebe07a8..d613ad0eea 100644
--- a/engines/titanic/gfx/st_button.h
+++ b/engines/titanic/gfx/st_button.h
@@ -37,7 +37,7 @@ private:
int _statusInc;
CString _statusTarget;
int _fieldF0;
- int _newStatus;
+ int _currentStatus;
CString _string4;
CString _string5;
int _buttonFrame;