fix for questions

actorid
gugus 13 years ago
parent 11569819db
commit 2707391535

@ -560,16 +560,14 @@ namespace MWDialogue
if(pos==0)
{
knownTopics[*it] = true;
win->addKeyword(*it);
}
else if(text.substr(pos -1,1) == " ")
{
knownTopics[*it] = true;
win->addKeyword(*it);
}
}
}
updateTopics();
}
void DialogueManager::startDialogue (const MWWorld::Ptr& actor)
@ -692,6 +690,8 @@ namespace MWDialogue
void DialogueManager::updateTopics()
{
std::list<std::string> keywordList;
actorKnownTopics.clear();
MWGui::DialogueWindow* win = mEnvironment.mWindowManager->getDialogueWindow();
ESMS::RecListT<ESM::Dialogue>::MapType dialogueList = mEnvironment.mWorld->getStore().dialogs.list;
@ -709,12 +709,14 @@ namespace MWDialogue
//does the player know the topic?
if(knownTopics.find(toLower(it->first)) != knownTopics.end())
{
win->addKeyword(it->first);
keywordList.push_back(it->first);
break;
}
}
}
}
}
win->setKeywords(keywordList);
}
void DialogueManager::keywordSelected(std::string keyword)
@ -765,41 +767,27 @@ namespace MWDialogue
{
mChoice = mChoiceMap[answere];
//ESMS::RecListT<ESM::Dialogue>::MapType dialogueList = mEnvironment.mWorld->getStore().dialogs.list;
bool found = false;
//ESMS::RecListT<ESM::Dialogue>::MapType::iterator it;
std::vector<ESM::DialInfo>::const_iterator iter;
//for(it = dialogueList.begin(); it!=dialogueList.end();it++)
if(mDialogueMap.find(mLastTopic) != mDialogueMap.end())
{
ESM::Dialogue ndialogue = mDialogueMap[mLastTopic];
if(ndialogue.type == ESM::Dialogue::Topic)
{
for (iter = ndialogue.mInfo.begin();
for (std::vector<ESM::DialInfo>::const_iterator iter = ndialogue.mInfo.begin();
iter!=ndialogue.mInfo.end(); ++iter)
{
if(iter->id == mLastDialogue.id) found = true;
if(found) break;
}
}
if(found)
{
for (std::vector<ESM::DialInfo>::const_iterator iter2 = iter;
iter2!=ndialogue.mInfo.begin();)
{
--iter2;
if (isMatching (mActor, *iter2) && functionFilter(mActor,*iter2,true))
if (isMatching (mActor, *iter) && functionFilter(mActor,*iter,true))
{
mChoiceMap.clear();
mChoice = -1;
mIsInChoice = false;
MWGui::DialogueWindow* win = mEnvironment.mWindowManager->getDialogueWindow();
std::string text = iter2->response;
std::string text = iter->response;
parseText(text);
win->addText(text);
executeScript(iter2->resultScript);
executeScript(iter->resultScript);
mLastTopic = mLastTopic;
mLastDialogue = *iter2;
mLastDialogue = *iter;
break;
}
}

@ -113,12 +113,12 @@ void DialogueWindow::startDialogue(std::string npcName)
setText("NpcName", npcName);
}
void DialogueWindow::addKeyword(std::string keyWord)
void DialogueWindow::setKeywords(std::list<std::string> keyWords)
{
if(topicsList->findItemIndexWith(keyWord) == MyGUI::ITEM_NONE)
topicsList->removeAllItems();
for(std::list<std::string>::iterator it = keyWords.begin(); it != keyWords.end(); it++)
{
topicsList->addItem(keyWord);
pTopicsText[keyWord] = " ";
topicsList->addItem(*it);
}
}

@ -42,7 +42,7 @@ namespace MWGui
void startDialogue(std::string npcName);
void stopDialogue();
void addKeyword(std::string keyWord);
void setKeywords(std::list<std::string> keyWord);
void removeKeyword(std::string keyWord);
void addText(std::string text);
void addTitle(std::string text);

Loading…
Cancel
Save