added is-playable column to class

pull/16/head
Marc Zinnschlag 12 years ago
parent ea3b14f2d2
commit 82f1cee116

@ -33,7 +33,8 @@ namespace CSMWorld
Display_GmstVarType,
Display_GlobalVarType,
Display_Specialisation,
Display_Attribute
Display_Attribute,
Display_Boolean
};
std::string mTitle;

@ -384,6 +384,31 @@ namespace CSMWorld
return true;
}
};
template<typename ESXRecordT>
struct PlayableColumn : public Column<ESXRecordT>
{
PlayableColumn() : Column<ESXRecordT> ("Playable", ColumnBase::Display_Boolean) {}
virtual QVariant get (const Record<ESXRecordT>& record) const
{
return record.get().mData.mIsPlayable!=0;
}
virtual void set (Record<ESXRecordT>& record, const QVariant& data)
{
ESXRecordT record2 = record.get();
record2.mData.mIsPlayable = data.toInt();
record.setModified (record2);
}
virtual bool isEditable() const
{
return true;
}
};
}
#endif

@ -54,6 +54,7 @@ CSMWorld::Data::Data()
mClasses.addColumn (new SkillsColumn<ESM::Class> (i, true));
for (int i=0; i<5; ++i)
mClasses.addColumn (new SkillsColumn<ESM::Class> (i, false));
mClasses.addColumn (new PlayableColumn<ESM::Class>);
mClasses.addColumn (new DescriptionColumn<ESM::Class>);
addModel (new IdTable (&mGlobals), UniversalId::Type_Globals, UniversalId::Type_Global);

Loading…
Cancel
Save