Skip to content

Commit

Permalink
/ignore, /unignore, and /clearignored
Browse files Browse the repository at this point in the history
  • Loading branch information
theonlypwner committed Dec 27, 2013
1 parent cfcee1d commit d81b2f1
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 3 deletions.
Binary file modified acr/packages/misc/build.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions config/font.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,4 @@ fontchar 128 64 // 2 - Linux
fontchar 192 64 // 3 - Mac
fontchar 256 64 // 4 - Windows
fontchar 320 64 // 5 - Authed
fontchar 384 64 // 6 - Muted at client side
4 changes: 2 additions & 2 deletions source/src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void trydisconnect()
}

void saytext(playerent *d, char *text, int flags, int sound){
if(sound > 0 && sound < S_NULL){
if(!d->ignored && sound > 0 && sound < S_NULL){
d->addicon(eventicon::VOICECOM);
playsound(sound, SP_HIGH);
} else sound = 0;
Expand All @@ -214,7 +214,7 @@ void saytext(playerent *d, char *text, int flags, int sound){
if(flags & SAY_ACTION) formatstring(textout)("\f5* %s", nametag);
else formatstring(textout)("\f5<%s\f5>", nametag);
// output with text
void (*outf)(const char *s, ...) = textcolor == 2? conoutf : chatoutf;
void (*outf)(const char *s, ...) = (textcolor == 2 || d->ignored) ? conoutf : chatoutf;
if(sound) outf("%s \f4[\f6%d\f4] \f%d%s", textout, sound, textcolor, text);
else outf("%s \f%d%s", textout, textcolor, text);
}
Expand Down
21 changes: 21 additions & 0 deletions source/src/clientgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,27 @@ const char *colorpj(int pj)
return cpj;
}

void ignore(int cn)
{
playerent *d = getclient(cn);
if(d && d != player1) d->ignored = true;
}

void unignore(int cn)
{
playerent *d = getclient(cn);
if(d && d != player1) d->ignored = false;
}

void clearignored(int cn)
{
loopv(players) if(players[i] && (cn < 0 || cn == i)) players[i]->ignored = false;
}

COMMAND(ignore, ARG_1INT);
COMMAND(unignore, ARG_1INT);
COMMAND(clearignored, ARG_1INT);

void newname(const char *name)
{
if(name[0])
Expand Down
4 changes: 3 additions & 1 deletion source/src/entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,8 @@ struct playerent : dynent, playerstate
vec head, eject, muzzle;
vec deathcamsrc;

bool ignored;

// AI
CBot *pBot;

Expand Down Expand Up @@ -607,7 +609,7 @@ struct playerent : dynent, playerstate
skin_noteam = skin_red = skin_blue = NULL;
respawn(G_DM, G_M_NONE);
damagestack.setsize(0);
wantsreload = delayedscope = false;
wantsreload = delayedscope = ignored = false;
}

void addicon(int type)
Expand Down
1 change: 1 addition & 0 deletions source/src/scoreboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ void renderscore(void *menu, playerent *d){
if(buildinfo & 0x08) concatstring(line.s, "\a1 "); // Debug
if(third) concatstring(line.s, "\a0 "); // Third-Person
if(buildinfo & 0x02) concatstring(line.s, "\a5 "); // Authed
if(d->ignored) concatstring(line.s, "\a6 "); // Muted
}

void renderteamscore(void *menu, teamsum &t){
Expand Down

0 comments on commit d81b2f1

Please sign in to comment.