TerraSync: add a warning file to the root dir.
Try to discourage users from adding custom content underneath the Terrasync dir, since it can be over-written.
This commit is contained in:
@@ -1181,6 +1181,9 @@ void SGTerraSync::reinit()
|
||||
|
||||
SGPath sceneryRoot{_terraRoot->getStringValue("scenery-dir", "")};
|
||||
_workerThread->setLocalDir(sceneryRoot.utf8Str());
|
||||
if (sceneryRoot.exists()) {
|
||||
writeWarningFile(sceneryRoot);
|
||||
}
|
||||
|
||||
SGPath installPath(_terraRoot->getStringValue("installation-dir"));
|
||||
_workerThread->setInstalledDir(installPath);
|
||||
@@ -1419,6 +1422,23 @@ void SGTerraSync::reposition()
|
||||
// stub, remove
|
||||
}
|
||||
|
||||
void SGTerraSync::writeWarningFile(const SGPath& sceneryDir)
|
||||
{
|
||||
SGPath p = sceneryDir / "TerraSync-WARNING.txt";
|
||||
if (p.exists())
|
||||
return;
|
||||
|
||||
sg_ofstream os(p, std::ios::out | std::ios::trunc);
|
||||
os << "This folder is managed by FlightGear's download system.\n";
|
||||
os << "Any changes you make here or in sub-folders will be overwritten when TerraSync\n";
|
||||
os << "downloads updates.\n";
|
||||
os << "\n";
|
||||
os << "To use custom scenery or data with FlightGear, put it in a differnet location\n";
|
||||
os << "on your computer, then add the location using either the launcher 'Add-ons' page, or by\n";
|
||||
os << "passing '--fg-scenery=<location>' on the command line.";
|
||||
os << endl;
|
||||
}
|
||||
|
||||
|
||||
// Register the subsystem.
|
||||
SGSubsystemMgr::Registrant<SGTerraSync> registrantSGTerraSync(
|
||||
|
||||
@@ -90,6 +90,9 @@ protected:
|
||||
|
||||
class WorkerThread;
|
||||
|
||||
private:
|
||||
void writeWarningFile(const SGPath& sceneryDir);
|
||||
|
||||
private:
|
||||
WorkerThread* _workerThread;
|
||||
SGPropertyNode_ptr _terraRoot;
|
||||
|
||||
Reference in New Issue
Block a user