summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/yuzu/main.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 31a635176..c6bf5214e 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -2153,17 +2153,26 @@ void GMainWindow::OnToggleFilterBar() {
2153 2153
2154void GMainWindow::OnCaptureScreenshot() { 2154void GMainWindow::OnCaptureScreenshot() {
2155 OnPauseGame(); 2155 OnPauseGame();
2156 QFileDialog png_dialog(this, tr("Capture Screenshot"), UISettings::values.screenshot_path, 2156
2157 tr("PNG Image (*.png)")); 2157 const u64 title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID();
2158 png_dialog.setAcceptMode(QFileDialog::AcceptSave); 2158 const auto screenshot_path = FileUtil::GetUserPath(FileUtil::UserPath::ScreenshotsDir);
2159 png_dialog.setDefaultSuffix(QStringLiteral("png")); 2159 const auto date = QDateTime::currentDateTime()
2160 if (png_dialog.exec()) { 2160 .toString(QStringLiteral("yyyy-MM-dd_hh-mm-ss-zzz"))
2161 const QString path = png_dialog.selectedFiles().first(); 2161 .toStdString();
2162 if (!path.isEmpty()) { 2162 QString filename = QString::fromStdString(screenshot_path + fmt::format("{:016X}", title_id) +
2163 UISettings::values.screenshot_path = QFileInfo(path).path(); 2163 "_" + date + ".png");
2164 render_window->CaptureScreenshot(UISettings::values.screenshot_resolution_factor, path); 2164
2165#ifdef _WIN32
2166 if (UISettings::values.enable_screenshot_save_as) {
2167 filename = QFileDialog::getSaveFileName(this, tr("Capture Screenshot"), filename,
2168 tr("PNG Image (*.png)"));
2169 if (filename.isEmpty()) {
2170 OnStartGame();
2171 return;
2165 } 2172 }
2166 } 2173 }
2174#endif
2175 render_window->CaptureScreenshot(UISettings::values.screenshot_resolution_factor, filename);
2167 OnStartGame(); 2176 OnStartGame();
2168} 2177}
2169 2178