|
|
@ -14,6 +14,7 @@
|
|
|
|
#include <components/debug/gldebug.hpp>
|
|
|
|
#include <components/debug/gldebug.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
#include <components/misc/rng.hpp>
|
|
|
|
#include <components/misc/rng.hpp>
|
|
|
|
|
|
|
|
#include <components/misc/strings/format.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
#include <components/vfs/manager.hpp>
|
|
|
|
#include <components/vfs/manager.hpp>
|
|
|
|
#include <components/vfs/registerarchives.hpp>
|
|
|
|
#include <components/vfs/registerarchives.hpp>
|
|
|
@ -109,10 +110,23 @@ namespace
|
|
|
|
profiler.removeUserStatsLine(" -Async");
|
|
|
|
profiler.removeUserStatsLine(" -Async");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
struct ScheduleNonDialogMessageBox
|
|
|
|
struct ScreenCaptureMessageBox
|
|
|
|
{
|
|
|
|
{
|
|
|
|
void operator()(std::string message) const
|
|
|
|
void operator()(std::string filePath) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (filePath.empty())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->scheduleMessageBox(
|
|
|
|
|
|
|
|
"#{OMWEngine:ScreenshotFailed}", MWGui::ShowInDialogueMode_Never);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string messageFormat
|
|
|
|
|
|
|
|
= MWBase::Environment::get().getL10nManager()->getMessage("OMWEngine", "ScreenshotMade");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string message = Misc::StringUtils::format(messageFormat, filePath);
|
|
|
|
|
|
|
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->scheduleMessageBox(
|
|
|
|
MWBase::Environment::get().getWindowManager()->scheduleMessageBox(
|
|
|
|
std::move(message), MWGui::ShowInDialogueMode_Never);
|
|
|
|
std::move(message), MWGui::ShowInDialogueMode_Never);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -717,8 +731,7 @@ void OMW::Engine::prepareEngine()
|
|
|
|
mScreenCaptureOperation = new SceneUtil::AsyncScreenCaptureOperation(mWorkQueue,
|
|
|
|
mScreenCaptureOperation = new SceneUtil::AsyncScreenCaptureOperation(mWorkQueue,
|
|
|
|
new SceneUtil::WriteScreenshotToFileOperation(mCfgMgr.getScreenshotPath(),
|
|
|
|
new SceneUtil::WriteScreenshotToFileOperation(mCfgMgr.getScreenshotPath(),
|
|
|
|
Settings::general().mScreenshotFormat,
|
|
|
|
Settings::general().mScreenshotFormat,
|
|
|
|
Settings::general().mNotifyOnSavedScreenshot
|
|
|
|
Settings::general().mNotifyOnSavedScreenshot ? std::function<void(std::string)>(ScreenCaptureMessageBox{})
|
|
|
|
? std::function<void(std::string)>(ScheduleNonDialogMessageBox{})
|
|
|
|
|
|
|
|
: std::function<void(std::string)>(IgnoreString{})));
|
|
|
|
: std::function<void(std::string)>(IgnoreString{})));
|
|
|
|
|
|
|
|
|
|
|
|
mScreenCaptureHandler = new osgViewer::ScreenCaptureHandler(mScreenCaptureOperation);
|
|
|
|
mScreenCaptureHandler = new osgViewer::ScreenCaptureHandler(mScreenCaptureOperation);
|
|
|
|