mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 10:23:52 +00:00
added debug profile record table
This commit is contained in:
parent
30f114873d
commit
4d49924025
7 changed files with 79 additions and 11 deletions
|
@ -258,6 +258,11 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc
|
|||
mFilters.addColumn (new DescriptionColumn<CSMFilter::Filter>);
|
||||
mFilters.addColumn (new ScopeColumn<CSMFilter::Filter>);
|
||||
|
||||
mDebugProfiles.addColumn (new StringIdColumn<ESM::DebugProfile>);
|
||||
mDebugProfiles.addColumn (new RecordStateColumn<ESM::DebugProfile>);
|
||||
mDebugProfiles.addColumn (new FixedRecordTypeColumn<ESM::DebugProfile> (UniversalId::Type_DebugProfile));
|
||||
mDebugProfiles.addColumn (new DescriptionColumn<ESM::DebugProfile>);
|
||||
|
||||
addModel (new IdTable (&mGlobals), UniversalId::Type_Global);
|
||||
addModel (new IdTable (&mGmsts), UniversalId::Type_Gmst);
|
||||
addModel (new IdTable (&mSkills), UniversalId::Type_Skill);
|
||||
|
@ -280,6 +285,7 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc
|
|||
UniversalId::Type_Referenceable);
|
||||
addModel (new IdTable (&mRefs, IdTable::Feature_ViewCell | IdTable::Feature_Preview), UniversalId::Type_Reference);
|
||||
addModel (new IdTable (&mFilters), UniversalId::Type_Filter);
|
||||
addModel (new IdTable (&mDebugProfiles), UniversalId::Type_DebugProfile);
|
||||
addModel (new ResourceTable (&mResourcesManager.get (UniversalId::Type_Mesh)),
|
||||
UniversalId::Type_Mesh);
|
||||
addModel (new ResourceTable (&mResourcesManager.get (UniversalId::Type_Icon)),
|
||||
|
@ -513,6 +519,16 @@ CSMWorld::IdCollection<ESM::BodyPart>& CSMWorld::Data::getBodyParts()
|
|||
return mBodyParts;
|
||||
}
|
||||
|
||||
const CSMWorld::IdCollection<ESM::DebugProfile>& CSMWorld::Data::getDebugProfiles() const
|
||||
{
|
||||
return mDebugProfiles;
|
||||
}
|
||||
|
||||
CSMWorld::IdCollection<ESM::DebugProfile>& CSMWorld::Data::getDebugProfiles()
|
||||
{
|
||||
return mDebugProfiles;
|
||||
}
|
||||
|
||||
const CSMWorld::Resources& CSMWorld::Data::getResources (const UniversalId& id) const
|
||||
{
|
||||
return mResourcesManager.get (UniversalId::getParentType (id.getType()));
|
||||
|
@ -582,6 +598,8 @@ bool CSMWorld::Data::continueLoading (CSMDoc::Stage::Messages& messages)
|
|||
ESM::NAME n = mReader->getRecName();
|
||||
mReader->getRecHeader();
|
||||
|
||||
bool unhandledRecord = false;
|
||||
|
||||
switch (n.val)
|
||||
{
|
||||
case ESM::REC_GLOB: mGlobals.load (*mReader, mBase); break;
|
||||
|
@ -692,23 +710,40 @@ bool CSMWorld::Data::continueLoading (CSMDoc::Stage::Messages& messages)
|
|||
|
||||
case ESM::REC_FILT:
|
||||
|
||||
if (mProject)
|
||||
if (!mProject)
|
||||
{
|
||||
mFilters.load (*mReader, mBase);
|
||||
mFilters.setData (mFilters.getSize()-1,
|
||||
mFilters.findColumnIndex (CSMWorld::Columns::ColumnId_Scope),
|
||||
static_cast<int> (CSMFilter::Filter::Scope_Project));
|
||||
unhandledRecord = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// fall through (filter record in a content file is an error with format 0)
|
||||
mFilters.load (*mReader, mBase);
|
||||
mFilters.setData (mFilters.getSize()-1,
|
||||
mFilters.findColumnIndex (CSMWorld::Columns::ColumnId_Scope),
|
||||
static_cast<int> (CSMFilter::Filter::Scope_Project));
|
||||
break;
|
||||
|
||||
case ESM::REC_DBGP:
|
||||
|
||||
if (!mProject)
|
||||
{
|
||||
unhandledRecord = true;
|
||||
break;
|
||||
}
|
||||
|
||||
mDebugProfiles.load (*mReader, mBase);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
messages.push_back (std::make_pair (UniversalId::Type_None,
|
||||
"Unsupported record type: " + n.toString()));
|
||||
unhandledRecord = true;
|
||||
}
|
||||
|
||||
mReader->skipRecord();
|
||||
if (unhandledRecord)
|
||||
{
|
||||
messages.push_back (std::make_pair (UniversalId::Type_None,
|
||||
"Unsupported record type: " + n.toString()));
|
||||
|
||||
mReader->skipRecord();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <components/esm/loaddial.hpp>
|
||||
#include <components/esm/loadench.hpp>
|
||||
#include <components/esm/loadbody.hpp>
|
||||
#include <components/esm/debugprofile.hpp>
|
||||
|
||||
#include <components/to_utf8/to_utf8.hpp>
|
||||
|
||||
|
@ -70,6 +71,7 @@ namespace CSMWorld
|
|||
IdCollection<ESM::Dialogue> mJournals;
|
||||
IdCollection<ESM::Enchantment> mEnchantments;
|
||||
IdCollection<ESM::BodyPart> mBodyParts;
|
||||
IdCollection<ESM::DebugProfile> mDebugProfiles;
|
||||
InfoCollection mTopicInfos;
|
||||
InfoCollection mJournalInfos;
|
||||
IdCollection<Cell> mCells;
|
||||
|
@ -190,6 +192,10 @@ namespace CSMWorld
|
|||
|
||||
IdCollection<ESM::BodyPart>& getBodyParts();
|
||||
|
||||
const IdCollection<ESM::DebugProfile>& getDebugProfiles() const;
|
||||
|
||||
IdCollection<ESM::DebugProfile>& getDebugProfiles();
|
||||
|
||||
/// Throws an exception, if \a id does not match a resources list.
|
||||
const Resources& getResources (const UniversalId& id) const;
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ namespace
|
|||
{ CSMWorld::UniversalId::Class_ResourceList, CSMWorld::UniversalId::Type_SoundsRes, "Sound Files", 0 },
|
||||
{ CSMWorld::UniversalId::Class_ResourceList, CSMWorld::UniversalId::Type_Textures, "Textures", 0 },
|
||||
{ CSMWorld::UniversalId::Class_ResourceList, CSMWorld::UniversalId::Type_Videos, "Videos", 0 },
|
||||
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_DebugProfiles, "Debug Profiles", 0 },
|
||||
|
||||
{ CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0, 0 } // end marker
|
||||
};
|
||||
|
@ -109,6 +110,7 @@ namespace
|
|||
{ CSMWorld::UniversalId::Class_Resource, CSMWorld::UniversalId::Type_SoundRes, "Sound File", 0 },
|
||||
{ CSMWorld::UniversalId::Class_Resource, CSMWorld::UniversalId::Type_Texture, "Texture", 0 },
|
||||
{ CSMWorld::UniversalId::Class_Resource, CSMWorld::UniversalId::Type_Video, "Video", 0 },
|
||||
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_DebugProfile, "Debug Profile", 0 },
|
||||
|
||||
{ CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0, 0 } // end marker
|
||||
};
|
||||
|
|
|
@ -119,10 +119,12 @@ namespace CSMWorld
|
|||
Type_Textures,
|
||||
Type_Texture,
|
||||
Type_Videos,
|
||||
Type_Video
|
||||
Type_Video,
|
||||
Type_DebugProfiles,
|
||||
Type_DebugProfile
|
||||
};
|
||||
|
||||
enum { NumberOfTypes = Type_BodyPart+1 };
|
||||
enum { NumberOfTypes = Type_DebugProfile+1 };
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -232,6 +232,15 @@ void CSVDoc::View::setupAssetsMenu()
|
|||
assets->addAction (videos);
|
||||
}
|
||||
|
||||
void CSVDoc::View::setupDebugMenu()
|
||||
{
|
||||
QMenu *debug = menuBar()->addMenu (tr ("Debug"));
|
||||
|
||||
QAction *profiles = new QAction (tr ("Debug Profiles"), this);
|
||||
connect (profiles, SIGNAL (triggered()), this, SLOT (addDebugProfilesSubView()));
|
||||
debug->addAction (profiles);
|
||||
}
|
||||
|
||||
void CSVDoc::View::setupUi()
|
||||
{
|
||||
setupFileMenu();
|
||||
|
@ -241,6 +250,7 @@ void CSVDoc::View::setupUi()
|
|||
setupMechanicsMenu();
|
||||
setupCharacterMenu();
|
||||
setupAssetsMenu();
|
||||
setupDebugMenu();
|
||||
}
|
||||
|
||||
void CSVDoc::View::updateTitle()
|
||||
|
@ -543,6 +553,11 @@ void CSVDoc::View::addVideosSubView()
|
|||
addSubView (CSMWorld::UniversalId::Type_Videos);
|
||||
}
|
||||
|
||||
void CSVDoc::View::addDebugProfilesSubView()
|
||||
{
|
||||
addSubView (CSMWorld::UniversalId::Type_DebugProfiles);
|
||||
}
|
||||
|
||||
void CSVDoc::View::abortOperation (int type)
|
||||
{
|
||||
mDocument->abortOperation (type);
|
||||
|
|
|
@ -67,6 +67,8 @@ namespace CSVDoc
|
|||
|
||||
void setupAssetsMenu();
|
||||
|
||||
void setupDebugMenu();
|
||||
|
||||
void setupUi();
|
||||
|
||||
void updateTitle();
|
||||
|
@ -194,6 +196,8 @@ namespace CSVDoc
|
|||
|
||||
void addVideosSubView();
|
||||
|
||||
void addDebugProfilesSubView();
|
||||
|
||||
void toggleShowStatusBar (bool show);
|
||||
|
||||
void loadErrorLog();
|
||||
|
|
|
@ -95,6 +95,10 @@ void CSVWorld::addSubViewFactories (CSVDoc::SubViewFactoryManager& manager)
|
|||
new CSVDoc::SubViewFactoryWithCreator<TableSubView,
|
||||
CreatorFactory<CSVFilter::FilterCreator> >);
|
||||
|
||||
manager.add (CSMWorld::UniversalId::Type_DebugProfiles,
|
||||
new CSVDoc::SubViewFactoryWithCreator<TableSubView,
|
||||
NullCreatorFactory>);
|
||||
|
||||
manager.add (CSMWorld::UniversalId::Type_Scene, new CSVDoc::SubViewFactory<SceneSubView>);
|
||||
|
||||
// Dialogue subviews
|
||||
|
|
Loading…
Reference in a new issue