Add button to disable chat

This commit is contained in:
def 2013-11-14 16:23:15 +01:00
parent 3dda7569e6
commit 9a1ff10b0a
5 changed files with 12 additions and 2 deletions

View file

@ -37,7 +37,7 @@ void CFriends::Init()
if(pConsole)
{
pConsole->Register("add_friend", "ss", CFGFLAG_CLIENT, ConAddFriend, this, "Add a friend");
pConsole->Register("remove_Friend", "ss", CFGFLAG_CLIENT, ConRemoveFriend, this, "Remove a friend");
pConsole->Register("remove_friend", "ss", CFGFLAG_CLIENT, ConRemoveFriend, this, "Remove a friend");
}
}

View file

@ -366,6 +366,9 @@ void CChat::AddLine(int ClientID, int Team, const char *pLine)
void CChat::OnRender()
{
if (!g_Config.m_ClShowChat)
return;
// send pending chat messages
if(m_PendingChatCounter > 0 && m_LastChatSend+time_freq() < time_get())
{

View file

@ -189,7 +189,7 @@ void CMenus::RenderPlayers(CUIRect MainView)
ButtonBar.VSplitLeft(Width, &Button, &ButtonBar);
Button.VSplitLeft((Width-Button.h)/4.0f, 0, &Button);
Button.VSplitLeft(Button.h, &Button, 0);
if(&g_Config.m_ClShowChatFriends && !m_pClient->m_aClients[Index].m_Friend)
if(g_Config.m_ClShowChatFriends && !m_pClient->m_aClients[Index].m_Friend)
DoButton_Toggle(&s_aPlayerIDs[Index][0], 1, &Button, false);
else
if(DoButton_Toggle(&s_aPlayerIDs[Index][0], m_pClient->m_aClients[Index].m_ChatIgnore, &Button, true))

View file

@ -1112,6 +1112,12 @@ void CMenus::RenderSettingsDDRace(CUIRect MainView)
g_Config.m_ClShowhudHealthAmmo ^= 1;
}
MainView.HSplitTop(20.0f, &Button, &MainView);
if(DoButton_CheckBox(&g_Config.m_ClShowChat, Localize("Show chat"), g_Config.m_ClShowChat, &Button))
{
g_Config.m_ClShowChat ^= 1;
}
CUIRect aRects[2];
CUIRect Label;
MainView.HSplitTop(5.0f, 0, &MainView);

View file

@ -18,6 +18,7 @@ MACRO_CONFIG_INT(ClAutoswitchWeapons, cl_autoswitch_weapons, 0, 0, 1, CFGFLAG_CL
MACRO_CONFIG_INT(ClShowhud, cl_showhud, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame HUD")
MACRO_CONFIG_INT(ClShowhudHealthAmmo, cl_showhud_healthammo, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame HUD (Health + Ammo)")
MACRO_CONFIG_INT(ClShowhudScore, cl_showhud_score, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame HUD (Score)")
MACRO_CONFIG_INT(ClShowChat, cl_showchat, 1, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show chat")
MACRO_CONFIG_INT(ClShowChatFriends, cl_show_chat_friends, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show only chat messages from friends")
MACRO_CONFIG_INT(ClShowfps, cl_showfps, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show ingame FPS counter")