mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 23:15:32 +00:00
added type column to gmst table
This commit is contained in:
parent
d5dd0640c7
commit
cce2d63433
2 changed files with 25 additions and 1 deletions
|
@ -91,6 +91,29 @@ namespace CSMWorld
|
|||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename ESXRecordT>
|
||||
struct VarTypeColumn : public Column<ESXRecordT>
|
||||
{
|
||||
VarTypeColumn() : Column<ESXRecordT> ("Type", ColumnBase::Display_Float) {}
|
||||
|
||||
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 base = record.getBase();
|
||||
base.mType = static_cast<ESM::VarType> (data.toInt());
|
||||
record.setModified (base);
|
||||
}
|
||||
|
||||
virtual bool isEditable() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
|
@ -31,7 +31,8 @@ CSMWorld::Data::Data()
|
|||
mGmsts.addColumn (new StringIdColumn<ESM::GameSetting>);
|
||||
mGmsts.addColumn (new RecordStateColumn<ESM::GameSetting>);
|
||||
mGmsts.addColumn (new FixedRecordTypeColumn<ESM::GameSetting> (UniversalId::Type_Gmst));
|
||||
///< \todo add type and value
|
||||
mGmsts.addColumn (new VarTypeColumn<ESM::GameSetting>);
|
||||
///< \todo add value
|
||||
|
||||
addModel (new IdTable (&mGlobals), UniversalId::Type_Globals, UniversalId::Type_Global);
|
||||
addModel (new IdTable (&mGmsts), UniversalId::Type_Gmsts, UniversalId::Type_Gmst);
|
||||
|
|
Loading…
Reference in a new issue