diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-02-28 22:16:23 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-02-28 22:16:23 +0300 |
commit | bbf5743dd18e78298376da6f78c71ae2a524c766 (patch) | |
tree | 64ff82f070ce5022b6adc26c5c1727fb38f13794 /src/gui/widgets/chattab.cpp | |
parent | 8a3adb5dc695fec3f4db5f0705c53687862fb801 (diff) | |
download | ManaVerse-bbf5743dd18e78298376da6f78c71ae2a524c766.tar.gz ManaVerse-bbf5743dd18e78298376da6f78c71ae2a524c766.tar.bz2 ManaVerse-bbf5743dd18e78298376da6f78c71ae2a524c766.tar.xz ManaVerse-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.cpp | 21 |
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); +} |