diff --git a/simgear/scene/tsync/terrasync.cxx b/simgear/scene/tsync/terrasync.cxx index d5f1a0ad..38a8d001 100644 --- a/simgear/scene/tsync/terrasync.cxx +++ b/simgear/scene/tsync/terrasync.cxx @@ -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=' on the command line."; + os << endl; +} + // Register the subsystem. SGSubsystemMgr::Registrant registrantSGTerraSync( diff --git a/simgear/scene/tsync/terrasync.hxx b/simgear/scene/tsync/terrasync.hxx index 6cd0b107..2df3d093 100644 --- a/simgear/scene/tsync/terrasync.hxx +++ b/simgear/scene/tsync/terrasync.hxx @@ -90,6 +90,9 @@ protected: class WorkerThread; +private: + void writeWarningFile(const SGPath& sceneryDir); + private: WorkerThread* _workerThread; SGPropertyNode_ptr _terraRoot;