|
|
@ -117,6 +117,8 @@ namespace MWDialogue
|
|
|
|
|
|
|
|
|
|
|
|
void DialogueManager::startDialogue (const MWWorld::Ptr& actor)
|
|
|
|
void DialogueManager::startDialogue (const MWWorld::Ptr& actor)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
mLastTopic = "";
|
|
|
|
|
|
|
|
|
|
|
|
mChoice = -1;
|
|
|
|
mChoice = -1;
|
|
|
|
mIsInChoice = false;
|
|
|
|
mIsInChoice = false;
|
|
|
|
|
|
|
|
|
|
|
@ -127,6 +129,9 @@ namespace MWDialogue
|
|
|
|
|
|
|
|
|
|
|
|
mActorKnownTopics.clear();
|
|
|
|
mActorKnownTopics.clear();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
|
|
|
|
|
|
|
|
win->startDialogue(actor, MWWorld::Class::get (actor).getName (actor));
|
|
|
|
|
|
|
|
|
|
|
|
//setup the list of topics known by the actor. Topics who are also on the knownTopics list will be added to the GUI
|
|
|
|
//setup the list of topics known by the actor. Topics who are also on the knownTopics list will be added to the GUI
|
|
|
|
updateTopics();
|
|
|
|
updateTopics();
|
|
|
|
|
|
|
|
|
|
|
@ -145,8 +150,6 @@ namespace MWDialogue
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//initialise the GUI
|
|
|
|
//initialise the GUI
|
|
|
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Dialogue);
|
|
|
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Dialogue);
|
|
|
|
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
|
|
|
|
|
|
|
|
win->startDialogue(actor, MWWorld::Class::get (actor).getName (actor));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
creatureStats.talkedToPlayer();
|
|
|
|
creatureStats.talkedToPlayer();
|
|
|
|
|
|
|
|
|
|
|
@ -160,7 +163,7 @@ namespace MWDialogue
|
|
|
|
MWScript::InterpreterContext interpreterContext(&mActor.getRefData().getLocals(),mActor);
|
|
|
|
MWScript::InterpreterContext interpreterContext(&mActor.getRefData().getLocals(),mActor);
|
|
|
|
win->addText (Interpreter::fixDefinesDialog(info->mResponse, interpreterContext));
|
|
|
|
win->addText (Interpreter::fixDefinesDialog(info->mResponse, interpreterContext));
|
|
|
|
executeScript (info->mResultScript);
|
|
|
|
executeScript (info->mResultScript);
|
|
|
|
mLastTopic = it->mId;
|
|
|
|
mLastTopic = Misc::StringUtils::lowerCase(it->mId);
|
|
|
|
mLastDialogue = *info;
|
|
|
|
mLastDialogue = *info;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -398,6 +401,11 @@ namespace MWDialogue
|
|
|
|
updateTopics();
|
|
|
|
updateTopics();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool DialogueManager::isInChoice() const
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return mIsInChoice;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DialogueManager::goodbyeSelected()
|
|
|
|
void DialogueManager::goodbyeSelected()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Do not close the dialogue window if the player has to answer a question
|
|
|
|
// Do not close the dialogue window if the player has to answer a question
|
|
|
@ -424,15 +432,13 @@ namespace MWDialogue
|
|
|
|
|
|
|
|
|
|
|
|
if (mDialogueMap.find(mLastTopic) != mDialogueMap.end())
|
|
|
|
if (mDialogueMap.find(mLastTopic) != mDialogueMap.end())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (mDialogueMap[mLastTopic].mType == ESM::Dialogue::Topic)
|
|
|
|
Filter filter (mActor, mChoice, mTalkedTo);
|
|
|
|
{
|
|
|
|
|
|
|
|
Filter filter (mActor, mChoice, mTalkedTo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mDialogueMap[mLastTopic].mType == ESM::Dialogue::Topic
|
|
|
|
|
|
|
|
|| mDialogueMap[mLastTopic].mType == ESM::Dialogue::Greeting)
|
|
|
|
|
|
|
|
{
|
|
|
|
if (const ESM::DialInfo *info = filter.search (mDialogueMap[mLastTopic], true))
|
|
|
|
if (const ESM::DialInfo *info = filter.search (mDialogueMap[mLastTopic], true))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mChoiceMap.clear();
|
|
|
|
|
|
|
|
mChoice = -1;
|
|
|
|
|
|
|
|
mIsInChoice = false;
|
|
|
|
|
|
|
|
std::string text = info->mResponse;
|
|
|
|
std::string text = info->mResponse;
|
|
|
|
parseText (text);
|
|
|
|
parseText (text);
|
|
|
|
|
|
|
|
|
|
|
@ -440,10 +446,12 @@ namespace MWDialogue
|
|
|
|
MWBase::Environment::get().getWindowManager()->getDialogueWindow()->addText (Interpreter::fixDefinesDialog(text, interpreterContext));
|
|
|
|
MWBase::Environment::get().getWindowManager()->getDialogueWindow()->addText (Interpreter::fixDefinesDialog(text, interpreterContext));
|
|
|
|
MWBase::Environment::get().getJournal()->addTopic (mLastTopic, info->mId);
|
|
|
|
MWBase::Environment::get().getJournal()->addTopic (mLastTopic, info->mId);
|
|
|
|
executeScript (info->mResultScript);
|
|
|
|
executeScript (info->mResultScript);
|
|
|
|
mLastTopic = mLastTopic;
|
|
|
|
|
|
|
|
mLastDialogue = *info;
|
|
|
|
mLastDialogue = *info;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mChoiceMap.clear();
|
|
|
|
|
|
|
|
mChoice = -1;
|
|
|
|
|
|
|
|
mIsInChoice = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
updateTopics();
|
|
|
|
updateTopics();
|
|
|
|