From fbb886fae04e542bf938971eb8845bd185c049a1 Mon Sep 17 00:00:00 2001 From: YourSourceBoiii <265013879+YourSourceBoiii@users.noreply.github.com> Date: Wed, 1 Apr 2026 15:30:40 +0000 Subject: [PATCH 1/2] [TF2] Add convar to prevent voice commands being printed in chat --- src/game/client/hud_basechat.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/game/client/hud_basechat.cpp b/src/game/client/hud_basechat.cpp index cc17aa80b21..a921620a097 100644 --- a/src/game/client/hud_basechat.cpp +++ b/src/game/client/hud_basechat.cpp @@ -39,6 +39,7 @@ ConVar cl_showtextmsg( "cl_showtextmsg", "1", 0, "Enable/disable text messages p ConVar cl_chatfilters( "cl_chatfilters", "63", FCVAR_CLIENTDLL | FCVAR_ARCHIVE, "Stores the chat filter settings " ); ConVar cl_chatfilter_version( "cl_chatfilter_version", "0", FCVAR_CLIENTDLL | FCVAR_ARCHIVE | FCVAR_HIDDEN, "Stores the chat filter version" ); ConVar cl_mute_all_comms("cl_mute_all_comms", "1", FCVAR_ARCHIVE, "If 1, then all communications from a player will be blocked when that player is muted, including chat messages."); +ConVar cl_mute_voice_commands_text("cl_mute_voice_commands_text", "0", FCVAR_ARCHIVE, "Disable voice commands being printed in chat when performed. 0 = All voice commands get printed, 1 = No voice commands get printed, 2 = Only allow MEDIC! calls to be printed."); ConVar cl_enable_text_chat( "cl_enable_text_chat", "1", FCVAR_ARCHIVE, "Enable text chat in this game" ); const int kChatFilterVersion = 1; @@ -964,6 +965,9 @@ void CBaseHudChat::MsgFunc_VoiceSubtitle( bf_read &msg ) if ( !cl_showtextmsg.GetInt() ) return; + if ( cl_mute_voice_commands_text.GetInt() == 1 ) + return; + char szString[2048]; char szPrefix[64]; //(Voice) wchar_t szBuf[128]; @@ -972,6 +976,9 @@ void CBaseHudChat::MsgFunc_VoiceSubtitle( bf_read &msg ) int iMenu = msg.ReadByte(); int iItem = msg.ReadByte(); + if (cl_mute_voice_commands_text.GetInt() == 2 && (iMenu != 0 || iItem != 0)) + return; + const char *pszSubtitle = ""; CGameRules *pGameRules = GameRules(); @@ -1869,4 +1876,4 @@ void CBaseHudChat::FireGameEvent( IGameEvent *event ) ChatPrintf( player->entindex(), CHAT_FILTER_NONE, "(SourceTV) %s", event->GetString( "text" ) ); } #endif -} \ No newline at end of file +} From 2e66e0d6dcaa5ce36b029e4fdd294886564c3496 Mon Sep 17 00:00:00 2001 From: YourSourceBoiii <265013879+YourSourceBoiii@users.noreply.github.com> Date: Thu, 2 Apr 2026 15:26:33 +0000 Subject: [PATCH 2/2] Allow spy calls when cl_mute_voice_commands_text = 2 --- src/game/client/hud_basechat.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/client/hud_basechat.cpp b/src/game/client/hud_basechat.cpp index a921620a097..5020e960464 100644 --- a/src/game/client/hud_basechat.cpp +++ b/src/game/client/hud_basechat.cpp @@ -39,7 +39,7 @@ ConVar cl_showtextmsg( "cl_showtextmsg", "1", 0, "Enable/disable text messages p ConVar cl_chatfilters( "cl_chatfilters", "63", FCVAR_CLIENTDLL | FCVAR_ARCHIVE, "Stores the chat filter settings " ); ConVar cl_chatfilter_version( "cl_chatfilter_version", "0", FCVAR_CLIENTDLL | FCVAR_ARCHIVE | FCVAR_HIDDEN, "Stores the chat filter version" ); ConVar cl_mute_all_comms("cl_mute_all_comms", "1", FCVAR_ARCHIVE, "If 1, then all communications from a player will be blocked when that player is muted, including chat messages."); -ConVar cl_mute_voice_commands_text("cl_mute_voice_commands_text", "0", FCVAR_ARCHIVE, "Disable voice commands being printed in chat when performed. 0 = All voice commands get printed, 1 = No voice commands get printed, 2 = Only allow MEDIC! calls to be printed."); +ConVar cl_mute_voice_commands_text("cl_mute_voice_commands_text", "0", FCVAR_ARCHIVE, "Disable voice commands being printed in chat. 0 = All voice commands get printed, 1 = No voice commands get printed, 2 = Only allow MEDIC! and Spy! calls to be printed."); ConVar cl_enable_text_chat( "cl_enable_text_chat", "1", FCVAR_ARCHIVE, "Enable text chat in this game" ); const int kChatFilterVersion = 1; @@ -976,7 +976,7 @@ void CBaseHudChat::MsgFunc_VoiceSubtitle( bf_read &msg ) int iMenu = msg.ReadByte(); int iItem = msg.ReadByte(); - if (cl_mute_voice_commands_text.GetInt() == 2 && (iMenu != 0 || iItem != 0)) + if (cl_mute_voice_commands_text.GetInt() == 2 && ((iMenu != 0 || iItem != 0) || (iMenu != 1 || iItem != 1))) return; const char *pszSubtitle = "";