added missing columns to journal info table

actorid
Marc Zinnschlag 11 years ago
parent 69f28ee4be
commit 767cb54e7c

@ -44,7 +44,8 @@ namespace CSMWorld
Display_WeaponType,
Display_RecordState,
Display_RefRecordType,
Display_DialogueType
Display_DialogueType,
Display_QuestStatusType
};
int mColumnId;

@ -1317,6 +1317,83 @@ namespace CSMWorld
return false;
}
};
template<typename ESXRecordT>
struct QuestStatusTypeColumn : public Column<ESXRecordT>
{
QuestStatusTypeColumn()
: Column<ESXRecordT> (Columns::ColumnId_QuestStatusType, ColumnBase::Display_QuestStatusType)
{}
virtual QVariant get (const Record<ESXRecordT>& record) const
{
return static_cast<int> (record.get().mQuestStatus);
}
virtual void set (Record<ESXRecordT>& record, const QVariant& data)
{
ESXRecordT record2 = record.get();
record2.mQuestStatus = static_cast<ESM::DialInfo::QuestStatus> (data.toInt());
record.setModified (record2);
}
virtual bool isEditable() const
{
return true;
}
};
template<typename ESXRecordT>
struct QuestDescriptionColumn : public Column<ESXRecordT>
{
QuestDescriptionColumn() : Column<ESXRecordT> (Columns::ColumnId_QuestDescription, ColumnBase::Display_String) {}
virtual QVariant get (const Record<ESXRecordT>& record) const
{
return QString::fromUtf8 (record.get().mResponse.c_str());
}
virtual void set (Record<ESXRecordT>& record, const QVariant& data)
{
ESXRecordT record2 = record.get();
record2.mResponse = data.toString().toUtf8().constData();
record.setModified (record2);
}
virtual bool isEditable() const
{
return true;
}
};
template<typename ESXRecordT>
struct QuestIndexColumn : public Column<ESXRecordT>
{
QuestIndexColumn()
: Column<ESXRecordT> (Columns::ColumnId_QuestIndex, ColumnBase::Display_Integer)
{}
virtual QVariant get (const Record<ESXRecordT>& record) const
{
return record.get().mData.mDisposition;
}
virtual void set (Record<ESXRecordT>& record, const QVariant& data)
{
ESXRecordT record2 = record.get();
record2.mData.mDisposition = data.toInt();
record.setModified (record2);
}
virtual bool isEditable() const
{
return true;
}
};
}
#endif

@ -160,6 +160,9 @@ namespace CSMWorld
{ ColumnId_DoorPositionYRot, "Teleport Rot Y" },
{ ColumnId_DoorPositionZRot, "Teleport Rot Z" },
{ ColumnId_DialogueType, "Dialogue Type" },
{ ColumnId_QuestIndex, "Quest Index" },
{ ColumnId_QuestStatusType, "Quest Status" },
{ ColumnId_QuestDescription, "Quest Description" },
{ ColumnId_UseValue1, "Use value 1" },
{ ColumnId_UseValue2, "Use value 2" },
@ -275,6 +278,11 @@ namespace
"Topic", "Voice", "Greeting", "Persuasion", 0
};
static const char *sQuestStatusTypes[] =
{
"None", "Name", "Finished", "Restart", 0
};
const char **getEnumNames (CSMWorld::Columns::ColumnId column)
{
switch (column)
@ -290,6 +298,7 @@ namespace
case CSMWorld::Columns::ColumnId_Modification: return sModificationEnums;
case CSMWorld::Columns::ColumnId_ValueType: return sVarTypeEnums;
case CSMWorld::Columns::ColumnId_DialogueType: return sDialogueTypeEnums;
case CSMWorld::Columns::ColumnId_QuestStatusType: return sQuestStatusTypes;
default: return 0;
}

@ -153,6 +153,9 @@ namespace CSMWorld
ColumnId_DoorPositionYRot = 140,
ColumnId_DoorPositionZRot = 141,
ColumnId_DialogueType = 142,
ColumnId_QuestIndex = 143,
ColumnId_QuestStatusType = 144,
ColumnId_QuestDescription = 145,
// Allocated to a separate value range, so we don't get a collision should we ever need
// to extend the number of use values.

@ -154,6 +154,9 @@ CSMWorld::Data::Data() : mRefs (mCells)
mJournalInfos.addColumn (new StringIdColumn<ESM::DialInfo>);
mJournalInfos.addColumn (new RecordStateColumn<ESM::DialInfo>);
mJournalInfos.addColumn (new QuestStatusTypeColumn<ESM::DialInfo>);
mJournalInfos.addColumn (new QuestIndexColumn<ESM::DialInfo>);
mJournalInfos.addColumn (new QuestDescriptionColumn<ESM::DialInfo>);
mCells.addColumn (new StringIdColumn<Cell>);
mCells.addColumn (new RecordStateColumn<Cell>);

@ -75,7 +75,8 @@ CSVDoc::ViewManager::ViewManager (CSMDoc::DocumentManager& documentManager)
{ CSMWorld::ColumnBase::Display_ClothingType, CSMWorld::Columns::ColumnId_ClothingType, false },
{ CSMWorld::ColumnBase::Display_CreatureType, CSMWorld::Columns::ColumnId_CreatureType, false },
{ CSMWorld::ColumnBase::Display_WeaponType, CSMWorld::Columns::ColumnId_WeaponType, false },
{ CSMWorld::ColumnBase::Display_DialogueType, CSMWorld::Columns::ColumnId_DialogueType, false }
{ CSMWorld::ColumnBase::Display_DialogueType, CSMWorld::Columns::ColumnId_DialogueType, false },
{ CSMWorld::ColumnBase::Display_QuestStatusType, CSMWorld::Columns::ColumnId_QuestStatusType, false }
};
for (std::size_t i=0; i<sizeof (sMapping)/sizeof (Mapping); ++i)

@ -48,10 +48,10 @@ struct DialInfo
// Journal quest indices (introduced with the quest system in Tribunal)
enum QuestStatus
{
QS_None,
QS_Name,
QS_Finished,
QS_Restart,
QS_None = 0,
QS_Name = 1,
QS_Finished = 2,
QS_Restart = 3,
QS_Deleted
};

Loading…
Cancel
Save