diff options
Diffstat (limited to 'engines/mutationofjb/tasks/conversationtask.h')
-rw-r--r-- | engines/mutationofjb/tasks/conversationtask.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/engines/mutationofjb/tasks/conversationtask.h b/engines/mutationofjb/tasks/conversationtask.h index 5cc0e5f49f..3bcbb6f998 100644 --- a/engines/mutationofjb/tasks/conversationtask.h +++ b/engines/mutationofjb/tasks/conversationtask.h @@ -26,20 +26,37 @@ namespace MutationOfJB { +class SayTask; + class ConversationTask : public Task, public ConversationWidgetCallback { public: - ConversationTask(const ConversationInfo& convInfo) : _convInfo(convInfo), _currentLine(0) {} + ConversationTask(uint8 sceneId, const ConversationInfo& convInfo) : _sceneId(sceneId), _convInfo(convInfo), _currentLineIndex(0), _currentItem(nullptr), _sayTask(nullptr), _substate(IDLE), _haveChoices(false) {} virtual ~ConversationTask() {} virtual void start() override; virtual void update() override; - virtual void onResponseClicked(ConversationWidget *, int response) override; + virtual void onChoiceClicked(ConversationWidget *, int response, uint32 data) override; private: - void updateWidget(); + void showChoicesOrPick(); + const ConversationInfo::Line *getCurrentLine() const; + void finish(); + uint8 _sceneId; const ConversationInfo &_convInfo; - uint _currentLine; + uint _currentLineIndex; + const ConversationInfo::Item *_currentItem; + SayTask* _sayTask; + + enum Substate { + IDLE, + SAYING_CHOICE, + SAYING_RESPONSE, + SAYING_NO_CHOICES + }; + + Substate _substate; + bool _haveChoices; }; } |