#ifndef GAME_MWDIALOG_DIALOGUEMANAGERIMP_H #define GAME_MWDIALOG_DIALOGUEMANAGERIMP_H #include "../mwbase/dialoguemanager.hpp" #include #include #include #include #include "../mwworld/ptr.hpp" #include "../mwscript/compilercontext.hpp" namespace MWDialogue { class DialogueManager : public MWBase::DialogueManager { std::map mDialogueMap; std::map mKnownTopics;// Those are the topics the player knows. std::list mActorKnownTopics; Translation::Storage& mTranslationDataStorage; MWScript::CompilerContext mCompilerContext; std::ostream mErrorStream; Compiler::StreamErrorHandler mErrorHandler; MWWorld::Ptr mActor; bool mTalkedTo; int mChoice; std::string mLastTopic; bool mIsInChoice; float mTemporaryDispositionChange; float mPermanentDispositionChange; bool mScriptVerbose; void parseText (const std::string& text); void updateTopics(); void updateGlobals(); bool compile (const std::string& cmd,std::vector& code); void executeScript (const std::string& script); void executeTopic (const std::string& topic); public: DialogueManager (const Compiler::Extensions& extensions, bool scriptVerbose, Translation::Storage& translationDataStorage); virtual void clear(); virtual bool isInChoice() const; virtual void startDialogue (const MWWorld::Ptr& actor); virtual void addTopic (const std::string& topic); virtual void askQuestion (const std::string& question,int choice); virtual void goodbye(); virtual MWWorld::Ptr getActor() const; ///< Return the actor the player is currently talking to. virtual bool checkServiceRefused (); virtual void say(const MWWorld::Ptr &actor, const std::string &topic) const; //calbacks for the GUI virtual void keywordSelected (const std::string& keyword); virtual void goodbyeSelected(); virtual void questionAnswered (int answer); virtual void persuade (int type); virtual int getTemporaryDispositionChange () const; virtual void applyDispositionChange (int delta); }; struct HyperTextToken { HyperTextToken(const std::string& text, bool link) : mText(text), mLink(link) {} std::string mText; bool mLink; }; // In translations (at least Russian) the links are marked with @#, so // it should be a function to parse it std::vector ParseHyperText(const std::string& text); size_t RemovePseudoAsterisks(std::string& phrase); } #endif