mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-18 13:12:50 +00:00
Corrected filter template loading.
This commit is contained in:
parent
08f8c93a71
commit
821d0c5c2d
@ -2245,29 +2245,33 @@ CSMDoc::Document::Document (const Files::ConfigurationManager& configuration, co
|
||||
mData.setDescription ("");
|
||||
mData.setAuthor ("");
|
||||
}
|
||||
/// \todo un-outcomment the else, once loading an existing content file works properly again.
|
||||
if (boost::filesystem::exists (mProjectPath))
|
||||
{
|
||||
std::cout<<"Loading file."<<std::endl;
|
||||
getData().loadFile (mProjectPath, false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (boost::filesystem::exists (mProjectPath))
|
||||
std::cout<<"Attemp to use filters file as template."<<std::endl;
|
||||
boost::filesystem::path locCustomFiltersPath (configuration.getUserPath());
|
||||
locCustomFiltersPath /= "defaultfilters";
|
||||
if (boost::filesystem::exists(locCustomFiltersPath))
|
||||
{
|
||||
getData().loadFile (mProjectPath, false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
boost::filesystem::path locCustomFiltersPath (configuration.getUserPath());
|
||||
locCustomFiltersPath /= "defaultfilters";
|
||||
if (boost::filesystem::exists(locCustomFiltersPath))
|
||||
std::cout<<"Found custom filters file ("<<locCustomFiltersPath<<")."<<std::endl;
|
||||
boost::filesystem::copy_file (locCustomFiltersPath, mProjectPath);
|
||||
} else {
|
||||
boost::filesystem::path filters(mResDir);
|
||||
filters /= "defaultfilters";
|
||||
std::cout<<"Attempt to read defaultfilters from: "<<filters<<std::endl;
|
||||
if (boost::filesystem::exists(filters))
|
||||
{
|
||||
boost::filesystem::copy_file (locCustomFiltersPath, mProjectPath);
|
||||
} else {
|
||||
boost::filesystem::path filters(mResDir);
|
||||
filters /= "defaultfilters";
|
||||
boost::filesystem::copy_file(filters, mProjectPath);
|
||||
} else {
|
||||
std::cout<<filters<<" could not be found!"<<std::endl;
|
||||
}
|
||||
getData().loadFile (mProjectPath, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
addOptionalGmsts();
|
||||
addOptionalGlobals();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user