forked from teamnwah/openmw-tes3coop
store text in journal entries
This commit is contained in:
parent
aebc2791a5
commit
9d64c92d33
2 changed files with 12 additions and 5 deletions
|
@ -14,21 +14,27 @@ namespace MWDialogue
|
||||||
|
|
||||||
JournalEntry::JournalEntry (const std::string& topic, const std::string& infoId)
|
JournalEntry::JournalEntry (const std::string& topic, const std::string& infoId)
|
||||||
: mTopic (topic), mInfoId (infoId)
|
: mTopic (topic), mInfoId (infoId)
|
||||||
{}
|
|
||||||
|
|
||||||
std::string JournalEntry::getText (const MWWorld::ESMStore& store) const
|
|
||||||
{
|
{
|
||||||
const ESM::Dialogue *dialogue =
|
const ESM::Dialogue *dialogue =
|
||||||
store.get<ESM::Dialogue>().find (mTopic);
|
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)
|
||||||
if (iter->mId == mInfoId)
|
if (iter->mId == mInfoId)
|
||||||
return iter->mResponse;
|
{
|
||||||
|
/// \todo text replacement
|
||||||
|
mText = iter->mResponse;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
throw std::runtime_error ("unknown info ID " + mInfoId + " for topic " + mTopic);
|
throw std::runtime_error ("unknown info ID " + mInfoId + " for topic " + mTopic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string JournalEntry::getText (const MWWorld::ESMStore& store) const
|
||||||
|
{
|
||||||
|
return mText;
|
||||||
|
}
|
||||||
|
|
||||||
JournalEntry JournalEntry::makeFromQuest (const std::string& topic, int index)
|
JournalEntry JournalEntry::makeFromQuest (const std::string& topic, int index)
|
||||||
{
|
{
|
||||||
return JournalEntry (topic, idFromIndex (topic, index));
|
return JournalEntry (topic, idFromIndex (topic, index));
|
||||||
|
|
|
@ -15,6 +15,7 @@ namespace MWDialogue
|
||||||
{
|
{
|
||||||
std::string mTopic;
|
std::string mTopic;
|
||||||
std::string mInfoId;
|
std::string mInfoId;
|
||||||
|
std::string mText;
|
||||||
|
|
||||||
JournalEntry();
|
JournalEntry();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue