mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
added original cell column to reference table
This commit is contained in:
parent
3b534326ff
commit
ba7b74217b
6 changed files with 37 additions and 0 deletions
|
@ -903,6 +903,38 @@ namespace CSMWorld
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename ESXRecordT>
|
||||||
|
struct OriginalCellColumn : public Column<ESXRecordT>
|
||||||
|
{
|
||||||
|
OriginalCellColumn()
|
||||||
|
: Column<ESXRecordT> (Columns::ColumnId_OriginalCell, ColumnBase::Display_Cell)
|
||||||
|
{}
|
||||||
|
|
||||||
|
virtual QVariant get (const Record<ESXRecordT>& record) const
|
||||||
|
{
|
||||||
|
return QString::fromUtf8 (record.get().mOriginalCell.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void set (Record<ESXRecordT>& record, const QVariant& data)
|
||||||
|
{
|
||||||
|
ESXRecordT record2 = record.get();
|
||||||
|
|
||||||
|
record2.mOriginalCell = data.toString().toUtf8().constData();
|
||||||
|
|
||||||
|
record.setModified (record2);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual bool isEditable() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual bool isUserEditable() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template<typename ESXRecordT>
|
template<typename ESXRecordT>
|
||||||
struct IdColumn : public Column<ESXRecordT>
|
struct IdColumn : public Column<ESXRecordT>
|
||||||
{
|
{
|
||||||
|
|
|
@ -201,6 +201,7 @@ namespace CSMWorld
|
||||||
{ ColumnId_HitSound, "Hit Sound" },
|
{ ColumnId_HitSound, "Hit Sound" },
|
||||||
{ ColumnId_AreaSound, "Area Sound" },
|
{ ColumnId_AreaSound, "Area Sound" },
|
||||||
{ ColumnId_BoltSound, "Bolt Sound" },
|
{ ColumnId_BoltSound, "Bolt Sound" },
|
||||||
|
{ ColumnId_OriginalCell, "Original Cell" },
|
||||||
|
|
||||||
{ ColumnId_UseValue1, "Use value 1" },
|
{ ColumnId_UseValue1, "Use value 1" },
|
||||||
{ ColumnId_UseValue2, "Use value 2" },
|
{ ColumnId_UseValue2, "Use value 2" },
|
||||||
|
|
|
@ -194,6 +194,7 @@ namespace CSMWorld
|
||||||
ColumnId_HitSound = 178,
|
ColumnId_HitSound = 178,
|
||||||
ColumnId_AreaSound = 179,
|
ColumnId_AreaSound = 179,
|
||||||
ColumnId_BoltSound = 180,
|
ColumnId_BoltSound = 180,
|
||||||
|
ColumnId_OriginalCell = 181,
|
||||||
// Allocated to a separate value range, so we don't get a collision should we ever need
|
// Allocated to a separate value range, so we don't get a collision should we ever need
|
||||||
// to extend the number of use values.
|
// to extend the number of use values.
|
||||||
ColumnId_UseValue1 = 0x10000,
|
ColumnId_UseValue1 = 0x10000,
|
||||||
|
|
|
@ -258,6 +258,7 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc
|
||||||
mRefs.addColumn (new RecordStateColumn<CellRef>);
|
mRefs.addColumn (new RecordStateColumn<CellRef>);
|
||||||
mRefs.addColumn (new FixedRecordTypeColumn<CellRef> (UniversalId::Type_Reference));
|
mRefs.addColumn (new FixedRecordTypeColumn<CellRef> (UniversalId::Type_Reference));
|
||||||
mRefs.addColumn (new CellColumn<CellRef> (true));
|
mRefs.addColumn (new CellColumn<CellRef> (true));
|
||||||
|
mRefs.addColumn (new OriginalCellColumn<CellRef>);
|
||||||
mRefs.addColumn (new IdColumn<CellRef>);
|
mRefs.addColumn (new IdColumn<CellRef>);
|
||||||
mRefs.addColumn (new PosColumn<CellRef> (&CellRef::mPos, 0, false));
|
mRefs.addColumn (new PosColumn<CellRef> (&CellRef::mPos, 0, false));
|
||||||
mRefs.addColumn (new PosColumn<CellRef> (&CellRef::mPos, 1, false));
|
mRefs.addColumn (new PosColumn<CellRef> (&CellRef::mPos, 1, false));
|
||||||
|
|
|
@ -12,6 +12,7 @@ namespace CSMWorld
|
||||||
{
|
{
|
||||||
std::string mId;
|
std::string mId;
|
||||||
std::string mCell;
|
std::string mCell;
|
||||||
|
std::string mOriginalCell;
|
||||||
|
|
||||||
CellRef();
|
CellRef();
|
||||||
};
|
};
|
||||||
|
|
|
@ -23,6 +23,7 @@ void CSMWorld::RefCollection::load (ESM::ESMReader& reader, int cellIndex, bool
|
||||||
|
|
||||||
while (ESM::Cell::getNextRef (reader, ref, deleted))
|
while (ESM::Cell::getNextRef (reader, ref, deleted))
|
||||||
{
|
{
|
||||||
|
ref.mOriginalCell = cell2.mId;
|
||||||
ref.mCell = cell2.mId;
|
ref.mCell = cell2.mId;
|
||||||
|
|
||||||
/// \todo handle moved references
|
/// \todo handle moved references
|
||||||
|
|
Loading…
Reference in a new issue