From ac0ed1dbdd420e2a2c7b5118d29bdb47715b5a14 Mon Sep 17 00:00:00 2001 From: whitertandrek Date: Tue, 20 Mar 2018 17:33:56 +0200 Subject: [PATCH] PINK: implemented init of LeadActor and checking for state in LeadActor method --- engines/pink/actors/actor.h | 2 +- engines/pink/actors/lead_actor.cpp | 14 ++++++++++++-- engines/pink/actors/lead_actor.h | 3 +++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/engines/pink/actors/actor.h b/engines/pink/actors/actor.h index 54661bd48c1..83f0d8e574f 100644 --- a/engines/pink/actors/actor.h +++ b/engines/pink/actors/actor.h @@ -43,7 +43,7 @@ public: Sequencer *getSequencer(); GamePage *getPage() const; - void init(bool unk); + virtual void init(bool unk); void hide(); void endAction(); diff --git a/engines/pink/actors/lead_actor.cpp b/engines/pink/actors/lead_actor.cpp index 23c94eddc99..12187d61dba 100644 --- a/engines/pink/actors/lead_actor.cpp +++ b/engines/pink/actors/lead_actor.cpp @@ -38,8 +38,18 @@ void LeadActor::deserialize(Archive &archive) { } void LeadActor::setNextExecutors(Common::String &nextModule, Common::String &nextPage) { - //TODO check for lead actor state - _page->getGame()->setNextExecutors(nextModule, nextPage); + if (_state == Ready || _state == Moving || _state == inDialog1 || _state == Inventory || _state == PDA) { + _state = PlayingVideo; + _page->getGame()->setNextExecutors(nextModule, nextPage); + } +} + +void LeadActor::init(bool unk) { + if (_state == unk_Loading){ + _state = Ready; + } + //TODO set actor ref to inv mgr + Actor::init(unk); } } // End of namespace Pink diff --git a/engines/pink/actors/lead_actor.h b/engines/pink/actors/lead_actor.h index 46fda52edfb..3954df1180b 100644 --- a/engines/pink/actors/lead_actor.h +++ b/engines/pink/actors/lead_actor.h @@ -47,7 +47,10 @@ public: virtual void deserialize(Archive &archive); void setNextExecutors (Common::String &nextModule, Common::String &nextPage); + virtual void init(bool unk); + private: + State _state; CursorMgr *_cursorMgr; WalkMgr *_walkMgr; Sequencer *_sequencer;