aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorwhiterandrek2018-06-19 13:20:41 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commit5f61d96bae353cdbaba69044772fef524c8070af (patch)
treedec6d6325c777b2e2bc3113faba629a17e3b855e /engines
parentb32af31601da92046902ad6dc9152294537d6272 (diff)
downloadscummvm-rg350-5f61d96bae353cdbaba69044772fef524c8070af.tar.gz
scummvm-rg350-5f61d96bae353cdbaba69044772fef524c8070af.tar.bz2
scummvm-rg350-5f61d96bae353cdbaba69044772fef524c8070af.zip
PINK: rework InventoryMgr updating
Diffstat (limited to 'engines')
-rw-r--r--engines/pink/objects/inventory.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/engines/pink/objects/inventory.cpp b/engines/pink/objects/inventory.cpp
index 94a316350b..3a0dd786ff 100644
--- a/engines/pink/objects/inventory.cpp
+++ b/engines/pink/objects/inventory.cpp
@@ -35,7 +35,7 @@ namespace Pink {
InventoryMgr::InventoryMgr()
: _lead(nullptr), _item(nullptr), _isClickedOnItem(false) {}
-void Pink::InventoryItem::deserialize(Archive &archive) {
+void InventoryItem::deserialize(Archive &archive) {
NamedObject::deserialize(archive);
_initialOwner = archive.readString();
_currentOwner = _initialOwner;
@@ -116,22 +116,27 @@ bool InventoryMgr::start(bool paused) {
}
void InventoryMgr::update() {
- if (_state == kOpening && !_window->isPlaying()) {
+ if (_window->isPlaying())
+ return;
+
+ switch (_state) {
+ case kOpening:
_state = kReady;
_itemActor->setAction(_item->getName());
_window->setAction(kShowAction);
_leftArrow->setAction(kShowAction);
_rightArrow->setAction(kShowAction);
- } else if (_state == kClosing && !_window->isPlaying()) {
+ break;
+ case kClosing:
_window->setAction(kIdleAction);
-
_lead->onInventoryClosed(_isClickedOnItem);
-
_state = kIdle;
-
_window = nullptr;
_itemActor = nullptr;
_isClickedOnItem = false;
+ break;
+ default:
+ break;
}
}