From eaa18d4e3cf70ac0e2bcf277b3ea085a209d9ef9 Mon Sep 17 00:00:00 2001 From: smiRaphi <87574679+smiRaphi@users.noreply.github.com> Date: Thu, 6 Mar 2025 15:20:55 +0100 Subject: [PATCH] load trophy from .wav (#2603) Co-authored-by: smiRaphi --- src/core/libraries/np_trophy/trophy_ui.cpp | 10 +++++++--- src/qt_gui/settings_dialog.cpp | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/core/libraries/np_trophy/trophy_ui.cpp b/src/core/libraries/np_trophy/trophy_ui.cpp index aba56f341..3c9f883b3 100644 --- a/src/core/libraries/np_trophy/trophy_ui.cpp +++ b/src/core/libraries/np_trophy/trophy_ui.cpp @@ -92,10 +92,14 @@ TrophyUI::TrophyUI(const std::filesystem::path& trophyIconPath, const std::strin AddLayer(this); #ifdef ENABLE_QT_GUI - QString musicPath = QString::fromStdString(CustomTrophy_Dir.string() + "/trophy.mp3"); - if (fs::exists(musicPath.toStdString())) { + 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(musicPath, false); + BackgroundMusicPlayer::getInstance().playMusic(musicPathWav, false); + } else if (fs::exists(musicPathMp3.toStdString())) { + BackgroundMusicPlayer::getInstance().setVolume(100); + BackgroundMusicPlayer::getInstance().playMusic(musicPathMp3, false); } #endif } diff --git a/src/qt_gui/settings_dialog.cpp b/src/qt_gui/settings_dialog.cpp index bff4b8221..6e38bd025 100644 --- a/src/qt_gui/settings_dialog.cpp +++ b/src/qt_gui/settings_dialog.cpp @@ -635,7 +635,7 @@ void SettingsDialog::updateNoteTextEdit(const QString& elementName) { //User if (elementName == "OpenCustomTrophyLocationButton") { - text = tr("Open the custom trophy images/sounds folder:\\nYou can add custom images to the trophies and an audio.\\nAdd the files to custom_trophy with the following names:\\ntrophy.mp3, bronze.png, gold.png, platinum.png, silver.png\\nNote: The sound will only work in QT versions."); + text = tr("Open the custom trophy images/sounds folder:\\nYou can add custom images to the trophies and an audio.\\nAdd the files to custom_trophy with the following names:\\ntrophy.wav OR trophy.mp3, bronze.png, gold.png, platinum.png, silver.png\\nNote: The sound will only work in QT versions."); } // Input