aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/pet_control/pet_control.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-04-01 08:32:30 -0400
committerPaul Gilbert2016-04-01 08:32:30 -0400
commit883e198eb3c5e54c2c3bc9b01f65f3420840873f (patch)
tree5f46493b9482ae95bae99a6dc9c137cea330ad1a /engines/titanic/pet_control/pet_control.cpp
parent43f183c207023c4398548ae385c9f3cbf853d9a9 (diff)
downloadscummvm-rg350-883e198eb3c5e54c2c3bc9b01f65f3420840873f.tar.gz
scummvm-rg350-883e198eb3c5e54c2c3bc9b01f65f3420840873f.tar.bz2
scummvm-rg350-883e198eb3c5e54c2c3bc9b01f65f3420840873f.zip
TITANIC: Implement PET CMouseButtonDownMsg handling
Diffstat (limited to 'engines/titanic/pet_control/pet_control.cpp')
-rw-r--r--engines/titanic/pet_control/pet_control.cpp39
1 files changed, 37 insertions, 2 deletions
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 9d2622ffb6..f316cff8e6 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -208,7 +208,7 @@ void CPetControl::fn4() {
}
PetArea CPetControl::setArea(PetArea newArea) {
- if (newArea == _currentArea || !canChangeArea())
+ if (newArea == _currentArea || !isUnlocked())
return _currentArea;
// Signal the currently active area that it's being left
@@ -347,7 +347,42 @@ bool CPetControl::getC0() const {
}
bool CPetControl::handleMessage(CMouseButtonDownMsg &msg) {
- return true;
+ if (!containsPt(msg._mousePos) || getC0())
+ return false;
+
+ bool result = false;
+ if (isUnlocked())
+ result = _frame.handleMessage(msg);
+
+ if (!result) {
+ switch (_currentArea) {
+ case PET_INVENTORY:
+ result = _inventory.handleMessage(msg);
+ break;
+ case PET_CONVERSATION:
+ result = _conversations.handleMessage(msg);
+ break;
+ case PET_REMOTE:
+ result = _remote.handleMessage(msg);
+ break;
+ case PET_ROOMS:
+ result = _rooms.handleMessage(msg);
+ break;
+ case PET_SAVE:
+ result = _saves.handleMessage(msg);
+ break;
+ case PET_5:
+ result = _sub5.handleMessage(msg);
+ break;
+ case PET_6:
+ result = _sub7.handleMessage(msg);
+ break;
+ default:
+ break;
+ }
+ }
+
+ makeDirty();
}
bool CPetControl::handleMessage(CMouseDragStartMsg &msg) {