mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Add button to disable chat
This commit is contained in:
parent
3dda7569e6
commit
9a1ff10b0a
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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())
|
||||
{
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
Loading…
Reference in a new issue