diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mohawk/cstime.cpp | 7 | ||||
-rw-r--r-- | engines/mohawk/cstime_ui.cpp | 9 | ||||
-rw-r--r-- | engines/mohawk/cstime_ui.h | 1 |
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); } |