diff options
author | Paul Gilbert | 2016-04-16 18:42:29 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-10 16:11:16 -0400 |
commit | daaa458d64df42f113b7badd65cdfaf0da0504ff (patch) | |
tree | 3e53909013e75ccdcd31e7e6de94152e8854b89e /engines/titanic/pet_control/pet_control.cpp | |
parent | fb5565679bf701293a73abfd03b76515f7bcb8ab (diff) | |
download | scummvm-rg350-daaa458d64df42f113b7badd65cdfaf0da0504ff.tar.gz scummvm-rg350-daaa458d64df42f113b7badd65cdfaf0da0504ff.tar.bz2 scummvm-rg350-daaa458d64df42f113b7badd65cdfaf0da0504ff.zip |
TITANIC: Restructuring PET list classes, beginning of inventory
Diffstat (limited to 'engines/titanic/pet_control/pet_control.cpp')
-rw-r--r-- | engines/titanic/pet_control/pet_control.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp index bb320f29f4..b9f1359746 100644 --- a/engines/titanic/pet_control/pet_control.cpp +++ b/engines/titanic/pet_control/pet_control.cpp @@ -353,7 +353,30 @@ CGameObject *CPetControl::getNextObject(CGameObject *prior) const { } void CPetControl::addToInventory(CCarry *item) { - _inventory.addItem(item); + item->detach(); + + if (item->getName() == "CarryParcel") { + CCarry *child = static_cast<CCarry *>(getLastChild()); + if (child) + child->detach(); + + item->moveToHiddenRoom(); + if (!child) + return; + + item = child; + } + + item->addUnder(this); + _inventory.itemsChanged(); + + setArea(PET_INVENTORY); + if (_currentArea != PET_INVENTORY) + _inventory.couldntShowInventory(item); + + makeDirty(); + CPETGainedObjectMsg msg; + msg.execute(item); } void CPetControl::removeFromInventory(CCarry *item, CTreeItem *newParent, @@ -376,6 +399,10 @@ void CPetControl::removeFromInventory(CCarry *item, bool refreshUI, bool sendMsg removeFromInventory(item, view, refreshUI, sendMsg); } +void CPetControl::invFn3(CCarry *item) { + _inventory.fn3(item); +} + void CPetControl::moveToHiddenRoom(CTreeItem *item) { CRoomItem *room = getHiddenRoom(); if (room) { |