mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-09 20:06:44 +00:00
Load default markers definitions in editor
This commit is contained in:
parent
17222eb821
commit
2f89080b36
2 changed files with 28 additions and 0 deletions
|
@ -962,6 +962,29 @@ int CSMWorld::Data::startLoading (const boost::filesystem::path& path, bool base
|
||||||
return mReader->getRecordCount();
|
return mReader->getRecordCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSMWorld::Data::loadFallbackEntries()
|
||||||
|
{
|
||||||
|
// Load default marker definitions, if game files do not have them for some reason
|
||||||
|
std::pair<std::string, std::string> markers[] = {
|
||||||
|
std::make_pair("divinemarker", "marker_divine.nif"),
|
||||||
|
std::make_pair("doormarker", "marker_arrow.nif"),
|
||||||
|
std::make_pair("northmarker", "marker_north.nif"),
|
||||||
|
std::make_pair("templemarker", "marker_temple.nif"),
|
||||||
|
std::make_pair("travelmarker", "marker_travel.nif")
|
||||||
|
};
|
||||||
|
|
||||||
|
for (const std::pair<std::string, std::string> marker : markers)
|
||||||
|
{
|
||||||
|
if (mReferenceables.searchId (marker.first)==-1)
|
||||||
|
{
|
||||||
|
CSMWorld::Record<ESM::Static> record;
|
||||||
|
record.mBase = ESM::Static(marker.first, marker.second);
|
||||||
|
record.mState = CSMWorld::RecordBase::State_BaseOnly;
|
||||||
|
mReferenceables.appendRecord (record, CSMWorld::UniversalId::Type_Static);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool CSMWorld::Data::continueLoading (CSMDoc::Messages& messages)
|
bool CSMWorld::Data::continueLoading (CSMDoc::Messages& messages)
|
||||||
{
|
{
|
||||||
if (!mReader)
|
if (!mReader)
|
||||||
|
@ -983,6 +1006,9 @@ bool CSMWorld::Data::continueLoading (CSMDoc::Messages& messages)
|
||||||
mReader = 0;
|
mReader = 0;
|
||||||
|
|
||||||
mDialogue = 0;
|
mDialogue = 0;
|
||||||
|
|
||||||
|
loadFallbackEntries();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,6 +144,8 @@ namespace CSMWorld
|
||||||
|
|
||||||
static int count (RecordBase::State state, const CollectionBase& collection);
|
static int count (RecordBase::State state, const CollectionBase& collection);
|
||||||
|
|
||||||
|
void loadFallbackEntries();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Data (ToUTF8::FromType encoding, bool fsStrict, const Files::PathContainer& dataPaths,
|
Data (ToUTF8::FromType encoding, bool fsStrict, const Files::PathContainer& dataPaths,
|
||||||
|
|
Loading…
Reference in a new issue