Fix issue where achievement sounds didn't play if UI Sounds were off.

These are meant to be unrelated.
This commit is contained in:
Henrik Rydgård 2023-07-16 21:43:49 +02:00
parent 6b574e497f
commit 43d780b552
2 changed files with 4 additions and 2 deletions

View File

@ -51,6 +51,8 @@ enum class UISound {
void SetSoundEnabled(bool enabled);
void SetSoundCallback(std::function<void(UISound, float)> 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

View File

@ -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);
}
}
}