summaryrefslogtreecommitdiff
path: root/src/gui/widgets/chattab.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-28 22:16:23 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-28 22:16:23 +0300
commitbbf5743dd18e78298376da6f78c71ae2a524c766 (patch)
tree64ff82f070ce5022b6adc26c5c1727fb38f13794 /src/gui/widgets/chattab.cpp
parent8a3adb5dc695fec3f4db5f0705c53687862fb801 (diff)
downloadplus-bbf5743dd18e78298376da6f78c71ae2a524c766.tar.gz
plus-bbf5743dd18e78298376da6f78c71ae2a524c766.tar.bz2
plus-bbf5743dd18e78298376da6f78c71ae2a524c766.tar.xz
plus-bbf5743dd18e78298376da6f78c71ae2a524c766.zip
Fix some sound event.
Replace hardcoded sound names to constants. Add party/guild sound.
Diffstat (limited to 'src/gui/widgets/chattab.cpp')
-rw-r--r--src/gui/widgets/chattab.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index 53842e887..be6a31164 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -289,9 +289,19 @@ void ChatTab::chatLog(std::string line, Own own,
if (getFlash() == 0)
{
if (chatWindow && chatWindow->findHighlight(tmp.text))
+ {
setFlash(2);
+ sound.playGuiSound(SOUND_HIGHLIGHT);
+ }
else
+ {
setFlash(1);
+ }
+ }
+ else if (getFlash() == 2)
+ {
+ if (chatWindow && chatWindow->findHighlight(tmp.text))
+ sound.playGuiSound(SOUND_HIGHLIGHT);
}
}
@@ -300,8 +310,10 @@ void ChatTab::chatLog(std::string line, Own own,
|| (Client::getIsMinimized() || (!Client::getMouseFocused()
&& !Client::getInputFocused()))))
{
- if (own != BY_SERVER)
- sound.playGuiSound("soundwhisper");
+ if (own == BY_GM)
+ sound.playGuiSound(SOUND_GLOBAL);
+ else if (own != BY_SERVER)
+ playNewMessageSound();
}
}
}
@@ -468,3 +480,8 @@ void ChatTab::addNewRow(std::string &line)
}
mScrollArea->logic();
}
+
+void ChatTab::playNewMessageSound()
+{
+ sound.playGuiSound(SOUND_WHISPER);
+}