From eb371309f1852b50b1e385ba929098bf7a6403a1 Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Sun, 25 Dec 2022 05:37:45 +0100 Subject: [PATCH] early-access version 3251 --- README.md | 2 +- src/yuzu/main.cpp | 15 +++++++++++---- src/yuzu/main.h | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 44d7d3399..d2ffd7155 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 3247. +This is the source code for early-access 3251. ## Legal Notice diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 823e431e4..ffb095e07 100755 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1784,9 +1784,9 @@ void GMainWindow::BootGame(const QString& filename, u64 program_id, std::size_t OnStartGame(); } -void GMainWindow::OnShutdownBegin() { +bool GMainWindow::OnShutdownBegin() { if (!emulation_running) { - return; + return false; } if (ui->action_Fullscreen->isChecked()) { @@ -1798,6 +1798,10 @@ void GMainWindow::OnShutdownBegin() { // Disable unlimited frame rate Settings::values.use_speed_limit.SetValue(true); + if (system->IsShuttingDown()) { + return false; + } + system->SetShuttingDown(true); discord_rpc->Pause(); @@ -1816,6 +1820,8 @@ void GMainWindow::OnShutdownBegin() { ui->action_Pause->setEnabled(false); ui->action_Restart->setEnabled(false); ui->action_Stop->setEnabled(false); + + return true; } void GMainWindow::OnShutdownBeginDialog() { @@ -3002,8 +3008,9 @@ void GMainWindow::OnStopGame() { return; } - OnShutdownBegin(); - OnShutdownBeginDialog(); + if (OnShutdownBegin()) { + OnShutdownBeginDialog(); + } } void GMainWindow::OnLoadComplete() { diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 0b7a52b22..d74da9e7e 100755 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -336,7 +336,7 @@ private slots: void OnReinitializeKeys(ReinitializeKeyBehavior behavior); void OnLanguageChanged(const QString& locale); void OnMouseActivity(); - void OnShutdownBegin(); + bool OnShutdownBegin(); void OnShutdownBeginDialog(); void OnEmulationStopped(); void OnEmulationStopTimeExpired();