forked from mirror/openmw-tes3mp
added description column to skill table
This commit is contained in:
parent
fefe061294
commit
8e472cc624
2 changed files with 27 additions and 0 deletions
|
@ -177,6 +177,31 @@ namespace CSMWorld
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename ESXRecordT>
|
||||||
|
struct DescriptionColumn : public Column<ESXRecordT>
|
||||||
|
{
|
||||||
|
DescriptionColumn() : Column<ESXRecordT> ("Description", ColumnBase::Display_String) {}
|
||||||
|
|
||||||
|
virtual QVariant get (const Record<ESXRecordT>& record) const
|
||||||
|
{
|
||||||
|
return QString::fromUtf8 (record.get().mDescription.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void set (Record<ESXRecordT>& record, const QVariant& data)
|
||||||
|
{
|
||||||
|
ESXRecordT record2 = record.get();
|
||||||
|
|
||||||
|
record2.mDescription = data.toString().toUtf8().constData();
|
||||||
|
|
||||||
|
record.setModified (record2);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual bool isEditable() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -39,6 +39,8 @@ CSMWorld::Data::Data()
|
||||||
mSkills.addColumn (new StringIdColumn<ESM::Skill>);
|
mSkills.addColumn (new StringIdColumn<ESM::Skill>);
|
||||||
mSkills.addColumn (new RecordStateColumn<ESM::Skill>);
|
mSkills.addColumn (new RecordStateColumn<ESM::Skill>);
|
||||||
|
|
||||||
|
mSkills.addColumn (new DescriptionColumn<ESM::Skill>);
|
||||||
|
|
||||||
addModel (new IdTable (&mGlobals), UniversalId::Type_Globals, UniversalId::Type_Global);
|
addModel (new IdTable (&mGlobals), UniversalId::Type_Globals, UniversalId::Type_Global);
|
||||||
addModel (new IdTable (&mGmsts), UniversalId::Type_Gmsts, UniversalId::Type_Gmst);
|
addModel (new IdTable (&mGmsts), UniversalId::Type_Gmsts, UniversalId::Type_Gmst);
|
||||||
addModel (new IdTable (&mSkills), UniversalId::Type_Skills, UniversalId::Type_Skill);
|
addModel (new IdTable (&mSkills), UniversalId::Type_Skills, UniversalId::Type_Skill);
|
||||||
|
|
Loading…
Reference in a new issue