about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--data/audio/sfx_msg-highlight.wvbin0 -> 1648 bytes
-rw-r--r--datasrc/content.py1
-rw-r--r--src/game/client/components/chat.cpp7
3 files changed, 7 insertions, 1 deletions
diff --git a/data/audio/sfx_msg-highlight.wv b/data/audio/sfx_msg-highlight.wv
new file mode 100644
index 00000000..6b68b312
--- /dev/null
+++ b/data/audio/sfx_msg-highlight.wv
Binary files differdiff --git a/datasrc/content.py b/datasrc/content.py
index b4b95c9b..accc9010 100644
--- a/datasrc/content.py
+++ b/datasrc/content.py
@@ -214,6 +214,7 @@ container.sounds.Add(SoundSet("hit", FileList("audio/sfx_hit_weak-%02d.wv", 2)))
 
 container.sounds.Add(SoundSet("chat_server", ["audio/sfx_msg-server.wv"]))
 container.sounds.Add(SoundSet("chat_client", ["audio/sfx_msg-client.wv"]))
+container.sounds.Add(SoundSet("chat_highlight", ["audio/sfx_msg-highlight.wv"]))
 container.sounds.Add(SoundSet("ctf_drop", ["audio/sfx_ctf_drop.wv"]))
 container.sounds.Add(SoundSet("ctf_return", ["audio/sfx_ctf_rtn.wv"]))
 container.sounds.Add(SoundSet("ctf_grab_pl", ["audio/sfx_ctf_grab_pl.wv"]))
diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp
index 308493bb..8187f8d2 100644
--- a/src/game/client/components/chat.cpp
+++ b/src/game/client/components/chat.cpp
@@ -202,6 +202,7 @@ void CChat::AddLine(int ClientID, int Team, const char *pLine)
 	if(ClientID != -1 && m_pClient->m_aClients[ClientID].m_aName[0] == '\0') // unknown client
 		return;
 	
+	bool Highlighted = false;
 	char *p = const_cast<char*>(pLine);
 	while(*p)
 	{
@@ -224,6 +225,8 @@ void CChat::AddLine(int ClientID, int Team, const char *pLine)
 		m_aLines[m_CurrentLine].m_Team = Team;
 		m_aLines[m_CurrentLine].m_NameColor = -2;
 		m_aLines[m_CurrentLine].m_Highlighted = str_find_nocase(pLine, m_pClient->m_aClients[m_pClient->m_Snap.m_LocalClientID].m_aName) != 0;
+		if(m_aLines[m_CurrentLine].m_Highlighted)
+			Highlighted = true;
 
 		if(ClientID == -1) // server message
 		{
@@ -253,7 +256,9 @@ void CChat::AddLine(int ClientID, int Team, const char *pLine)
 	}
 
 	// play sound
-	if(ClientID >= 0)
+	if(Highlighted)
+		m_pClient->m_pSounds->Play(CSounds::CHN_GUI, SOUND_CHAT_HIGHLIGHT, 0, vec2(0.0f, 0.0f));
+	else if(ClientID >= 0)
 		m_pClient->m_pSounds->Play(CSounds::CHN_GUI, SOUND_CHAT_CLIENT, 0, vec2(0,0));
 	else
 		m_pClient->m_pSounds->Play(CSounds::CHN_GUI, SOUND_CHAT_SERVER, 0, vec2(0,0));