mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
added dialogue type column to topics table
This commit is contained in:
parent
adf3a41a83
commit
75c5316ad7
6 changed files with 40 additions and 2 deletions
|
@ -43,7 +43,8 @@ namespace CSMWorld
|
|||
Display_CreatureType,
|
||||
Display_WeaponType,
|
||||
Display_RecordState,
|
||||
Display_RefRecordType
|
||||
Display_RefRecordType,
|
||||
Display_DialogueType
|
||||
};
|
||||
|
||||
int mColumnId;
|
||||
|
|
|
@ -1284,6 +1284,33 @@ namespace CSMWorld
|
|||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename ESXRecordT>
|
||||
struct DialogueTypeColumn : public Column<ESXRecordT>
|
||||
{
|
||||
DialogueTypeColumn()
|
||||
: Column<ESXRecordT> (Columns::ColumnId_DialogueType, ColumnBase::Display_DialogueType)
|
||||
{}
|
||||
|
||||
virtual QVariant get (const Record<ESXRecordT>& record) const
|
||||
{
|
||||
return static_cast<int> (record.get().mType);
|
||||
}
|
||||
|
||||
virtual void set (Record<ESXRecordT>& record, const QVariant& data)
|
||||
{
|
||||
ESXRecordT record2 = record.get();
|
||||
|
||||
record2.mType = data.toInt();
|
||||
|
||||
record.setModified (record2);
|
||||
}
|
||||
|
||||
virtual bool isEditable() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -159,6 +159,7 @@ namespace CSMWorld
|
|||
{ ColumnId_DoorPositionXRot, "Teleport Rot X" },
|
||||
{ ColumnId_DoorPositionYRot, "Teleport Rot Y" },
|
||||
{ ColumnId_DoorPositionZRot, "Teleport Rot Z" },
|
||||
{ ColumnId_DialogueType, "Dialogue Type" },
|
||||
|
||||
{ ColumnId_UseValue1, "Use value 1" },
|
||||
{ ColumnId_UseValue2, "Use value 2" },
|
||||
|
@ -269,6 +270,11 @@ namespace
|
|||
"unknown", "none", "short", "integer", "long", "float", "string", 0
|
||||
};
|
||||
|
||||
static const char *sDialogueTypeEnums[] =
|
||||
{
|
||||
"Topic", "Voice", "Greeting", "Persuasion", 0
|
||||
};
|
||||
|
||||
const char **getEnumNames (CSMWorld::Columns::ColumnId column)
|
||||
{
|
||||
switch (column)
|
||||
|
@ -283,6 +289,7 @@ namespace
|
|||
case CSMWorld::Columns::ColumnId_WeaponType: return sWeaponTypes;
|
||||
case CSMWorld::Columns::ColumnId_Modification: return sModificationEnums;
|
||||
case CSMWorld::Columns::ColumnId_ValueType: return sVarTypeEnums;
|
||||
case CSMWorld::Columns::ColumnId_DialogueType: return sDialogueTypeEnums;
|
||||
|
||||
default: return 0;
|
||||
}
|
||||
|
|
|
@ -152,6 +152,7 @@ namespace CSMWorld
|
|||
ColumnId_DoorPositionXRot = 139,
|
||||
ColumnId_DoorPositionYRot = 140,
|
||||
ColumnId_DoorPositionZRot = 141,
|
||||
ColumnId_DialogueType = 142,
|
||||
|
||||
// Allocated to a separate value range, so we don't get a collision should we ever need
|
||||
// to extend the number of use values.
|
||||
|
|
|
@ -143,6 +143,7 @@ CSMWorld::Data::Data() : mRefs (mCells)
|
|||
|
||||
mTopics.addColumn (new StringIdColumn<ESM::Dialogue>);
|
||||
mTopics.addColumn (new RecordStateColumn<ESM::Dialogue>);
|
||||
mTopics.addColumn (new DialogueTypeColumn<ESM::Dialogue>);
|
||||
|
||||
mJournals.addColumn (new StringIdColumn<ESM::Dialogue>);
|
||||
mJournals.addColumn (new RecordStateColumn<ESM::Dialogue>);
|
||||
|
|
|
@ -74,7 +74,8 @@ CSVDoc::ViewManager::ViewManager (CSMDoc::DocumentManager& documentManager)
|
|||
{ CSMWorld::ColumnBase::Display_ArmorType, CSMWorld::Columns::ColumnId_ArmorType, false },
|
||||
{ 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_WeaponType, CSMWorld::Columns::ColumnId_WeaponType, false },
|
||||
{ CSMWorld::ColumnBase::Display_DialogueType, CSMWorld::Columns::ColumnId_DialogueType, false }
|
||||
};
|
||||
|
||||
for (std::size_t i=0; i<sizeof (sMapping)/sizeof (Mapping); ++i)
|
||||
|
|
Loading…
Reference in a new issue