summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2009-10-22 08:25:20 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:00 +0000
commit0cc4070263c9159760901dcb5e2b1ac6d97de86f (patch)
treeb5113e43fefc69c6d6c0ad00ee1ccac8f144e9f2 /src/cgame
parent3c9a869327aecda255ffc48ba7a7f4bcf6b4544e (diff)
* Fix UI_Text_Paint_Limit() function, which was printing a max of one character ever, but nothing was using it so nobody noticed (thanks Oopss)
* Add ALIGN_NONE and VALIGN_NONE types for CG_Text_Align function * Slightly widen the location item on the default hud, since just a little bit more fits most maps better * Prevent seeing crosshair playername text for players on the other team while in SPECTATOR_LOCKED * Fix formatting nitpick from a few revisions ago
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_draw.c18
-rw-r--r--src/cgame/cg_servercmds.c4
2 files changed, 15 insertions, 7 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 6609d153..da5d9101 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -57,6 +57,10 @@ static void CG_AlignText( rectDef_t *rect, const char *text, float scale,
case ALIGN_CENTER:
tx = ( rect->w - w ) / 2.0f;
break;
+
+ case ALIGN_NONE:
+ tx = 0;
+ break;
}
switch( valign )
@@ -73,6 +77,10 @@ static void CG_AlignText( rectDef_t *rect, const char *text, float scale,
case VALIGN_CENTER:
ty = h + ( ( rect->h - h ) / 2.0f );
break;
+
+ case VALIGN_NONE:
+ ty = 0;
+ break;
}
if( x )
@@ -2430,7 +2438,7 @@ static void CG_ScanForCrosshairEntity( void )
team = cgs.clientinfo[ trace.entityNum ].team;
- if( cg.snap->ps.persistant[ PERS_SPECSTATE ] == SPECTATOR_NOT )
+ if( cg.snap->ps.stats[ STAT_TEAM ] != TEAM_NONE )
{
//only display team names of those on the same team as this player
if( team != cg.snap->ps.stats[ STAT_TEAM ] )
@@ -2463,13 +2471,13 @@ static void CG_DrawLocation( rectDef_t *rect, float scale, int textalign, vec4_t
else
location = CG_ConfigString( CS_LOCATIONS );
+ // need to skip horiz. align if it's too long, but valign must be run either way
if( UI_Text_Width( location, scale, 0 ) < rect->w )
- {
CG_AlignText( rect, location, scale, 0.0f, 0.0f, textalign, VALIGN_CENTER, &tx, &ty );
- UI_Text_Paint( tx, ty, scale, color, location, 0, 0, ITEM_TEXTSTYLE_NORMAL );
- }
else
- UI_Text_Paint_Limit( &maxX, tx, ty, scale, color, location, 0, 0 );
+ CG_AlignText( rect, location, scale, 0.0f, 0.0f, ALIGN_NONE, VALIGN_CENTER, &tx, &ty );
+
+ UI_Text_Paint_Limit( &maxX, tx, ty, scale, color, location, 0, 0 );
trap_R_SetColor( NULL );
}
diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c
index 9af97006..3e4ebaae 100644
--- a/src/cgame/cg_servercmds.c
+++ b/src/cgame/cg_servercmds.c
@@ -940,8 +940,8 @@ static void CG_Say( int clientNum, saymode_t mode, const char *text )
Com_sprintf( prefix, sizeof( prefix ), "[^%c%c" S_COLOR_WHITE "] " S_COLOR_WHITE,
tcolor, toupper( *( BG_TeamName( ci->team ) ) ) );
- if( ci && ( mode == SAY_TEAM || mode == SAY_AREA )
- && cg.snap->ps.pm_type != PM_INTERMISSION )
+ if( ci && ( mode == SAY_TEAM || mode == SAY_AREA ) &&
+ cg.snap->ps.pm_type != PM_INTERMISSION )
{
if( clientNum == cg.snap->ps.clientNum )
{