mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 07:32:00 -04:00
Merge pull request #2787 from p4r4digm/screenshot-path
Added setting to change the directory screenshots are stored in
This commit is contained in:
commit
b8c467e2e0
@ -658,7 +658,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Initialise and enter main loop.
|
// Initialise and enter main loop.
|
||||||
|
|
||||||
void OMW::Engine::go()
|
void OMW::Engine::go()
|
||||||
{
|
{
|
||||||
assert (!mContentFiles.empty());
|
assert (!mContentFiles.empty());
|
||||||
@ -687,7 +686,8 @@ void OMW::Engine::go()
|
|||||||
mViewer->setUseConfigureAffinity(false);
|
mViewer->setUseConfigureAffinity(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mScreenCaptureOperation = new WriteScreenshotToFileOperation(mCfgMgr.getUserDataPath().string(),
|
mScreenCaptureOperation = new WriteScreenshotToFileOperation(
|
||||||
|
mCfgMgr.getScreenshotPath().string(),
|
||||||
Settings::Manager::getString("screenshot format", "General"));
|
Settings::Manager::getString("screenshot format", "General"));
|
||||||
|
|
||||||
mScreenCaptureHandler = new osgViewer::ScreenCaptureHandler(mScreenCaptureOperation);
|
mScreenCaptureHandler = new osgViewer::ScreenCaptureHandler(mScreenCaptureOperation);
|
||||||
|
@ -32,6 +32,14 @@ ConfigurationManager::ConfigurationManager(bool silent)
|
|||||||
boost::filesystem::create_directories(mFixedPath.getUserDataPath());
|
boost::filesystem::create_directories(mFixedPath.getUserDataPath());
|
||||||
|
|
||||||
mLogPath = mFixedPath.getUserConfigPath();
|
mLogPath = mFixedPath.getUserConfigPath();
|
||||||
|
|
||||||
|
mScreenshotPath = mFixedPath.getUserDataPath() / "screenshots";
|
||||||
|
|
||||||
|
// probably not necessary but validate the creation of the screenshots directory and fallback to the original behavior if it fails
|
||||||
|
boost::system::error_code dirErr;
|
||||||
|
if (!boost::filesystem::create_directories(mScreenshotPath, dirErr) && !boost::filesystem::is_directory(mScreenshotPath)) {
|
||||||
|
mScreenshotPath = mFixedPath.getUserDataPath();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigurationManager::~ConfigurationManager()
|
ConfigurationManager::~ConfigurationManager()
|
||||||
@ -196,4 +204,9 @@ const boost::filesystem::path& ConfigurationManager::getLogPath() const
|
|||||||
return mLogPath;
|
return mLogPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const boost::filesystem::path& ConfigurationManager::getScreenshotPath() const
|
||||||
|
{
|
||||||
|
return mScreenshotPath;
|
||||||
|
}
|
||||||
|
|
||||||
} /* namespace Cfg */
|
} /* namespace Cfg */
|
||||||
|
@ -41,6 +41,7 @@ struct ConfigurationManager
|
|||||||
const boost::filesystem::path& getCachePath() const;
|
const boost::filesystem::path& getCachePath() const;
|
||||||
|
|
||||||
const boost::filesystem::path& getLogPath() const;
|
const boost::filesystem::path& getLogPath() const;
|
||||||
|
const boost::filesystem::path& getScreenshotPath() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef Files::FixedPath<> FixedPathType;
|
typedef Files::FixedPath<> FixedPathType;
|
||||||
@ -57,6 +58,7 @@ struct ConfigurationManager
|
|||||||
FixedPathType mFixedPath;
|
FixedPathType mFixedPath;
|
||||||
|
|
||||||
boost::filesystem::path mLogPath;
|
boost::filesystem::path mLogPath;
|
||||||
|
boost::filesystem::path mScreenshotPath;
|
||||||
|
|
||||||
TokensMappingContainer mTokensMapping;
|
TokensMappingContainer mTokensMapping;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user