summaryrefslogtreecommitdiff
path: root/src/notifymanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-31 23:06:04 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-31 23:06:04 +0300
commit28165cbeca05b74cf66f121757f21f4cb7cd381e (patch)
treec1c32225b4d94f75df8a20a5baacf009be88b0b0 /src/notifymanager.cpp
parent35d4ce0ed75b2575067007a85d5c211d292ebada (diff)
downloadmv-28165cbeca05b74cf66f121757f21f4cb7cd381e.tar.gz
mv-28165cbeca05b74cf66f121757f21f4cb7cd381e.tar.bz2
mv-28165cbeca05b74cf66f121757f21f4cb7cd381e.tar.xz
mv-28165cbeca05b74cf66f121757f21f4cb7cd381e.zip
Add support for sound effects in any notification messages.
Diffstat (limited to 'src/notifymanager.cpp')
-rw-r--r--src/notifymanager.cpp16
1 files changed, 16 insertions, 0 deletions
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;
}
}