forked from teamnwah/openmw-tes3coop
added sleeplist column to region table
This commit is contained in:
parent
f49a2a97c5
commit
c9424f577f
2 changed files with 26 additions and 0 deletions
|
@ -625,6 +625,31 @@ namespace CSMWorld
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename ESXRecordT>
|
||||||
|
struct SleepListColumn : public Column<ESXRecordT>
|
||||||
|
{
|
||||||
|
SleepListColumn() : Column<ESXRecordT> ("Sleep Encounter", ColumnBase::Display_String) {}
|
||||||
|
|
||||||
|
virtual QVariant get (const Record<ESXRecordT>& record) const
|
||||||
|
{
|
||||||
|
return QString::fromUtf8 (record.get().mSleepList.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void set (Record<ESXRecordT>& record, const QVariant& data)
|
||||||
|
{
|
||||||
|
ESXRecordT record2 = record.get();
|
||||||
|
|
||||||
|
record2.mSleepList = data.toString().toUtf8().constData();
|
||||||
|
|
||||||
|
record.setModified (record2);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual bool isEditable() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -91,6 +91,7 @@ CSMWorld::Data::Data()
|
||||||
mRegions.addColumn (new RecordStateColumn<ESM::Region>);
|
mRegions.addColumn (new RecordStateColumn<ESM::Region>);
|
||||||
mRegions.addColumn (new NameColumn<ESM::Region>);
|
mRegions.addColumn (new NameColumn<ESM::Region>);
|
||||||
mRegions.addColumn (new MapColourColumn<ESM::Region>);
|
mRegions.addColumn (new MapColourColumn<ESM::Region>);
|
||||||
|
mRegions.addColumn (new SleepListColumn<ESM::Region>);
|
||||||
|
|
||||||
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);
|
||||||
|
|
Loading…
Reference in a new issue