diff --git a/engines/pink/archive.cpp b/engines/pink/archive.cpp index f62344f9181..f09bc4c3aee 100644 --- a/engines/pink/archive.cpp +++ b/engines/pink/archive.cpp @@ -148,12 +148,12 @@ static Object *createObject(int objectId) { case kHandlerLeftClick: return new HandlerLeftClick; case kHandlerStartPage: - return new HandlerStartPage; + return new HandlerSequences(true, false); case kHandlerTimer: case kHandlerTimerActions: return new HandlerTimerActions; // hack for Peril, but behavior is correct case kHandlerTimerSequences: - return new HandlerSequences(true); + return new HandlerSequences(false, true); case kHandlerUseClick: return new HandlerUseClick; case kInventoryActor: diff --git a/engines/pink/objects/handlers/handler.cpp b/engines/pink/objects/handlers/handler.cpp index 3617325c8c3..1f2f8fec555 100644 --- a/engines/pink/objects/handlers/handler.cpp +++ b/engines/pink/objects/handlers/handler.cpp @@ -86,36 +86,15 @@ void HandlerSequences::handle(Actor *actor) { else sequencer->authorSequence(sequence, false); - execute(sequence); + if (_startPage) + sequence->allowSkipping(); } -HandlerSequences::HandlerSequences(bool parallel) { +HandlerSequences::HandlerSequences(bool startPage, bool parallel) { + _startPage = startPage; _parallel = parallel; } -void HandlerStartPage::execute(Sequence *sequence) { - sequence->allowSkipping(); -} - -void HandlerStartPage::toConsole() const { - debugC(6, kPinkDebugLoadingObjects, "HandlerStartPage:"); - - debugC(6, kPinkDebugLoadingObjects, "\tSideEffects:"); - for (uint i = 0; i < _sideEffects.size(); ++i) { - _sideEffects[i]->toConsole(); - } - - debugC(6, kPinkDebugLoadingObjects, "\tConditions:"); - for (uint i = 0; i < _conditions.size(); ++i) { - _conditions[i]->toConsole(); - } - - debugC(6, kPinkDebugLoadingObjects, "\tSequences:"); - for (uint i = 0; i < _sequences.size(); ++i) { - debugC(6, kPinkDebugLoadingObjects, "\t\t%s", _sequences[i].c_str()); - } -} - void HandlerLeftClick::toConsole() const { debugC(6, kPinkDebugLoadingObjects, "HandlerLeftClick:"); diff --git a/engines/pink/objects/handlers/handler.h b/engines/pink/objects/handlers/handler.h index c73f371c9c5..1eacf386a50 100644 --- a/engines/pink/objects/handlers/handler.h +++ b/engines/pink/objects/handlers/handler.h @@ -52,32 +52,20 @@ class Sequence; class HandlerSequences : public Handler { public: - HandlerSequences(bool parallel = false); + HandlerSequences(bool startPage = false, bool parallel = false); void deserialize(Archive &archive) override; void handle(Actor *actor) override; protected: - virtual void execute(Sequence *sequence) {}; - StringArray _sequences; + bool _startPage; bool _parallel; }; -class HandlerStartPage : public HandlerSequences { -public: - void toConsole() const override; - -private: - void execute(Sequence *sequence) override; -}; - class HandlerLeftClick : public HandlerSequences { public: void toConsole() const override; - -private: - void execute(Sequence *sequence) override {} }; class HandlerUseClick : public HandlerSequences { @@ -89,8 +77,6 @@ public: const Common::String &getRecepient() const { return _recepient; } private: - void execute(Sequence *sequence) override {}; - Common::String _inventoryItem; Common::String _recepient; }; diff --git a/engines/pink/objects/pages/game_page.h b/engines/pink/objects/pages/game_page.h index 2db46bbc982..aaf2e86288a 100644 --- a/engines/pink/objects/pages/game_page.h +++ b/engines/pink/objects/pages/game_page.h @@ -30,7 +30,7 @@ namespace Pink { class CursorMgr; -class HandlerStartPage; +class HandlerSequences; class GamePage : public Page { public: @@ -71,7 +71,7 @@ private: CursorMgr *_cursorMgr; WalkMgr *_walkMgr; Sequencer *_sequencer; - Array _handlers; + Array _handlers; StringMap _variables; };