From bd1cabce86de79fb01b7b42d4f43889978e73057 Mon Sep 17 00:00:00 2001 From: upadsamay387 <56898833+upadsamay387@users.noreply.github.com> Date: Sun, 15 Jan 2023 10:15:16 -0600 Subject: [PATCH] Instead of there being an "Abort/Continue" prompt when a savestate fails to save or load, it just brings up a warning box. (#6236) * This fixes #6041 by changing OnCoreError. Instead of there being an "Abort/Continue" prompt when a savestate fails to save or load, it just brings up a warning box. I also changed "Abort/Continue" to "Quit Game/Continue" for better clarity * Fixed formatting --- src/citra_qt/main.cpp | 44 +++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 719ae0d12d..91149245af 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -2269,6 +2269,7 @@ void GMainWindow::OnCoreError(Core::System::ResultStatus result, std::string det QString status_message; QString title, message; + QMessageBox::Icon error_severity_icon; if (result == Core::System::ResultStatus::ErrorSystemFiles) { const QString common_message = tr("%1 is missing. Please for details." "
Continuing emulation may result in crashes and bugs."); status_message = tr("Fatal Error encountered"); + error_severity_icon = QMessageBox::Icon::Critical; } QMessageBox message_box; message_box.setWindowTitle(title); message_box.setText(message); - message_box.setIcon(QMessageBox::Icon::Critical); - message_box.addButton(tr("Continue"), QMessageBox::RejectRole); - QPushButton* abort_button = message_box.addButton(tr("Abort"), QMessageBox::AcceptRole); - if (result != Core::System::ResultStatus::ShutdownRequested) - message_box.exec(); + message_box.setIcon(error_severity_icon); + if (error_severity_icon == QMessageBox::Icon::Critical) { + message_box.addButton(tr("Continue"), QMessageBox::RejectRole); + QPushButton* abort_button = message_box.addButton(tr("Quit Game"), QMessageBox::AcceptRole); + if (result != Core::System::ResultStatus::ShutdownRequested) + message_box.exec(); - if (result == Core::System::ResultStatus::ShutdownRequested || - message_box.clickedButton() == abort_button) { - if (emu_thread) { - ShutdownGame(); + if (result == Core::System::ResultStatus::ShutdownRequested || + message_box.clickedButton() == abort_button) { + if (emu_thread) { + ShutdownGame(); + return; + } } } else { - // Only show the message if the game is still running. - if (emu_thread) { - emu_thread->SetRunning(true); - message_label->setText(status_message); - message_label->setVisible(true); - message_label_used_for_movie = false; - } + // This block should run when the error isn't too big of a deal + // e.g. when a save state can't be saved or loaded + message_box.addButton(tr("OK"), QMessageBox::RejectRole); + message_box.exec(); + } + + // Only show the message if the game is still running. + if (emu_thread) { + emu_thread->SetRunning(true); + message_label->setText(status_message); + message_label->setVisible(true); + message_label_used_for_movie = false; } }