mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-18 13:12:50 +00:00
Added "Persistent" column to references table.
This commit is contained in:
parent
024ad3276b
commit
f6eab52a1b
@ -1429,6 +1429,33 @@ namespace CSMWorld
|
||||
}
|
||||
};
|
||||
|
||||
template<typename ESXRecordT>
|
||||
struct PersistentColumn : public Column<ESXRecordT>
|
||||
{
|
||||
PersistentColumn()
|
||||
: Column<ESXRecordT> (Columns::ColumnId_Persistent, ColumnBase::Display_Boolean)
|
||||
{}
|
||||
|
||||
QVariant get (const Record<ESXRecordT>& record) const override
|
||||
{
|
||||
return record.get().mIsPersistent;
|
||||
}
|
||||
|
||||
void set (Record<ESXRecordT>& record, const QVariant& data) override
|
||||
{
|
||||
ESXRecordT record2 = record.get();
|
||||
|
||||
record2.mIsPersistent = data.toInt();
|
||||
|
||||
record.setModified (record2);
|
||||
}
|
||||
|
||||
bool isEditable() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename ESXRecordT>
|
||||
struct QuestStatusTypeColumn : public Column<ESXRecordT>
|
||||
{
|
||||
|
@ -371,6 +371,8 @@ namespace CSMWorld
|
||||
{ ColumnId_Skill6, "Skill 6" },
|
||||
{ ColumnId_Skill7, "Skill 7" },
|
||||
|
||||
{ ColumnId_Persistent, "Persistent" },
|
||||
|
||||
{ -1, 0 } // end marker
|
||||
};
|
||||
}
|
||||
|
@ -343,6 +343,8 @@ namespace CSMWorld
|
||||
ColumnId_FactionAttrib1 = 311,
|
||||
ColumnId_FactionAttrib2 = 312,
|
||||
|
||||
ColumnId_Persistent = 313,
|
||||
|
||||
// Allocated to a separate value range, so we don't get a collision should we ever need
|
||||
// to extend the number of use values.
|
||||
ColumnId_UseValue1 = 0x10000,
|
||||
|
@ -528,6 +528,7 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, bool fsStrict, const Files::Pat
|
||||
mRefs.addColumn (new TrapColumn<CellRef>);
|
||||
mRefs.addColumn (new OwnerGlobalColumn<CellRef>);
|
||||
mRefs.addColumn (new RefNumColumn<CellRef>);
|
||||
mRefs.addColumn (new PersistentColumn<CellRef>);
|
||||
|
||||
mFilters.addColumn (new StringIdColumn<ESM::Filter>);
|
||||
mFilters.addColumn (new RecordStateColumn<ESM::Filter>);
|
||||
|
Loading…
Reference in New Issue
Block a user