applying new interface vol.3, inconsistent

actorid
greye 12 years ago
parent 86ad7a96f4
commit e628b23da6

@ -589,10 +589,14 @@ namespace MWDialogue
mCompilerContext.setExtensions (&extensions); mCompilerContext.setExtensions (&extensions);
mDialogueMap.clear(); mDialogueMap.clear();
mActorKnownTopics.clear(); mActorKnownTopics.clear();
MWWorld::RecListCaseT<ESM::Dialogue>::MapType dialogueList = MWBase::Environment::get().getWorld()->getStore().dialogs.list;
for(MWWorld::RecListCaseT<ESM::Dialogue>::MapType::iterator it = dialogueList.begin(); it!=dialogueList.end();it++) const MWWorld::Store<ESM::Dialogue> &dialogs =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>();
MWWorld::Store<ESM::Dialogue>::iterator it = dialogs.begin();
for (; it != dialogs.end(); ++it)
{ {
mDialogueMap[toLower(it->first)] = it->second; mDialogueMap[toLower(it->mId)] = *it;
} }
} }
@ -641,16 +645,17 @@ namespace MWDialogue
//greeting //greeting
bool greetingFound = false; bool greetingFound = false;
//MWWorld::RecListT<ESM::Dialogue>::MapType dialogueList = MWBase::Environment::get().getWorld()->getStore().dialogs.list; const MWWorld::Store<ESM::Dialogue> &dialogs =
MWWorld::RecListCaseT<ESM::Dialogue>::MapType dialogueList = MWBase::Environment::get().getWorld()->getStore().dialogs.list; MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>();
for(MWWorld::RecListCaseT<ESM::Dialogue>::MapType::iterator it = dialogueList.begin(); it!=dialogueList.end();it++)
MWWorld::Store<ESM::Dialogue>::iterator it = dialogs.begin();
for (; it != dialogs.end(); ++it)
{ {
ESM::Dialogue ndialogue = it->second; if(it->mType == ESM::Dialogue::Greeting)
if(ndialogue.mType == ESM::Dialogue::Greeting)
{ {
if (greetingFound) break; if (greetingFound) break;
for (std::vector<ESM::DialInfo>::const_iterator iter (it->second.mInfo.begin()); for (std::vector<ESM::DialInfo>::const_iterator iter (it->mInfo.begin());
iter!=it->second.mInfo.end(); ++iter) iter!=it->mInfo.end(); ++iter)
{ {
if (isMatching (actor, *iter) && functionFilter(mActor,*iter,true)) if (isMatching (actor, *iter) && functionFilter(mActor,*iter,true))
{ {
@ -664,7 +669,7 @@ namespace MWDialogue
win->addText(iter->mResponse); win->addText(iter->mResponse);
executeScript(iter->mResultScript); executeScript(iter->mResultScript);
greetingFound = true; greetingFound = true;
mLastTopic = it->first; mLastTopic = it->mId;
mLastDialogue = *iter; mLastDialogue = *iter;
break; break;
} }
@ -741,22 +746,26 @@ namespace MWDialogue
mChoice = -1; mChoice = -1;
mActorKnownTopics.clear(); mActorKnownTopics.clear();
MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow(); MWGui::DialogueWindow* win = MWBase::Environment::get().getWindowManager()->getDialogueWindow();
MWWorld::RecListCaseT<ESM::Dialogue>::MapType dialogueList = MWBase::Environment::get().getWorld()->getStore().dialogs.list;
for(MWWorld::RecListCaseT<ESM::Dialogue>::MapType::iterator it = dialogueList.begin(); it!=dialogueList.end();it++) const MWWorld::Store<ESM::Dialogue> &dialogs =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>();
MWWordl::Store<ESM::Dialogue>::iterator it = dialogs.begin();
for (; it != dialogs.end(); ++it)
{ {
ESM::Dialogue ndialogue = it->second; if(it->mType == ESM::Dialogue::Topic)
if(ndialogue.mType == ESM::Dialogue::Topic)
{ {
for (std::vector<ESM::DialInfo>::const_iterator iter (it->second.mInfo.begin()); for (std::vector<ESM::DialInfo>::const_iterator iter (it->mInfo.begin());
iter!=it->second.mInfo.end(); ++iter) iter!=it->mInfo.end(); ++iter)
{ {
if (isMatching (mActor, *iter) && functionFilter(mActor,*iter,true)) if (isMatching (mActor, *iter) && functionFilter(mActor,*iter,true))
{ {
mActorKnownTopics.push_back(toLower(it->first)); mActorKnownTopics.push_back(toLower(it->mId));
//does the player know the topic? //does the player know the topic?
if(mKnownTopics.find(toLower(it->first)) != mKnownTopics.end()) if(mKnownTopics.find(toLower(it->mId)) != mKnownTopics.end())
{ {
keywordList.push_back(it->first); keywordList.push_back(it->mId);
break; break;
} }
} }

@ -35,7 +35,8 @@ namespace MWDialogue
std::string JournalEntry::idFromIndex (const std::string& topic, int index) std::string JournalEntry::idFromIndex (const std::string& topic, int index)
{ {
const ESM::Dialogue *dialogue = MWBase::Environment::get().getWorld()->getStore().dialogs.find (topic); const ESM::Dialogue *dialogue =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>().find (topic);
for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin()); for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin());
iter!=dialogue->mInfo.end(); ++iter) iter!=dialogue->mInfo.end(); ++iter)

@ -18,7 +18,8 @@ namespace MWDialogue
const std::string Quest::getName() const const std::string Quest::getName() const
{ {
const ESM::Dialogue *dialogue = MWBase::Environment::get().getWorld()->getStore().dialogs.find (mTopic); const ESM::Dialogue *dialogue =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>().find (mTopic);
for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin()); for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin());
iter!=dialogue->mInfo.end(); ++iter) iter!=dialogue->mInfo.end(); ++iter)
@ -35,7 +36,8 @@ namespace MWDialogue
void Quest::setIndex (int index) void Quest::setIndex (int index)
{ {
const ESM::Dialogue *dialogue = MWBase::Environment::get().getWorld()->getStore().dialogs.find (mTopic); const ESM::Dialogue *dialogue =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>().find (mTopic);
for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin()); for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin());
iter!=dialogue->mInfo.end(); ++iter) iter!=dialogue->mInfo.end(); ++iter)
@ -63,7 +65,8 @@ namespace MWDialogue
{ {
int index = -1; int index = -1;
const ESM::Dialogue *dialogue = MWBase::Environment::get().getWorld()->getStore().dialogs.find (entry.mTopic); const ESM::Dialogue *dialogue =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Dialogue>().find (entry.mTopic);
for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin()); for (std::vector<ESM::DialInfo>::const_iterator iter (dialogue->mInfo.begin());
iter!=dialogue->mInfo.end(); ++iter) iter!=dialogue->mInfo.end(); ++iter)

@ -116,9 +116,8 @@ namespace MWSound
std::string SoundManager::lookup(const std::string &soundId, std::string SoundManager::lookup(const std::string &soundId,
float &volume, float &min, float &max) float &volume, float &min, float &max)
{ {
const ESM::Sound *snd = MWBase::Environment::get().getWorld()->getStore().sounds.search(soundId); const ESM::Sound *snd =
if(snd == NULL) MWBase::Environment::get().getWorld()->getStore().get<ESM::Sound>().find(soundId);
throw std::runtime_error(std::string("Failed to lookup sound ")+soundId);
volume *= pow(10.0, (snd->mData.mVolume/255.0*3348.0 - 3348.0) / 2000.0); volume *= pow(10.0, (snd->mData.mVolume/255.0*3348.0 - 3348.0) / 2000.0);
@ -424,7 +423,9 @@ namespace MWSound
total = 0; total = 0;
} }
const ESM::Region *regn = MWBase::Environment::get().getWorld()->getStore().regions.search(regionName); const ESM::Region *regn =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Region>().search(regionName);
if (regn == NULL) if (regn == NULL)
return; return;

Loading…
Cancel
Save