1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00
OpenMW/apps/openmw/mwdialogue/dialoguemanagerimp.hpp

75 lines
2.2 KiB
C++
Raw Normal View History

2012-08-11 12:02:51 +02:00
#ifndef GAME_MWDIALOG_DIALOGUEMANAGERIMP_H
#define GAME_MWDIALOG_DIALOGUEMANAGERIMP_H
2010-08-06 18:01:34 +02:00
#include "../mwbase/dialoguemanager.hpp"
2012-11-10 14:31:58 +01:00
#include <map>
#include <list>
2010-08-06 18:01:34 +02:00
#include <components/compiler/streamerrorhandler.hpp>
2012-02-17 20:20:23 +01:00
2010-08-08 13:21:03 +02:00
#include "../mwworld/ptr.hpp"
2012-11-10 14:31:58 +01:00
#include "../mwscript/compilercontext.hpp"
namespace MWDialogue
2010-08-06 18:01:34 +02:00
{
class DialogueManager : public MWBase::DialogueManager
2010-08-06 18:01:34 +02:00
{
2012-11-10 14:31:58 +01:00
std::map<std::string, ESM::Dialogue> mDialogueMap;
std::map<std::string, bool> mKnownTopics;// Those are the topics the player knows.
std::list<std::string> mActorKnownTopics;
2012-02-17 20:20:23 +01:00
MWScript::CompilerContext mCompilerContext;
std::ostream mErrorStream;
Compiler::StreamErrorHandler mErrorHandler;
2012-11-10 14:31:58 +01:00
2012-02-17 20:20:23 +01:00
MWWorld::Ptr mActor;
bool mTalkedTo;
2012-02-17 20:20:23 +01:00
int mChoice;
2012-11-10 14:31:58 +01:00
std::map<std::string, int> mChoiceMap;
std::string mLastTopic;
ESM::DialInfo mLastDialogue;
bool mIsInChoice;
2012-11-10 00:29:36 +01:00
float mTemporaryDispositionChange;
float mPermanentDispositionChange;
2012-11-10 14:31:58 +01:00
void parseText (const std::string& text);
void updateTopics();
bool compile (const std::string& cmd,std::vector<Interpreter::Type_Code>& code);
void executeScript (const std::string& script);
void printError (const std::string& error);
2010-08-06 18:01:34 +02:00
public:
DialogueManager (const Compiler::Extensions& extensions);
2010-08-06 18:01:34 +02:00
virtual void startDialogue (const MWWorld::Ptr& actor);
2010-08-06 18:01:34 +02:00
virtual void addTopic (const std::string& topic);
2012-02-10 16:09:43 +01:00
virtual void askQuestion (const std::string& question,int choice);
virtual void goodbye();
2012-11-10 14:31:58 +01:00
virtual MWWorld::Ptr getActor() const;
///< Return the actor the player is currently talking to.
2012-04-04 22:13:57 +02:00
//calbacks for the GUI
virtual void keywordSelected (const std::string& keyword);
virtual void goodbyeSelected();
virtual void questionAnswered (const std::string& answer);
2012-11-10 00:29:36 +01:00
virtual void persuade (int type);
virtual int getTemporaryDispositionChange () const;
2012-11-10 00:38:45 +01:00
virtual void applyTemporaryDispositionChange (int delta);
2010-08-06 18:01:34 +02:00
};
}
#endif