diff options
author | Paul Gilbert | 2016-03-31 23:25:19 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-03-31 23:25:19 -0400 |
commit | 18fabbb2d40ce9456d4673c0b7c602f50458b583 (patch) | |
tree | f8b3c54d774b89a7abe5c2c24c2a88375f3a7847 /engines/titanic/pet_control/pet_control.cpp | |
parent | 5923ee5001af91d1ca9294b1fead56ec04ece7df (diff) | |
download | scummvm-rg350-18fabbb2d40ce9456d4673c0b7c602f50458b583.tar.gz scummvm-rg350-18fabbb2d40ce9456d4673c0b7c602f50458b583.tar.bz2 scummvm-rg350-18fabbb2d40ce9456d4673c0b7c602f50458b583.zip |
TITANIC: Beginnings of PET event handling code
Diffstat (limited to 'engines/titanic/pet_control/pet_control.cpp')
-rw-r--r-- | engines/titanic/pet_control/pet_control.cpp | 99 |
1 files changed, 98 insertions, 1 deletions
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp index 6df688ef75..9d2622ffb6 100644 --- a/engines/titanic/pet_control/pet_control.cpp +++ b/engines/titanic/pet_control/pet_control.cpp @@ -157,7 +157,7 @@ Rect CPetControl::getBounds() { return _sub7.getBounds(); break; default: - break; + return Rect(); } } @@ -342,4 +342,101 @@ bool CPetControl::containsPt(const Common::Point &pt) const { return _drawBounds.contains(pt); } +bool CPetControl::getC0() const { + return _fieldC0 > 0; +} + +bool CPetControl::handleMessage(CMouseButtonDownMsg &msg) { + return true; +} + +bool CPetControl::handleMessage(CMouseDragStartMsg &msg) { + return true; +} + +bool CPetControl::handleMessage(CMouseDragMoveMsg &msg) { + return true; +} + +bool CPetControl::handleMessage(CMouseDragEndMsg &msg) { + return true; +} + +bool CPetControl::handleMessage(CMouseButtonUpMsg &msg) { + return true; +} + +bool CPetControl::handleMessage(CMouseDoubleClickMsg &msg) { + return true; +} + +bool CPetControl::handleMessage(CKeyCharMsg &msg) { + return true; +} + +bool CPetControl::handleMessage(CVirtualKeyCharMsg &msg) { + if (getC0()) + return false; + + bool result = false; + 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; + } + + if (!result) { + switch (msg._keyState.keycode) { + case Common::KEYCODE_F1: + result = true; + setArea(PET_INVENTORY); + break; + case Common::KEYCODE_F2: + result = true; + setArea(PET_CONVERSATION); + break; + case Common::KEYCODE_F3: + result = true; + setArea(PET_REMOTE); + break; + case Common::KEYCODE_F4: + result = true; + setArea(PET_ROOMS); + break; + case Common::KEYCODE_F5: + result = true; + setArea(PET_SAVE); + break; + default: + break; + } + } + + return result; +} + +bool CPetControl::handleMessage(CTimerMsg &msg) { + return true; +} + } // End of namespace Titanic |