mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
added refnum column to references tables
This commit is contained in:
parent
f5483e76cf
commit
90b45e09f7
4 changed files with 40 additions and 0 deletions
|
@ -1944,6 +1944,43 @@ namespace CSMWorld
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool isUserEditable() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename ESXRecordT>
|
||||
struct RefNumColumn : public Column<ESXRecordT>
|
||||
{
|
||||
RefNumColumn()
|
||||
: Column<ESXRecordT> (Columns::ColumnId_RefNum, ColumnBase::Display_Integer, 0)
|
||||
{}
|
||||
|
||||
virtual QVariant get (const Record<ESXRecordT>& record) const
|
||||
{
|
||||
return static_cast<int> (record.get().mRefNum.mIndex);
|
||||
}
|
||||
|
||||
virtual void set (Record<ESXRecordT>& record, const QVariant& data)
|
||||
{
|
||||
ESXRecordT record2 = record.get();
|
||||
|
||||
record2.mRefNum.mIndex = data.toInt();
|
||||
|
||||
record.setModified (record2);
|
||||
}
|
||||
|
||||
virtual bool isEditable() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool isUserEditable() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -185,6 +185,7 @@ namespace CSMWorld
|
|||
{ ColumnId_BypassNewGame, "Bypass New Game" },
|
||||
{ ColumnId_GlobalProfile, "Global Profile" },
|
||||
{ ColumnId_RefNumCounter, "RefNum Counter" },
|
||||
{ ColumnId_RefNum, "RefNum" },
|
||||
|
||||
{ ColumnId_UseValue1, "Use value 1" },
|
||||
{ ColumnId_UseValue2, "Use value 2" },
|
||||
|
|
|
@ -178,6 +178,7 @@ namespace CSMWorld
|
|||
ColumnId_BypassNewGame = 166,
|
||||
ColumnId_GlobalProfile = 167,
|
||||
ColumnId_RefNumCounter = 168,
|
||||
ColumnId_RefNum = 169,
|
||||
|
||||
// Allocated to a separate value range, so we don't get a collision should we ever need
|
||||
// to extend the number of use values.
|
||||
|
|
|
@ -252,6 +252,7 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc
|
|||
mRefs.addColumn (new KeyColumn<CellRef>);
|
||||
mRefs.addColumn (new TrapColumn<CellRef>);
|
||||
mRefs.addColumn (new OwnerGlobalColumn<CellRef>);
|
||||
mRefs.addColumn (new RefNumColumn<CellRef>);
|
||||
|
||||
mFilters.addColumn (new StringIdColumn<ESM::Filter>);
|
||||
mFilters.addColumn (new RecordStateColumn<ESM::Filter>);
|
||||
|
|
Loading…
Reference in a new issue