From c8406480d3b2eb5ba9b92be579064faa7db9e60d Mon Sep 17 00:00:00 2001 From: rainmakerv2 <30595646+rainmakerv3@users.noreply.github.com> Date: Sat, 19 Jul 2025 13:00:34 +0800 Subject: [PATCH] remove redundant conditions --- src/core/libraries/np_trophy/trophy_ui.cpp | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/core/libraries/np_trophy/trophy_ui.cpp b/src/core/libraries/np_trophy/trophy_ui.cpp index 8767b36c3..57090be90 100644 --- a/src/core/libraries/np_trophy/trophy_ui.cpp +++ b/src/core/libraries/np_trophy/trophy_ui.cpp @@ -94,22 +94,20 @@ TrophyUI::TrophyUI(const std::filesystem::path& trophyIconPath, const std::strin bool customsoundplayed = false; #ifdef ENABLE_QT_GUI - if (!Config::getisTrophyPopupDisabled()) { - QString musicPathWav = QString::fromStdString(CustomTrophy_Dir.string() + "/trophy.wav"); - QString musicPathMp3 = QString::fromStdString(CustomTrophy_Dir.string() + "/trophy.mp3"); - if (fs::exists(musicPathWav.toStdString())) { - BackgroundMusicPlayer::getInstance().setVolume(100); - BackgroundMusicPlayer::getInstance().playMusic(musicPathWav, false); - customsoundplayed = true; - } else if (fs::exists(musicPathMp3.toStdString())) { - BackgroundMusicPlayer::getInstance().setVolume(100); - BackgroundMusicPlayer::getInstance().playMusic(musicPathMp3, false); - customsoundplayed = true; - } + QString musicPathWav = QString::fromStdString(CustomTrophy_Dir.string() + "/trophy.wav"); + QString musicPathMp3 = QString::fromStdString(CustomTrophy_Dir.string() + "/trophy.mp3"); + if (fs::exists(musicPathWav.toStdString())) { + BackgroundMusicPlayer::getInstance().setVolume(100); + BackgroundMusicPlayer::getInstance().playMusic(musicPathWav, false); + customsoundplayed = true; + } else if (fs::exists(musicPathMp3.toStdString())) { + BackgroundMusicPlayer::getInstance().setVolume(100); + BackgroundMusicPlayer::getInstance().playMusic(musicPathMp3, false); + customsoundplayed = true; } #endif - if (!customsoundplayed && !Config::getisTrophyPopupDisabled()) { + if (!customsoundplayed) { auto soundFile = resource.open("src/images/trophy.wav"); std::vector soundData = std::vector(soundFile.begin(), soundFile.end());