mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
Readd chat sounds and add option to disable them
This commit is contained in:
parent
7dbce81bbf
commit
f0b6ff9c4c
BIN
data/audio/sfx_msg-highlight.wv
Normal file
BIN
data/audio/sfx_msg-highlight.wv
Normal file
Binary file not shown.
BIN
data/audio/sfx_msg-server.wv
Normal file
BIN
data/audio/sfx_msg-server.wv
Normal file
Binary file not shown.
|
@ -56,6 +56,7 @@ MACRO_CONFIG_INT(SndVolume, snd_volume, 100, 0, 100, CFGFLAG_SAVE|CFGFLAG_CLIENT
|
|||
MACRO_CONFIG_INT(SndDevice, snd_device, -1, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "(deprecated) Sound device to use")
|
||||
|
||||
MACRO_CONFIG_INT(SndNonactiveMute, snd_nonactive_mute, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "")
|
||||
MACRO_CONFIG_INT(SndChat, snd_chat, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "")
|
||||
|
||||
MACRO_CONFIG_INT(GfxScreenWidth, gfx_screen_width, 800, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Screen resolution width")
|
||||
MACRO_CONFIG_INT(GfxScreenHeight, gfx_screen_height, 600, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Screen resolution height")
|
||||
|
|
|
@ -337,7 +337,7 @@ void CChat::AddLine(int ClientID, int Team, const char *pLine)
|
|||
int64 Now = time_get();
|
||||
if(ClientID == -1)
|
||||
{
|
||||
if(Now-m_aLastSoundPlayed[CHAT_SERVER] >= time_freq()*3/10)
|
||||
if(Now-m_aLastSoundPlayed[CHAT_SERVER] >= time_freq()*3/10 && g_Config.m_SndChat)
|
||||
{
|
||||
m_pClient->m_pSounds->Play(CSounds::CHN_GUI, SOUND_CHAT_SERVER, 0);
|
||||
m_aLastSoundPlayed[CHAT_SERVER] = Now;
|
||||
|
@ -353,8 +353,9 @@ void CChat::AddLine(int ClientID, int Team, const char *pLine)
|
|||
}
|
||||
else
|
||||
{
|
||||
if(Now-m_aLastSoundPlayed[CHAT_CLIENT] >= time_freq()*3/10)
|
||||
if(Now-m_aLastSoundPlayed[CHAT_CLIENT] >= time_freq()*3/10 && g_Config.m_SndChat)
|
||||
{
|
||||
if (g_Config.m_SndChat)
|
||||
m_pClient->m_pSounds->Play(CSounds::CHN_GUI, SOUND_CHAT_HIGHLIGHT, 0);
|
||||
m_aLastSoundPlayed[CHAT_CLIENT] = Now;
|
||||
}
|
||||
|
|
|
@ -794,6 +794,10 @@ void CMenus::RenderSettingsSound(CUIRect MainView)
|
|||
if(DoButton_CheckBox(&g_Config.m_SndNonactiveMute, Localize("Mute when not active"), g_Config.m_SndNonactiveMute, &Button))
|
||||
g_Config.m_SndNonactiveMute ^= 1;
|
||||
|
||||
MainView.HSplitTop(20.0f, &Button, &MainView);
|
||||
if(DoButton_CheckBox(&g_Config.m_SndChat, Localize("Enable chat sound"), g_Config.m_SndChat, &Button))
|
||||
g_Config.m_SndChat ^= 1;
|
||||
|
||||
// sample rate box
|
||||
{
|
||||
char aBuf[64];
|
||||
|
|
Loading…
Reference in a new issue