@ -1395,6 +1395,36 @@ namespace CSMWorld
return true;
}
};
template<typename ESXRecordT>
struct TopicColumn : public Column<ESXRecordT>
{
TopicColumn (bool journal) : Column<ESXRecordT> (journal ? Columns::ColumnId_Journal : Columns::ColumnId_Topic, ColumnBase::Display_String) {}
virtual QVariant get (const Record<ESXRecordT>& record) const
return QString::fromUtf8 (record.get().mTopicId.c_str());
virtual void set (Record<ESXRecordT>& record, const QVariant& data)
ESXRecordT record2 = record.get();
record2.mTopicId = data.toString().toUtf8().constData();
record.setModified (record2);
virtual bool isEditable() const
virtual bool isUserEditable() const
return false;
#endif
@ -163,6 +163,8 @@ namespace CSMWorld
{ ColumnId_QuestIndex, "Quest Index" },
{ ColumnId_QuestStatusType, "Quest Status" },
{ ColumnId_QuestDescription, "Quest Description" },
{ ColumnId_Topic, "Topic" },
{ ColumnId_Journal, "Journal", },
{ ColumnId_UseValue1, "Use value 1" },
{ ColumnId_UseValue2, "Use value 2" },
@ -156,6 +156,8 @@ namespace CSMWorld
ColumnId_QuestIndex = 143,
ColumnId_QuestStatusType = 144,
ColumnId_QuestDescription = 145,
ColumnId_Topic = 146,
ColumnId_Journal = 147,
// Allocated to a separate value range, so we don't get a collision should we ever need
// to extend the number of use values.
@ -151,9 +151,11 @@ CSMWorld::Data::Data() : mRefs (mCells)
mTopicInfos.addColumn (new StringIdColumn<Info>);
mTopicInfos.addColumn (new RecordStateColumn<Info>);
mTopicInfos.addColumn (new TopicColumn<Info> (false));
mJournalInfos.addColumn (new StringIdColumn<Info>);
mJournalInfos.addColumn (new RecordStateColumn<Info>);
mJournalInfos.addColumn (new TopicColumn<Info> (true));
mJournalInfos.addColumn (new QuestStatusTypeColumn<Info>);
mJournalInfos.addColumn (new QuestIndexColumn<Info>);
mJournalInfos.addColumn (new QuestDescriptionColumn<Info>);