1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 19:19:56 +00:00

forbid manual editing of the cell field in reference records

This commit is contained in:
Marc Zinnschlag 2015-01-05 15:04:11 +01:00
parent ac7c2a1473
commit 3b534326ff
2 changed files with 9 additions and 3 deletions

View file

@ -870,7 +870,13 @@ namespace CSMWorld
template<typename ESXRecordT>
struct CellColumn : public Column<ESXRecordT>
{
CellColumn() : Column<ESXRecordT> (Columns::ColumnId_Cell, ColumnBase::Display_Cell) {}
bool mBlocked;
/// \param blocked Do not allow user-modification
CellColumn (bool blocked = false)
: Column<ESXRecordT> (Columns::ColumnId_Cell, ColumnBase::Display_Cell),
mBlocked (blocked)
{}
virtual QVariant get (const Record<ESXRecordT>& record) const
{
@ -893,7 +899,7 @@ namespace CSMWorld
virtual bool isUserEditable() const
{
return true;
return !mBlocked;
}
};

View file

@ -257,7 +257,7 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc
mRefs.addColumn (new StringIdColumn<CellRef> (true));
mRefs.addColumn (new RecordStateColumn<CellRef>);
mRefs.addColumn (new FixedRecordTypeColumn<CellRef> (UniversalId::Type_Reference));
mRefs.addColumn (new CellColumn<CellRef>);
mRefs.addColumn (new CellColumn<CellRef> (true));
mRefs.addColumn (new IdColumn<CellRef>);
mRefs.addColumn (new PosColumn<CellRef> (&CellRef::mPos, 0, false));
mRefs.addColumn (new PosColumn<CellRef> (&CellRef::mPos, 1, false));