aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorAlyssa Milburn2011-01-21 19:45:58 +0000
committerAlyssa Milburn2011-01-21 19:45:58 +0000
commitbb2ae25626ae6e0cdbf53f41afc00261d86f1ced (patch)
treed1f5973f4864618e8467c14d66e1693d4e48e638 /engines/mohawk
parent13eb46eb9900bef3ed33da38454f2d196104a5c4 (diff)
downloadscummvm-rg350-bb2ae25626ae6e0cdbf53f41afc00261d86f1ced.tar.gz
scummvm-rg350-bb2ae25626ae6e0cdbf53f41afc00261d86f1ced.tar.bz2
scummvm-rg350-bb2ae25626ae6e0cdbf53f41afc00261d86f1ced.zip
MOHAWK: Implement kCSTimeEventRemoveItemFromInventory.
svn-id: r55389
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/cstime.cpp7
-rw-r--r--engines/mohawk/cstime_ui.cpp9
-rw-r--r--engines/mohawk/cstime_ui.h1
3 files changed, 17 insertions, 0 deletions
diff --git a/engines/mohawk/cstime.cpp b/engines/mohawk/cstime.cpp
index 0d72a68648..0540b7511c 100644
--- a/engines/mohawk/cstime.cpp
+++ b/engines/mohawk/cstime.cpp
@@ -430,6 +430,13 @@ void MohawkEngine_CSTime::triggerEvent(CSTimeEvent &event) {
_interface->dropItemInInventory(event.param2);
break;
+ case kCSTimeEventRemoveItemFromInventory:
+ if (!_interface->getInventoryDisplay()->isItemDisplayed(event.param2))
+ break;
+ _haveInvItem[event.param2] = 0;
+ _interface->getInventoryDisplay()->removeItem(event.param2);
+ break;
+
case kCSTimeEventAddNotePiece:
_interface->clearTextLine();
_interface->getCarmenNote()->addPiece(event.param2, event.param1);
diff --git a/engines/mohawk/cstime_ui.cpp b/engines/mohawk/cstime_ui.cpp
index 3004556193..bfb62a0c49 100644
--- a/engines/mohawk/cstime_ui.cpp
+++ b/engines/mohawk/cstime_ui.cpp
@@ -1078,6 +1078,15 @@ void CSTimeInventoryDisplay::setCuffsFlashing() {
invObj->featureDisabled = false;
}
+bool CSTimeInventoryDisplay::isItemDisplayed(uint16 id) {
+ for (uint i = 0; i < MAX_DISPLAYED_ITEMS; i++) {
+ if (_displayedItems[i] == id)
+ return true;
+ }
+
+ return false;
+}
+
CSTimeBook::CSTimeBook(MohawkEngine_CSTime *vm) : _vm(vm) {
_state = 0;
_smallBookFeature = NULL;
diff --git a/engines/mohawk/cstime_ui.h b/engines/mohawk/cstime_ui.h
index a58fc224f0..8a029876b7 100644
--- a/engines/mohawk/cstime_ui.h
+++ b/engines/mohawk/cstime_ui.h
@@ -83,6 +83,7 @@ public:
bool getCuffsState() { return _cuffsState; }
uint16 getCuffsShape() { return _cuffsShape; }
+ bool isItemDisplayed(uint16 id);
uint16 getDisplayedNum(uint id) { return _displayedItems[id]; }
uint16 getLastDisplayedClicked() { return getDisplayedNum(_draggedItem); }