From 43d780b55216c4ddc9aea03e7fb93fb9bdd9f295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 16 Jul 2023 21:43:49 +0200 Subject: [PATCH] Fix issue where achievement sounds didn't play if UI Sounds were off. These are meant to be unrelated. --- Common/UI/Root.h | 2 ++ UI/EmuScreen.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Common/UI/Root.h b/Common/UI/Root.h index 3454525431..2c79777af3 100644 --- a/Common/UI/Root.h +++ b/Common/UI/Root.h @@ -51,6 +51,8 @@ enum class UISound { void SetSoundEnabled(bool enabled); void SetSoundCallback(std::function func); +// This is only meant for actual UI navigation sound, not achievements. +// Call directly into the player for other UI effects. void PlayUISound(UISound sound, float volume = 0.25f); } // namespace UI diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 1b87edd8be..2d309fc6e3 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -546,10 +546,10 @@ void EmuScreen::sendMessage(const char *message, const char *value) { if (g_Config.bAchievementsSoundEffects) { // TODO: Handle this some nicer way. if (!strcmp(value, "achievement_unlocked")) { - UI::PlayUISound(UI::UISound::ACHIEVEMENT_UNLOCKED, 0.6f); + g_BackgroundAudio.SFX().Play(UI::UISound::ACHIEVEMENT_UNLOCKED, 0.6f); } if (!strcmp(value, "leaderboard_submitted")) { - UI::PlayUISound(UI::UISound::LEADERBOARD_SUBMITTED, 0.6f); + g_BackgroundAudio.SFX().Play(UI::UISound::LEADERBOARD_SUBMITTED, 0.6f); } } }