diff options
author | whiterandrek | 2018-05-22 11:58:02 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2018-06-28 23:51:32 +0200 |
commit | e98c14c3d7d790f6ba77ab4d4925b608c55e2e22 (patch) | |
tree | 00b613617132ce06f622054786f63ed8396db9ae /engines/pink/objects/inventory.cpp | |
parent | d7f09d4c3cbfca7472856ca5a3e14a8e55255451 (diff) | |
download | scummvm-rg350-e98c14c3d7d790f6ba77ab4d4925b608c55e2e22.tar.gz scummvm-rg350-e98c14c3d7d790f6ba77ab4d4925b608c55e2e22.tar.bz2 scummvm-rg350-e98c14c3d7d790f6ba77ab4d4925b608c55e2e22.zip |
PINK: fix formatting
Diffstat (limited to 'engines/pink/objects/inventory.cpp')
-rw-r--r-- | engines/pink/objects/inventory.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/engines/pink/objects/inventory.cpp b/engines/pink/objects/inventory.cpp index 677b18fb8f..13d0dfdc6f 100644 --- a/engines/pink/objects/inventory.cpp +++ b/engines/pink/objects/inventory.cpp @@ -33,9 +33,7 @@ namespace Pink { InventoryMgr::InventoryMgr() - : _lead(nullptr), _item(nullptr), _isClickedOnItem(false) -{ -} + : _lead(nullptr), _item(nullptr), _isClickedOnItem(false) {} void Pink::InventoryItem::deserialize(Archive &archive) { NamedObject::deserialize(archive); @@ -129,14 +127,13 @@ bool InventoryMgr::start(bool playOpening) { } void InventoryMgr::update() { - if (_state == kOpening && !_window->isPlaying()){ + if (_state == kOpening && !_window->isPlaying()) { _state = kReady; _itemActor->setAction(_item->getName()); _window->setAction(kShowAction); _leftArrow->setAction(kShowAction); _rightArrow->setAction(kShowAction); - } - else if (_state == kClosing && !_window->isPlaying()){ + } else if (_state == kClosing && !_window->isPlaying()) { _window->setAction(kIdleAction); _lead->onInventoryClosed(_isClickedOnItem); @@ -157,14 +154,12 @@ void InventoryMgr::onClick(Common::Point point) { if (actor == _itemActor || actor == _window) { _isClickedOnItem = true; close(); - } - else if (actor == _leftArrow) { + } else if (actor == _leftArrow) { showNextItem(kLeft); - } - else if (actor == _rightArrow) { + } else if (actor == _rightArrow) { showNextItem(kRight); - } - else close(); + } else + close(); } void InventoryMgr::close() { @@ -188,7 +183,7 @@ void InventoryMgr::showNextItem(bool direction) { uint i = 0; do { index = (direction == kLeft) ? index - 1 : index + 1; - } while(_items[index % _items.size()]->getCurrentOwner() != _item->getCurrentOwner() && ++i < _items.size()); + } while (_items[index % _items.size()]->getCurrentOwner() != _item->getCurrentOwner() && ++i < _items.size()); if (i != _items.size()) { _item = _items[index % _items.size()]; |