Fix issue with background music playing when going back to the pause screen from game info screen

This commit is contained in:
Henrik Rydgård 2024-09-24 13:50:21 +02:00
parent c5a4023d90
commit 6d01e2587d

View File

@ -56,6 +56,7 @@
#include "UI/GameInfoCache.h" #include "UI/GameInfoCache.h"
#include "UI/DisplayLayoutScreen.h" #include "UI/DisplayLayoutScreen.h"
#include "UI/RetroAchievementScreens.h" #include "UI/RetroAchievementScreens.h"
#include "UI/BackgroundAudio.h"
static void AfterSaveStateAction(SaveState::Status status, std::string_view message, void *) { static void AfterSaveStateAction(SaveState::Status status, std::string_view message, void *) {
if (!message.empty() && (!g_Config.bDumpFrames || !g_Config.bDumpVideoOutput)) { if (!message.empty() && (!g_Config.bDumpFrames || !g_Config.bDumpVideoOutput)) {
@ -480,6 +481,9 @@ void GamePauseScreen::dialogFinished(const Screen *dialog, DialogResult dr) {
if (tag == "ScreenshotView" && dr == DR_OK) { if (tag == "ScreenshotView" && dr == DR_OK) {
finishNextFrame_ = true; finishNextFrame_ = true;
} else { } else {
if (tag == "Game") {
g_BackgroundAudio.SetGame(Path());
}
// There may have been changes to our savestates, so let's recreate. // There may have been changes to our savestates, so let's recreate.
RecreateViews(); RecreateViews();
} }