From 4259f7f230a502462a53fd88e0ef28ff7487ebf1 Mon Sep 17 00:00:00 2001 From: elsid Date: Tue, 25 May 2021 13:58:16 +0200 Subject: [PATCH] Add setting to enable/disabled notification for saved screenshots --- apps/launcher/advancedpage.cpp | 4 ++++ apps/openmw/engine.cpp | 9 ++++++++- docs/source/reference/modding/settings/general.rst | 9 +++++++++ files/settings-default.cfg | 3 +++ files/ui/advancedpage.ui | 9 ++++++++- 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/apps/launcher/advancedpage.cpp b/apps/launcher/advancedpage.cpp index bddb70aa02..00021268e3 100644 --- a/apps/launcher/advancedpage.cpp +++ b/apps/launcher/advancedpage.cpp @@ -213,6 +213,8 @@ bool Launcher::AdvancedPage::loadSettings() if (screenshotFormatComboBox->findText(screenshotFormatString) == -1) screenshotFormatComboBox->addItem(screenshotFormatString); screenshotFormatComboBox->setCurrentIndex(screenshotFormatComboBox->findText(screenshotFormatString)); + + loadSettingBool(notifyOnSavedScreenshotCheckBox, "notify on saved screenshot", "General"); } // Testing @@ -376,6 +378,8 @@ void Launcher::AdvancedPage::saveSettings() std::string screenshotFormatString = screenshotFormatComboBox->currentText().toLower().toStdString(); if (screenshotFormatString != Settings::Manager::getString("screenshot format", "General")) Settings::Manager::setString("screenshot format", "General", screenshotFormatString); + + saveSettingBool(notifyOnSavedScreenshotCheckBox, "notify on saved screenshot", "General"); } // Testing diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 278c97f029..93d3530c0a 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -226,6 +226,11 @@ namespace MWBase::Environment::get().getWindowManager()->scheduleMessageBox(std::move(message), MWGui::ShowInDialogueMode_Never); } }; + + struct IgnoreString + { + void operator()(std::string) const {} + }; } void OMW::Engine::executeLocalScripts() @@ -685,7 +690,9 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings) new SceneUtil::WriteScreenshotToFileOperation( mCfgMgr.getScreenshotPath().string(), Settings::Manager::getString("screenshot format", "General"), - ScheduleNonDialogMessageBox {} + Settings::Manager::getBool("notify on saved screenshot", "General") + ? std::function(ScheduleNonDialogMessageBox {}) + : std::function(IgnoreString {}) ) ); diff --git a/docs/source/reference/modding/settings/general.rst b/docs/source/reference/modding/settings/general.rst index c885f77aa1..f0ebe4f972 100644 --- a/docs/source/reference/modding/settings/general.rst +++ b/docs/source/reference/modding/settings/general.rst @@ -59,3 +59,12 @@ texture mipmap Set the texture mipmap type to control the method mipmaps are created. Mipmapping is a way of reducing the processing power needed during minification by pregenerating a series of smaller textures. + +notify on saved screenshot +-------------- + +:Type: boolean +:Range: True/False +:Default: False + +Show message box when screenshot is saved to a file. diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 88a6b48126..522762555d 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -386,6 +386,9 @@ texture min filter = linear # Texture mipmap type. (none, nearest, or linear). texture mipmap = nearest +# Show message box when screenshot is saved to a file. +notify on saved screenshot = false + [Shaders] # Force rendering with shaders. By default, only bump-mapped objects will use shaders. diff --git a/files/ui/advancedpage.ui b/files/ui/advancedpage.ui index 8abe8f59a4..f72150df22 100644 --- a/files/ui/advancedpage.ui +++ b/files/ui/advancedpage.ui @@ -1121,7 +1121,7 @@ True: In non-combat mode camera is positioned behind the character's shoulder. C - + Screenshot Format @@ -1149,6 +1149,13 @@ True: In non-combat mode camera is positioned behind the character's shoulder. C + + + + Notify on saved screenshot + + +