mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
load start up script records
This commit is contained in:
parent
bf92d5cde9
commit
4e1c086d6a
@ -254,6 +254,10 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc
|
|||||||
mPathgrids.addColumn (new RecordStateColumn<Pathgrid>);
|
mPathgrids.addColumn (new RecordStateColumn<Pathgrid>);
|
||||||
mPathgrids.addColumn (new FixedRecordTypeColumn<Pathgrid> (UniversalId::Type_Pathgrid));
|
mPathgrids.addColumn (new FixedRecordTypeColumn<Pathgrid> (UniversalId::Type_Pathgrid));
|
||||||
|
|
||||||
|
mStartScripts.addColumn (new StringIdColumn<ESM::StartScript>);
|
||||||
|
mStartScripts.addColumn (new RecordStateColumn<ESM::StartScript>);
|
||||||
|
mStartScripts.addColumn (new FixedRecordTypeColumn<ESM::StartScript> (UniversalId::Type_StartScript));
|
||||||
|
|
||||||
mRefs.addColumn (new StringIdColumn<CellRef> (true));
|
mRefs.addColumn (new StringIdColumn<CellRef> (true));
|
||||||
mRefs.addColumn (new RecordStateColumn<CellRef>);
|
mRefs.addColumn (new RecordStateColumn<CellRef>);
|
||||||
mRefs.addColumn (new FixedRecordTypeColumn<CellRef> (UniversalId::Type_Reference));
|
mRefs.addColumn (new FixedRecordTypeColumn<CellRef> (UniversalId::Type_Reference));
|
||||||
@ -327,6 +331,7 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc
|
|||||||
addModel (new IdTable (&mSoundGens), UniversalId::Type_SoundGen);
|
addModel (new IdTable (&mSoundGens), UniversalId::Type_SoundGen);
|
||||||
addModel (new IdTable (&mMagicEffects), UniversalId::Type_MagicEffect);
|
addModel (new IdTable (&mMagicEffects), UniversalId::Type_MagicEffect);
|
||||||
addModel (new IdTable (&mPathgrids), UniversalId::Type_Pathgrid);
|
addModel (new IdTable (&mPathgrids), UniversalId::Type_Pathgrid);
|
||||||
|
addModel (new IdTable (&mStartScripts), UniversalId::Type_StartScript);
|
||||||
addModel (new IdTable (&mReferenceables, IdTable::Feature_Preview),
|
addModel (new IdTable (&mReferenceables, IdTable::Feature_Preview),
|
||||||
UniversalId::Type_Referenceable);
|
UniversalId::Type_Referenceable);
|
||||||
addModel (new IdTable (&mRefs, IdTable::Feature_ViewCell | IdTable::Feature_Preview), UniversalId::Type_Reference);
|
addModel (new IdTable (&mRefs, IdTable::Feature_ViewCell | IdTable::Feature_Preview), UniversalId::Type_Reference);
|
||||||
@ -615,6 +620,16 @@ CSMWorld::SubCellCollection<CSMWorld::Pathgrid>& CSMWorld::Data::getPathgrids()
|
|||||||
return mPathgrids;
|
return mPathgrids;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const CSMWorld::IdCollection<ESM::StartScript>& CSMWorld::Data::getStartScripts() const
|
||||||
|
{
|
||||||
|
return mStartScripts;
|
||||||
|
}
|
||||||
|
|
||||||
|
CSMWorld::IdCollection<ESM::StartScript>& CSMWorld::Data::getStartScripts()
|
||||||
|
{
|
||||||
|
return mStartScripts;
|
||||||
|
}
|
||||||
|
|
||||||
const CSMWorld::Resources& CSMWorld::Data::getResources (const UniversalId& id) const
|
const CSMWorld::Resources& CSMWorld::Data::getResources (const UniversalId& id) const
|
||||||
{
|
{
|
||||||
return mResourcesManager.get (id.getType());
|
return mResourcesManager.get (id.getType());
|
||||||
@ -719,6 +734,7 @@ bool CSMWorld::Data::continueLoading (CSMDoc::Messages& messages)
|
|||||||
case ESM::REC_SNDG: mSoundGens.load (*mReader, mBase); break;
|
case ESM::REC_SNDG: mSoundGens.load (*mReader, mBase); break;
|
||||||
case ESM::REC_MGEF: mMagicEffects.load (*mReader, mBase); break;
|
case ESM::REC_MGEF: mMagicEffects.load (*mReader, mBase); break;
|
||||||
case ESM::REC_PGRD: mPathgrids.load (*mReader, mBase); break;
|
case ESM::REC_PGRD: mPathgrids.load (*mReader, mBase); break;
|
||||||
|
case ESM::REC_SSCR: mStartScripts.load (*mReader, mBase); break;
|
||||||
|
|
||||||
case ESM::REC_LTEX: mLandTextures.load (*mReader, mBase); break;
|
case ESM::REC_LTEX: mLandTextures.load (*mReader, mBase); break;
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include <components/esm/loadbody.hpp>
|
#include <components/esm/loadbody.hpp>
|
||||||
#include <components/esm/loadsndg.hpp>
|
#include <components/esm/loadsndg.hpp>
|
||||||
#include <components/esm/loadmgef.hpp>
|
#include <components/esm/loadmgef.hpp>
|
||||||
|
#include <components/esm/loadsscr.hpp>
|
||||||
#include <components/esm/debugprofile.hpp>
|
#include <components/esm/debugprofile.hpp>
|
||||||
#include <components/esm/filter.hpp>
|
#include <components/esm/filter.hpp>
|
||||||
|
|
||||||
@ -80,6 +81,7 @@ namespace CSMWorld
|
|||||||
SubCellCollection<Pathgrid> mPathgrids;
|
SubCellCollection<Pathgrid> mPathgrids;
|
||||||
IdCollection<ESM::DebugProfile> mDebugProfiles;
|
IdCollection<ESM::DebugProfile> mDebugProfiles;
|
||||||
IdCollection<ESM::SoundGenerator> mSoundGens;
|
IdCollection<ESM::SoundGenerator> mSoundGens;
|
||||||
|
IdCollection<ESM::StartScript> mStartScripts;
|
||||||
InfoCollection mTopicInfos;
|
InfoCollection mTopicInfos;
|
||||||
InfoCollection mJournalInfos;
|
InfoCollection mJournalInfos;
|
||||||
IdCollection<Cell> mCells;
|
IdCollection<Cell> mCells;
|
||||||
@ -225,6 +227,10 @@ namespace CSMWorld
|
|||||||
|
|
||||||
SubCellCollection<Pathgrid>& getPathgrids();
|
SubCellCollection<Pathgrid>& getPathgrids();
|
||||||
|
|
||||||
|
const IdCollection<ESM::StartScript>& getStartScripts() const;
|
||||||
|
|
||||||
|
IdCollection<ESM::StartScript>& getStartScripts();
|
||||||
|
|
||||||
/// Throws an exception, if \a id does not match a resources list.
|
/// Throws an exception, if \a id does not match a resources list.
|
||||||
const Resources& getResources (const UniversalId& id) const;
|
const Resources& getResources (const UniversalId& id) const;
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ namespace
|
|||||||
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_SoundGens, "Sound Generators", 0 },
|
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_SoundGens, "Sound Generators", 0 },
|
||||||
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_MagicEffects, "Magic Effects", 0 },
|
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_MagicEffects, "Magic Effects", 0 },
|
||||||
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_Pathgrids, "Pathgrids", 0 },
|
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_Pathgrids, "Pathgrids", 0 },
|
||||||
|
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_StartScripts, "Start Scripts", 0 },
|
||||||
|
|
||||||
{ CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0, 0 } // end marker
|
{ CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0, 0 } // end marker
|
||||||
};
|
};
|
||||||
@ -118,6 +119,7 @@ namespace
|
|||||||
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_SoundGen, "Sound Generator", 0 },
|
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_SoundGen, "Sound Generator", 0 },
|
||||||
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_MagicEffect, "Magic Effect", 0 },
|
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_MagicEffect, "Magic Effect", 0 },
|
||||||
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Pathgrid, "Pathgrid", 0 },
|
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Pathgrid, "Pathgrid", 0 },
|
||||||
|
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_StartScript, "Start Script", 0 },
|
||||||
|
|
||||||
{ CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0, 0 } // end marker
|
{ CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0, 0 } // end marker
|
||||||
};
|
};
|
||||||
|
@ -128,6 +128,8 @@ namespace CSMWorld
|
|||||||
Type_MagicEffect,
|
Type_MagicEffect,
|
||||||
Type_Pathgrids,
|
Type_Pathgrids,
|
||||||
Type_Pathgrid,
|
Type_Pathgrid,
|
||||||
|
Type_StartScripts,
|
||||||
|
Type_StartScript,
|
||||||
Type_RunLog
|
Type_RunLog
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -41,4 +41,8 @@ namespace ESM
|
|||||||
esm.writeHNString("NAME", mId);
|
esm.writeHNString("NAME", mId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StartScript::blank()
|
||||||
|
{
|
||||||
|
mData.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,8 @@ struct StartScript
|
|||||||
// Load a record and add it to the list
|
// Load a record and add it to the list
|
||||||
void load(ESMReader &esm);
|
void load(ESMReader &esm);
|
||||||
void save(ESMWriter &esm) const;
|
void save(ESMWriter &esm) const;
|
||||||
|
|
||||||
|
void blank();
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user