mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-07 03:54:40 +00:00
use Entry instead of plain string for topic and quest entries
This commit is contained in:
parent
b273f9e387
commit
0f971163f7
@ -82,9 +82,9 @@ namespace MWDialogue
|
||||
setIndex (index);
|
||||
|
||||
for (TEntryIter iter (mEntries.begin()); iter!=mEntries.end(); ++iter)
|
||||
if (*iter==entry.mInfoId)
|
||||
if (iter->mInfoId==entry.mInfoId)
|
||||
return;
|
||||
|
||||
mEntries.push_back (entry.mInfoId);
|
||||
mEntries.push_back (entry); // we want slicing here
|
||||
}
|
||||
}
|
||||
|
@ -24,11 +24,7 @@ namespace MWDialogue
|
||||
if (entry.mTopic!=mTopic)
|
||||
throw std::runtime_error ("topic does not match: " + mTopic);
|
||||
|
||||
for (TEntryIter iter = begin(); iter!=end(); ++iter)
|
||||
if (*iter==entry.mInfoId)
|
||||
return;
|
||||
|
||||
mEntries.push_back (entry.mInfoId);
|
||||
mEntries.push_back (entry); // we want slicing here
|
||||
}
|
||||
|
||||
std::string Topic::getName() const
|
||||
|
@ -13,14 +13,14 @@ namespace MWDialogue
|
||||
{
|
||||
public:
|
||||
|
||||
typedef std::vector<std::string> TEntryContainer;
|
||||
typedef std::vector<Entry> TEntryContainer;
|
||||
typedef TEntryContainer::const_iterator TEntryIter;
|
||||
|
||||
protected:
|
||||
|
||||
std::string mTopic;
|
||||
std::string mName;
|
||||
TEntryContainer mEntries; // info-IDs
|
||||
TEntryContainer mEntries;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -268,7 +268,7 @@ struct JournalViewModelImpl : JournalViewModel
|
||||
{
|
||||
for (MWDialogue::Topic::TEntryIter j = quest->begin (); j != quest->end (); ++j)
|
||||
{
|
||||
if (i->mInfoId == *j)
|
||||
if (i->mInfoId == j->mInfoId)
|
||||
visitor (JournalEntryImpl <MWBase::Journal::TEntryIter> (this, i));
|
||||
}
|
||||
}
|
||||
@ -317,7 +317,7 @@ struct JournalViewModelImpl : JournalViewModel
|
||||
|
||||
std::string getText () const
|
||||
{
|
||||
return mTopic.getEntry (*itr).getText();
|
||||
return itr->getText();
|
||||
}
|
||||
|
||||
Utf8Span source () const
|
||||
|
Loading…
Reference in New Issue
Block a user