mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 20:23:54 +00:00
added basic class record table
This commit is contained in:
parent
f2969e7143
commit
c7275965b8
9 changed files with 48 additions and 3 deletions
|
@ -44,9 +44,15 @@ CSMWorld::Data::Data()
|
||||||
mSkills.addColumn (new UseValueColumn<ESM::Skill> (i));
|
mSkills.addColumn (new UseValueColumn<ESM::Skill> (i));
|
||||||
mSkills.addColumn (new DescriptionColumn<ESM::Skill>);
|
mSkills.addColumn (new DescriptionColumn<ESM::Skill>);
|
||||||
|
|
||||||
|
mClasses.addColumn (new StringIdColumn<ESM::Class>);
|
||||||
|
mClasses.addColumn (new RecordStateColumn<ESM::Class>);
|
||||||
|
mClasses.addColumn (new SpecialisationColumn<ESM::Class>);
|
||||||
|
mClasses.addColumn (new DescriptionColumn<ESM::Class>);
|
||||||
|
|
||||||
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);
|
||||||
|
addModel (new IdTable (&mClasses), UniversalId::Type_Classes, UniversalId::Type_Class);
|
||||||
}
|
}
|
||||||
|
|
||||||
CSMWorld::Data::~Data()
|
CSMWorld::Data::~Data()
|
||||||
|
@ -122,6 +128,7 @@ void CSMWorld::Data::loadFile (const boost::filesystem::path& path, bool base)
|
||||||
case ESM::REC_GLOB: mGlobals.load (reader, base); break;
|
case ESM::REC_GLOB: mGlobals.load (reader, base); break;
|
||||||
case ESM::REC_GMST: mGmsts.load (reader, base); break;
|
case ESM::REC_GMST: mGmsts.load (reader, base); break;
|
||||||
case ESM::REC_SKIL: mSkills.load (reader, base); break;
|
case ESM::REC_SKIL: mSkills.load (reader, base); break;
|
||||||
|
case ESM::REC_CLAS: mClasses.load (reader, base); break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <components/esm/loadglob.hpp>
|
#include <components/esm/loadglob.hpp>
|
||||||
#include <components/esm/loadgmst.hpp>
|
#include <components/esm/loadgmst.hpp>
|
||||||
#include <components/esm/loadskil.hpp>
|
#include <components/esm/loadskil.hpp>
|
||||||
|
#include <components/esm/loadclas.hpp>
|
||||||
|
|
||||||
#include "idcollection.hpp"
|
#include "idcollection.hpp"
|
||||||
#include "universalid.hpp"
|
#include "universalid.hpp"
|
||||||
|
@ -22,6 +23,7 @@ namespace CSMWorld
|
||||||
IdCollection<ESM::Global> mGlobals;
|
IdCollection<ESM::Global> mGlobals;
|
||||||
IdCollection<ESM::GameSetting> mGmsts;
|
IdCollection<ESM::GameSetting> mGmsts;
|
||||||
IdCollection<ESM::Skill> mSkills;
|
IdCollection<ESM::Skill> mSkills;
|
||||||
|
IdCollection<ESM::Class> mClasses;
|
||||||
std::vector<QAbstractItemModel *> mModels;
|
std::vector<QAbstractItemModel *> mModels;
|
||||||
std::map<UniversalId::Type, QAbstractItemModel *> mModelIndex;
|
std::map<UniversalId::Type, QAbstractItemModel *> mModelIndex;
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ namespace
|
||||||
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_Globals, "Global Variables" },
|
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_Globals, "Global Variables" },
|
||||||
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_Gmsts, "Game Settings" },
|
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_Gmsts, "Game Settings" },
|
||||||
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_Skills, "Skills" },
|
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_Skills, "Skills" },
|
||||||
|
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_Classes, "Classes" },
|
||||||
|
|
||||||
{ CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0 } // end marker
|
{ CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0 } // end marker
|
||||||
};
|
};
|
||||||
|
@ -29,6 +30,7 @@ namespace
|
||||||
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Global, "Global Variable" },
|
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Global, "Global Variable" },
|
||||||
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Gmst, "Game Setting" },
|
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Gmst, "Game Setting" },
|
||||||
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Skill, "Skill" },
|
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Skill, "Skill" },
|
||||||
|
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Class, "Class" },
|
||||||
|
|
||||||
{ CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0 } // end marker
|
{ CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0 } // end marker
|
||||||
};
|
};
|
||||||
|
|
|
@ -39,7 +39,9 @@ namespace CSMWorld
|
||||||
Type_Gmsts,
|
Type_Gmsts,
|
||||||
Type_Gmst,
|
Type_Gmst,
|
||||||
Type_Skills,
|
Type_Skills,
|
||||||
Type_Skill
|
Type_Skill,
|
||||||
|
Type_Classes,
|
||||||
|
Type_Class
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -90,6 +90,10 @@ void CSVDoc::View::setupWorldMenu()
|
||||||
connect (skills, SIGNAL (triggered()), this, SLOT (addSkillsSubView()));
|
connect (skills, SIGNAL (triggered()), this, SLOT (addSkillsSubView()));
|
||||||
world->addAction (skills);
|
world->addAction (skills);
|
||||||
|
|
||||||
|
QAction *classes = new QAction (tr ("Classes"), this);
|
||||||
|
connect (classes, SIGNAL (triggered()), this, SLOT (addClassesSubView()));
|
||||||
|
world->addAction (classes);
|
||||||
|
|
||||||
mVerify = new QAction (tr ("&Verify"), this);
|
mVerify = new QAction (tr ("&Verify"), this);
|
||||||
connect (mVerify, SIGNAL (triggered()), this, SLOT (verify()));
|
connect (mVerify, SIGNAL (triggered()), this, SLOT (verify()));
|
||||||
world->addAction (mVerify);
|
world->addAction (mVerify);
|
||||||
|
@ -253,6 +257,11 @@ void CSVDoc::View::addSkillsSubView()
|
||||||
addSubView (CSMWorld::UniversalId::Type_Skills);
|
addSubView (CSMWorld::UniversalId::Type_Skills);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSVDoc::View::addClassesSubView()
|
||||||
|
{
|
||||||
|
addSubView (CSMWorld::UniversalId::Type_Classes);
|
||||||
|
}
|
||||||
|
|
||||||
void CSVDoc::View::abortOperation (int type)
|
void CSVDoc::View::abortOperation (int type)
|
||||||
{
|
{
|
||||||
mDocument->abortOperation (type);
|
mDocument->abortOperation (type);
|
||||||
|
|
|
@ -117,6 +117,8 @@ namespace CSVDoc
|
||||||
void addGmstsSubView();
|
void addGmstsSubView();
|
||||||
|
|
||||||
void addSkillsSubView();
|
void addSkillsSubView();
|
||||||
|
|
||||||
|
void addClassesSubView();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,9 @@ void CSVWorld::addSubViewFactories (CSVDoc::SubViewFactoryManager& manager)
|
||||||
manager.add (CSMWorld::UniversalId::Type_Skills,
|
manager.add (CSMWorld::UniversalId::Type_Skills,
|
||||||
new CSVDoc::SubViewFactoryWithCreateFlag<TableSubView> (false));
|
new CSVDoc::SubViewFactoryWithCreateFlag<TableSubView> (false));
|
||||||
|
|
||||||
manager.add (CSMWorld::UniversalId::Type_Global,
|
manager.add (CSMWorld::UniversalId::Type_Classes,
|
||||||
new CSVDoc::SubViewFactoryWithCreateFlag<DialogueSubView> (true));
|
new CSVDoc::SubViewFactoryWithCreateFlag<TableSubView> (true));
|
||||||
|
|
||||||
|
// manager.add (CSMWorld::UniversalId::Type_Global,
|
||||||
|
// new CSVDoc::SubViewFactoryWithCreateFlag<DialogueSubView> (true));
|
||||||
}
|
}
|
|
@ -35,4 +35,18 @@ void Class::save(ESMWriter &esm)
|
||||||
esm.writeHNOString("DESC", mDescription);
|
esm.writeHNOString("DESC", mDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Class::blank()
|
||||||
|
{
|
||||||
|
mName.clear();
|
||||||
|
mDescription.clear();
|
||||||
|
|
||||||
|
mData.mAttribute[0] = mData.mAttribute[1] = 0;
|
||||||
|
mData.mSpecialization = 0;
|
||||||
|
mData.mIsPlayable = 0;
|
||||||
|
mData.mCalc = 0;
|
||||||
|
|
||||||
|
for (int i=0; i<5; ++i)
|
||||||
|
for (int i2=0; i2<2; ++i2)
|
||||||
|
mData.mSkills[i][i2] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,6 +65,10 @@ struct Class
|
||||||
|
|
||||||
void load(ESMReader &esm);
|
void load(ESMReader &esm);
|
||||||
void save(ESMWriter &esm);
|
void save(ESMWriter &esm);
|
||||||
|
|
||||||
|
void blank();
|
||||||
|
///< Set record to default state (does not touch the ID/index).
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue