diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_draw.c | 33 | ||||
-rw-r--r-- | src/cgame/cg_drawtools.c | 10 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 2 | ||||
-rw-r--r-- | src/cgame/cg_servercmds.c | 35 |
4 files changed, 37 insertions, 43 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 111cb12f..296932d6 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -1620,24 +1620,23 @@ static void CG_DrawTimer( rectDef_t *rect, float text_x, float text_y, CG_DrawTeamOverlay ================= */ - static void CG_DrawTeamOverlay( rectDef_t *rect, float scale, vec4_t color ) { - char *s; - int i; - float x = rect->x; - float y, dx; + char *s; + int i; + float x = rect->x; + float y, dx; clientInfo_t *ci, *pci; - vec4_t tcolor; - float iconSize = rect->h/8.0f; - float leftMargin = 4.0f; - float iconTopMargin = 2.0f; - float midSep = 2.0f; - float backgroundWidth = rect->w; - float fontScale = 0.30f; - int maxDisplayCount = 0; - int displayCount = 0; - weapon_t curWeapon = WP_NONE; + vec4_t tcolor; + float iconSize = rect->h / 8.0f; + float leftMargin = 4.0f; + float iconTopMargin = 2.0f; + float midSep = 2.0f; + float backgroundWidth = rect->w; + float fontScale = 0.30f; + int maxDisplayCount = 0; + int displayCount = 0; + weapon_t curWeapon = WP_NONE; if( cg.predictedPlayerState.pm_type == PM_SPECTATOR ) return; @@ -1645,11 +1644,11 @@ static void CG_DrawTeamOverlay( rectDef_t *rect, float scale, vec4_t color ) if( !cg_drawTeamOverlay.integer || !cg_teamOverlayMaxPlayers.integer ) return; - if( !cgs.teaminfoReceievedTime ) return; + if( !cgs.teaminfoReceievedTime ) + return; pci = cgs.clientinfo + cg.snap->ps.clientNum; - for( i = 0; i < MAX_CLIENTS; i++ ) { ci = cgs.clientinfo + i; diff --git a/src/cgame/cg_drawtools.c b/src/cgame/cg_drawtools.c index 17eb7ac6..726c4de9 100644 --- a/src/cgame/cg_drawtools.c +++ b/src/cgame/cg_drawtools.c @@ -412,17 +412,17 @@ CG_GetColorCharForHealth char CG_GetColorCharForHealth( int clientnum ) { char health_char = '2'; - int healthPercent; - int maxHealth; - int curWeaponClass = cgs.clientinfo[ clientnum ].curWeaponClass; + int healthPercent; + int maxHealth; + int curWeaponClass = cgs.clientinfo[ clientnum ].curWeaponClass; if( cgs.clientinfo[ clientnum ].team == TEAM_ALIENS ) maxHealth = BG_Class( curWeaponClass )->health; else maxHealth = BG_Class( PCL_HUMAN )->health; - healthPercent = (int) ( 100.0f * (float) cgs.clientinfo[ clientnum ].health - / (float) maxHealth ); + healthPercent = (int) ( 100.0f * (float) cgs.clientinfo[ clientnum ].health / + (float) maxHealth ); if( healthPercent < 33 ) health_char = '1'; diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 562b8038..cf1e1eff 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -241,7 +241,7 @@ static cvarTable_t cvarTable[ ] = { &cg_drawDemoState, "cg_drawDemoState", "1", CVAR_ARCHIVE }, { &cg_drawSnapshot, "cg_drawSnapshot", "0", CVAR_ARCHIVE }, { &cg_drawChargeBar, "cg_drawChargeBar", "1", CVAR_ARCHIVE }, - { &cg_drawCrosshair, "cg_drawCrosshair", "1", CVAR_ARCHIVE }, + { &cg_drawCrosshair, "cg_drawCrosshair", "2", CVAR_ARCHIVE }, { &cg_drawCrosshairNames, "cg_drawCrosshairNames", "1", CVAR_ARCHIVE }, { &cg_crosshairSize, "cg_crosshairSize", "1", CVAR_ARCHIVE }, { &cg_addMarks, "cg_marks", "1", CVAR_ARCHIVE }, diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c index fb290db3..0cf7f144 100644 --- a/src/cgame/cg_servercmds.c +++ b/src/cgame/cg_servercmds.c @@ -916,7 +916,7 @@ static void CG_Say( int clientNum, saymode_t mode, const char *text ) { clientInfo_t *ci; char *prefix, *name; - qboolean isIgnored = qfalse; + char *ignore = ""; char *location = ""; char tcolor = COLOR_WHITE; char color; @@ -929,7 +929,7 @@ static void CG_Say( int clientNum, saymode_t mode, const char *text ) if( ci ) { - name = ci->name; + name = va( "%s" S_COLOR_WHITE, ci->name ); if( ci->team == TEAM_ALIENS ) tcolor = COLOR_RED; else if( ci->team == TEAM_HUMANS ) @@ -939,7 +939,7 @@ static void CG_Say( int clientNum, saymode_t mode, const char *text ) name = "console"; if( ci && cg_chatTeamPrefix.integer ) - prefix = va( "^%c[%c] " S_COLOR_WHITE, + prefix = va( "[^%c%c" S_COLOR_WHITE "] " S_COLOR_WHITE, tcolor, toupper( *( BG_TeamName( ci->team ) ) ) ); else prefix = ""; @@ -954,44 +954,39 @@ static void CG_Say( int clientNum, saymode_t mode, const char *text ) } if( ci && Com_ClientListContains( &cgs.ignoreList, clientNum ) ) - isIgnored = qtrue; + ignore = "[skipnotify]"; switch( mode ) { case SAY_ALL: - if( isIgnored || ( ci && cg_teamChatsOnly.integer ) ) + if( cg_teamChatsOnly.integer ) CG_Printf( "[skipnotify]%s%s: " S_COLOR_GREEN "%s\n", prefix, name, text ); else - CG_Printf( "%s%s: " S_COLOR_GREEN "%s\n", prefix, name, text ); + CG_Printf( "%s%s%s: " S_COLOR_GREEN "%s\n", ignore, prefix, name, text ); break; case SAY_TEAM: - CG_Printf( "%s(%s)%s: " S_COLOR_CYAN "%s\n", - prefix, name, location, text ); + CG_Printf( "%s%s(%s)%s: " S_COLOR_CYAN "%s\n", + ignore, prefix, name, location, text ); break; case SAY_ADMINS: - CG_Printf( "%s[ADMIN]%s: " S_COLOR_MAGENTA "%s\n", prefix, name, text ); + CG_Printf( "%s%s[ADMIN]%s: " S_COLOR_MAGENTA "%s\n", ignore, prefix, name, text ); break; case SAY_ADMINS_PUBLIC: - CG_Printf( "%s[PLAYER]%s: " S_COLOR_MAGENTA "%s\n", prefix, name, text ); + CG_Printf( "%s%s[PLAYER]%s: " S_COLOR_MAGENTA "%s\n", ignore, prefix, name, text ); break; case SAY_AREA: - CG_Printf( "%s<%s>: " S_COLOR_BLUE "%s\n", prefix, name, text ); + CG_Printf( "%s%s<%s>: " S_COLOR_BLUE "%s\n", ignore, prefix, name, text ); break; case SAY_PRIVMSG: case SAY_TPRIVMSG: color = ( mode == SAY_TPRIVMSG ) ? COLOR_CYAN : COLOR_GREEN; - if( isIgnored ) - CG_Printf( "[skipnotify]%s" S_COLOR_YELLOW " -> " S_COLOR_WHITE "%s: " - "^%c%s\n", name, cgs.clientinfo[ cg.clientNum ].name, color, - text ); - else - { - CG_Printf( "%s" S_COLOR_YELLOW " -> " S_COLOR_WHITE "%s: ^%c%s\n", - name, cgs.clientinfo[ cg.clientNum ].name, color, text ); + CG_Printf( "%s%s" S_COLOR_YELLOW " -> " S_COLOR_WHITE "%s" S_COLOR_WHITE ": " + "^%c%s\n", ignore, name, cgs.clientinfo[ cg.clientNum ].name, color, + text ); + if( ignore[0] ) CG_CenterPrint( va( "^%cPrivate message from: " S_COLOR_WHITE "%s", color, name ), 200, GIANTCHAR_WIDTH * 4 ); - } break; case SAY_RAW: CG_Printf( "%s\n", text ); |