moved code for creating new base content records into the Document class

actorid
Marc Zinnschlag 12 years ago
parent 4c973a0f67
commit ba0d13fc12

@ -22,7 +22,6 @@ void CS::Editor::createDocument()
mStartup.hide();
/// \todo open the ESX picker instead
/// \todo move the following code for creating initial records into the document manager
std::ostringstream stream;
@ -33,22 +32,6 @@ void CS::Editor::createDocument()
CSMDoc::Document *document = mDocumentManager.addDocument (files, true);
static const char *sGlobals[] =
{
"Day", "DaysPassed", "GameHour", "Month", "PCRace", "PCVampire", "PCWerewolf", "PCYear", 0
};
for (int i=0; sGlobals[i]; ++i)
{
ESM::Global record;
record.mId = sGlobals[i];
record.mValue = i==0 ? 1 : 0;
record.mType = ESM::VT_Float;
document->getData().getGlobals().add (record);
}
document->getData().merge(); /// \todo remove once proper ESX loading is implemented
mViewManager.addView (document);
}
@ -57,7 +40,7 @@ void CS::Editor::loadDocument()
mStartup.hide();
/// \todo open the ESX picker instead
/// \todo replace the manual record creation and load the ESX files instead
/// \todo remove the manual record creation and load the ESX files instead
std::ostringstream stream;

@ -14,9 +14,19 @@ void CSMDoc::Document::load (const std::vector<boost::filesystem::path>::const_i
void CSMDoc::Document::createBase()
{
std::cout << "pretending to create base file records" << std::endl;
static const char *sGlobals[] =
{
"Day", "DaysPassed", "GameHour", "Month", "PCRace", "PCVampire", "PCWerewolf", "PCYear", 0
};
/// \todo create mandatory records for base content file
for (int i=0; sGlobals[i]; ++i)
{
ESM::Global record;
record.mId = sGlobals[i];
record.mValue = i==0 ? 1 : 0;
record.mType = ESM::VT_Float;
getData().getGlobals().add (record);
}
}
CSMDoc::Document::Document (const std::vector<boost::filesystem::path>& files, bool new_)

Loading…
Cancel
Save