Skip to content

Commit 77bef5e

Browse files
committed
Allow disabling chat
1 parent ed6e2df commit 77bef5e

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

config/usage.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ setdesc "bloodsize" "sets the size of blood splatter" "value"
326326
setdesc "chatconsize" "sets the amount of lines to show in the chat console, this does not include overflow lines" "value"
327327
setdesc "chatconblend" "sets the opacity of the chat console" "value"
328328
setdesc "chatconscale" "determines the scaling of the chat console text" "value"
329+
setdesc "chatdisabled" "disables the chat" "value"
329330
setdesc "commandscale" "determines the scaling of the command and chat input text" "value"
330331
setdesc "conblend" "sets the opacity of the console, this does not include obituaries and affinity events! (flag, bomb)" "value"
331332
setdesc "concenter" "toggles alignment of console;^n0 = console is in top left, 1 = console is centered" "value"

src/game/client.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,11 +1170,12 @@ namespace client
11701170
}
11711171
if((!(flags&SAY_TEAM) || f->team == game::player1.team) && (!(flags&SAY_WHISPER) || f == &game::player1 || t == &game::player1))
11721172
{
1173-
conoutft(CON_CHAT, "%s", line);
1174-
1175-
if (snd >= 0 && !issound(f->cschan))
1176-
{
1177-
playsound(snd, f->o, f, snd != S_CHAT ? 0 : SND_DIRECT, -1, -1, -1, &f->cschan);
1173+
if (hud::chatdisabled != 1) {
1174+
conoutft(CON_CHAT, "%s", line);
1175+
if (snd >= 0 && !issound(f->cschan))
1176+
{
1177+
playsound(snd, f->o, f, snd != S_CHAT ? 0 : SND_DIRECT, -1, -1, -1, &f->cschan);
1178+
}
11781179
}
11791180
}
11801181
ai::scanchat(f, t, flags, text);

src/game/game.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1652,7 +1652,7 @@ namespace hud
16521652
*flagtakentex, *bombdroptex, *bombtakentex, *attacktex, *warningtex, *inventorytex, *indicatortex, *crosshairtex, *hithairtex,
16531653
*spree1tex, *spree2tex, *spree3tex, *spree4tex, *multi1tex, *multi2tex, *multi3tex, *headshottex, *dominatetex, *revengetex,
16541654
*firstbloodtex, *breakertex;
1655-
extern int hudwidth, hudheight, hudsize, lastteam, damageresidue, damageresiduefade, shownotices, showevents, radaraffinitynames,
1655+
extern int hudwidth, hudheight, hudsize, lastteam, damageresidue, damageresiduefade, shownotices, showevents, radaraffinitynames, chatdisabled,
16561656
inventorygame, inventoryscore, inventoryscorespec, inventoryscorebg, inventoryscoreinfo, inventoryscorename, inventoryscorepos, inventoryscorebreak, inventoryracestyle,
16571657
teamhurthud, teamhurttime, teamhurtdist;
16581658
extern float noticescale, eventscale, inventoryblend, inventoryskew, radaraffinityblend, radarblipblend, radaraffinitysize,

src/game/hud.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ namespace hud
8585
FVAR(IDF_PERSIST, chatconblend, 0, 1, 1);
8686
FVAR(IDF_PERSIST, chatconscale, FVAR_NONZERO, 1, FVAR_MAX);
8787
SVAR(IDF_PERSIST, chatcondateformat, "%H:%M:%S");
88+
VAR(IDF_PERSIST, chatdisabled, 0, 0, 1);
8889

8990
FVAR(IDF_PERSIST, selfconblend, 0, 1, 1);
9091
FVAR(IDF_PERSIST, fullconblend, 0, 1, 1);

0 commit comments

Comments
 (0)