mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 06:53:52 +00:00
added specialisation column to skill table
This commit is contained in:
parent
92f0098911
commit
0ce962e815
4 changed files with 36 additions and 1 deletions
|
@ -31,7 +31,8 @@ namespace CSMWorld
|
||||||
Display_Float,
|
Display_Float,
|
||||||
Display_Var,
|
Display_Var,
|
||||||
Display_GmstVarType,
|
Display_GmstVarType,
|
||||||
Display_GlobalVarType
|
Display_GlobalVarType,
|
||||||
|
Display_Specialisation
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string mTitle;
|
std::string mTitle;
|
||||||
|
|
|
@ -202,6 +202,31 @@ namespace CSMWorld
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename ESXRecordT>
|
||||||
|
struct SpecialisationColumn : public Column<ESXRecordT>
|
||||||
|
{
|
||||||
|
SpecialisationColumn() : Column<ESXRecordT> ("Specialisation", ColumnBase::Display_Specialisation) {}
|
||||||
|
|
||||||
|
virtual QVariant get (const Record<ESXRecordT>& record) const
|
||||||
|
{
|
||||||
|
return record.get().mData.mSpecialization;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void set (Record<ESXRecordT>& record, const QVariant& data)
|
||||||
|
{
|
||||||
|
ESXRecordT record2 = record.get();
|
||||||
|
|
||||||
|
record2.mData.mSpecialization = data.toInt();
|
||||||
|
|
||||||
|
record.setModified (record2);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual bool isEditable() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -38,6 +38,7 @@ 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 SpecialisationColumn<ESM::Skill>);
|
||||||
|
|
||||||
mSkills.addColumn (new DescriptionColumn<ESM::Skill>);
|
mSkills.addColumn (new DescriptionColumn<ESM::Skill>);
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,11 @@ void CSVDoc::ViewManager::updateIndices()
|
||||||
CSVDoc::ViewManager::ViewManager (CSMDoc::DocumentManager& documentManager)
|
CSVDoc::ViewManager::ViewManager (CSMDoc::DocumentManager& documentManager)
|
||||||
: mDocumentManager (documentManager), mExitOnSaveStateChange(false), mUserWarned(false)
|
: mDocumentManager (documentManager), mExitOnSaveStateChange(false), mUserWarned(false)
|
||||||
{
|
{
|
||||||
|
static const char *sSpecialisations[] =
|
||||||
|
{
|
||||||
|
"Combat", "Magic", "Stealth", 0
|
||||||
|
};
|
||||||
|
|
||||||
mDelegateFactories = new CSVWorld::CommandDelegateFactoryCollection;
|
mDelegateFactories = new CSVWorld::CommandDelegateFactoryCollection;
|
||||||
|
|
||||||
mDelegateFactories->add (CSMWorld::ColumnBase::Display_GmstVarType,
|
mDelegateFactories->add (CSMWorld::ColumnBase::Display_GmstVarType,
|
||||||
|
@ -45,6 +50,9 @@ CSVDoc::ViewManager::ViewManager (CSMDoc::DocumentManager& documentManager)
|
||||||
|
|
||||||
mDelegateFactories->add (CSMWorld::ColumnBase::Display_GlobalVarType,
|
mDelegateFactories->add (CSMWorld::ColumnBase::Display_GlobalVarType,
|
||||||
new CSVWorld::VarTypeDelegateFactory (ESM::VT_Short, ESM::VT_Long, ESM::VT_Float));
|
new CSVWorld::VarTypeDelegateFactory (ESM::VT_Short, ESM::VT_Long, ESM::VT_Float));
|
||||||
|
|
||||||
|
mDelegateFactories->add (CSMWorld::ColumnBase::Display_Specialisation,
|
||||||
|
new CSVWorld::EnumDelegateFactory (sSpecialisations));
|
||||||
}
|
}
|
||||||
|
|
||||||
CSVDoc::ViewManager::~ViewManager()
|
CSVDoc::ViewManager::~ViewManager()
|
||||||
|
|
Loading…
Reference in a new issue