diff options
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 018e35030..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.playGuiSfx("system/newmessage.ogg"); + 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); +} |