mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
overlays: add optional sound to trophy popup
This commit is contained in:
parent
f262e77fbd
commit
0e20acdf55
5 changed files with 22 additions and 0 deletions
|
@ -39,6 +39,7 @@
|
|||
#include <QLibraryInfo>
|
||||
#include <QDirIterator>
|
||||
#include <QFileInfo>
|
||||
#include <QSound>
|
||||
|
||||
#include <clocale>
|
||||
|
||||
|
@ -412,6 +413,17 @@ void gui_application::InitializeCallbacks()
|
|||
return localized_emu::get_u32string(id, args);
|
||||
};
|
||||
|
||||
callbacks.play_sound = [](const std::string& path)
|
||||
{
|
||||
Emu.CallAfter([path]()
|
||||
{
|
||||
if (fs::is_file(path))
|
||||
{
|
||||
QSound::play(qstr(path));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
callbacks.resolve_path = [](std::string_view sv)
|
||||
{
|
||||
return QFileInfo(QString::fromUtf8(sv.data(), static_cast<int>(sv.size()))).canonicalFilePath().toStdString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue