From 72f53754b11bbca3051688e435f548235ffa4259 Mon Sep 17 00:00:00 2001 From: RocketRobz Date: Tue, 14 May 2024 13:37:05 -0600 Subject: [PATCH] Change `QMessageBox::No` to `QMessageBox::Yes` --- src/citra_qt/main.cpp | 57 +++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index dc0bf9b81..ace63e52d 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -2412,36 +2412,35 @@ void GMainWindow::OnCaptureScreenshot() { return; } - if (!emu_thread->IsRunning() - && (QMessageBox::question(this, tr("Game will unpause"), - tr("The game will be unpaused, and the next frame will be captured. Is this okay?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No)) { - return; - } else { - OnPauseGame(); + if (emu_thread->IsRunning() + || (QMessageBox::question(this, tr("Game will unpause"), + tr("The game will be unpaused, and the next frame will be captured. Is this okay?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes)) { + if (emu_thread->IsRunning()) { + OnPauseGame(); + } + std::string path = UISettings::values.screenshot_path.GetValue(); + if (!FileUtil::IsDirectory(path)) { + if (!FileUtil::CreateFullPath(path)) { + QMessageBox::information(this, tr("Invalid Screenshot Directory"), + tr("Cannot create specified screenshot directory. Screenshot " + "path is set back to its default value.")); + path = FileUtil::GetUserPath(FileUtil::UserPath::UserDir); + path.append("screenshots/"); + UISettings::values.screenshot_path = path; + }; + } + + static QRegularExpression expr(QStringLiteral("[\\/:?\"<>|]")); + const std::string filename = game_title.remove(expr).toStdString(); + const std::string timestamp = + QDateTime::currentDateTime().toString(QStringLiteral("dd.MM.yy_hh.mm.ss.z")).toStdString(); + path.append(fmt::format("/{}_{}.png", filename, timestamp)); + + auto* const screenshot_window = secondary_window->HasFocus() ? secondary_window : render_window; + screenshot_window->CaptureScreenshot(UISettings::values.screenshot_resolution_factor.GetValue(), + QString::fromStdString(path)); + OnStartGame(); } - - std::string path = UISettings::values.screenshot_path.GetValue(); - if (!FileUtil::IsDirectory(path)) { - if (!FileUtil::CreateFullPath(path)) { - QMessageBox::information(this, tr("Invalid Screenshot Directory"), - tr("Cannot create specified screenshot directory. Screenshot " - "path is set back to its default value.")); - path = FileUtil::GetUserPath(FileUtil::UserPath::UserDir); - path.append("screenshots/"); - UISettings::values.screenshot_path = path; - }; - } - - static QRegularExpression expr(QStringLiteral("[\\/:?\"<>|]")); - const std::string filename = game_title.remove(expr).toStdString(); - const std::string timestamp = - QDateTime::currentDateTime().toString(QStringLiteral("dd.MM.yy_hh.mm.ss.z")).toStdString(); - path.append(fmt::format("/{}_{}.png", filename, timestamp)); - - auto* const screenshot_window = secondary_window->HasFocus() ? secondary_window : render_window; - screenshot_window->CaptureScreenshot(UISettings::values.screenshot_resolution_factor.GetValue(), - QString::fromStdString(path)); - OnStartGame(); } void GMainWindow::OnDumpVideo() {