From 28165cbeca05b74cf66f121757f21f4cb7cd381e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 31 Mar 2013 23:06:04 +0300 Subject: Add support for sound effects in any notification messages. --- src/notifymanager.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/notifymanager.cpp') diff --git a/src/notifymanager.cpp b/src/notifymanager.cpp index 8f702c286..b889c66f3 100644 --- a/src/notifymanager.cpp +++ b/src/notifymanager.cpp @@ -22,6 +22,7 @@ #include "guildmanager.h" #include "localplayer.h" +#include "soundmanager.h" #include "gui/widgets/chattab.h" @@ -29,6 +30,8 @@ #include "net/net.h" #include "net/partyhandler.h" +#include "resources/sounddb.h" + namespace NotifyManager { static ChatTab *getGuildTab() @@ -93,6 +96,7 @@ namespace NotifyManager default: break; } + soundManager.playSfx(SoundDB::getSound(message)); } void notify(const unsigned int message, const int num) @@ -105,6 +109,7 @@ namespace NotifyManager localChatTab->chatLog(strprintf(gettext(info.text), num), BY_SERVER); } + soundManager.playSfx(SoundDB::getSound(message)); } void notify(const unsigned int message, const std::string &str) @@ -140,5 +145,16 @@ namespace NotifyManager default: break; } + soundManager.playSfx(SoundDB::getSound(message)); + } + + int getIndexBySound(const std::string &sound) + { + for (int f = 0; f < TYPE_END; f ++) + { + if (notifications[f].sound == sound) + return f; + } + return 0; } } -- cgit v1.2.3-60-g2f50