aboutsummaryrefslogtreecommitdiff
path: root/engines/pink/objects
diff options
context:
space:
mode:
authorwhiterandrek2018-06-12 20:05:05 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commit84af69cdf6e91c342090d9c8c9f3c3aaf008043f (patch)
tree009610b6c235983bc2450e342dad0ce4fd66f763 /engines/pink/objects
parent7b651e41c62c64a63ef012bdc8c0ee61b6448ccf (diff)
downloadscummvm-rg350-84af69cdf6e91c342090d9c8c9f3c3aaf008043f.tar.gz
scummvm-rg350-84af69cdf6e91c342090d9c8c9f3c3aaf008043f.tar.bz2
scummvm-rg350-84af69cdf6e91c342090d9c8c9f3c3aaf008043f.zip
PINK: move same code to startInventory function
Diffstat (limited to 'engines/pink/objects')
-rw-r--r--engines/pink/objects/actors/lead_actor.cpp26
-rw-r--r--engines/pink/objects/actors/lead_actor.h2
2 files changed, 17 insertions, 11 deletions
diff --git a/engines/pink/objects/actors/lead_actor.cpp b/engines/pink/objects/actors/lead_actor.cpp
index 2891682fca..8f48df52e0 100644
--- a/engines/pink/objects/actors/lead_actor.cpp
+++ b/engines/pink/objects/actors/lead_actor.cpp
@@ -103,14 +103,11 @@ void LeadActor::start(bool isHandler) {
InventoryMgr *mgr = getInventoryMgr();
switch (_state) {
case kInventory:
- mgr->start(0);
- _page->pause(true);
+ startInventory(1);
break;
case kPDA:
- if (_stateBeforePDA == kInventory) {
- mgr->start(0);
- _page->pause(true);
- }
+ if (_stateBeforePDA == kInventory)
+ startInventory(1);
loadPDA(_page->getGame()->getPdaMgr().getSavedPageName());
break;
default:
@@ -275,11 +272,7 @@ void LeadActor::onClick() {
_recipient = nullptr;
_nextState = kReady;
}
- if (getInventoryMgr()->start(1)) {
- _stateCopy = _state;
- _state = kInventory;
- _page->pause(true);
- }
+ startInventory(0);
}
}
@@ -387,6 +380,17 @@ Actor *LeadActor::getActorByPoint(const Common::Point point) {
return _page->getGame()->getDirector()->getActorByPoint(point);
}
+void LeadActor::startInventory(bool fromSave) {
+ getInventoryMgr()->start(fromSave);
+ if (!fromSave) {
+ _isHaveItem = false;
+ _stateCopy = _state;
+ _state = kInventory;
+ forceUpdateCursor();
+ }
+ _page->pause(true);
+}
+
void ParlSqPink::toConsole() {
debug("ParlSqPink: _name = %s", _name.c_str());
for (uint i = 0; i < _actions.size(); ++i) {
diff --git a/engines/pink/objects/actors/lead_actor.h b/engines/pink/objects/actors/lead_actor.h
index 22d783ede5..c4c0748e70 100644
--- a/engines/pink/objects/actors/lead_actor.h
+++ b/engines/pink/objects/actors/lead_actor.h
@@ -100,6 +100,8 @@ protected:
virtual WalkLocation *getWalkDestination();
+ void startInventory(bool fromSave);
+
Actor *_recipient;
CursorMgr *_cursorMgr;