diff options
author | Tony J. White <tjw@tjw.org> | 2007-04-12 17:03:14 +0000 |
---|---|---|
committer | Tony J. White <tjw@tjw.org> | 2007-04-12 17:03:14 +0000 |
commit | 62a42bbf49500ef0f253e624a2ccc2423b97a61b (patch) | |
tree | 392cab67e5066dec39cb6ce316a3c91a0566bd95 /src/cgame | |
parent | 988e4b435bb8666afb18fadc7dfa472b1332c93b (diff) |
* cg_drawCrosshair now has 3 settings:
0 - always off
1 - for long range weapons only (1.1.0 behaviour and also the new default)
2 - always on (if the weapon.cfg has one defined of course)
* cg_drawCrosshair 0 no longer prevents crosshair names from drawing
* added cg_drawCrosshair configuration in the ingame Options -> Game menu
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_draw.c | 11 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 6 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 2 |
3 files changed, 14 insertions, 5 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 89740c7c..82df413a 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -2464,9 +2464,15 @@ static void CG_DrawCrosshair( void ) float x, y; weaponInfo_t *wi; - if( !cg_drawCrosshair.integer ) + if( cg_drawCrosshair.integer == CROSSHAIR_ALWAYSOFF ) return; + if( cg_drawCrosshair.integer == CROSSHAIR_RANGEDONLY && + !BG_FindLongRangedForWeapon( cg.snap->ps.weapon ) ) + { + return; + } + if( ( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR ) || ( cg.snap->ps.stats[ STAT_STATE ] & SS_INFESTING ) || ( cg.snap->ps.stats[ STAT_STATE ] & SS_HOVELING ) ) @@ -2547,9 +2553,6 @@ static void CG_DrawCrosshairNames( rectDef_t *rect, float scale, int textStyle ) char *name; float w, x; - if( !cg_drawCrosshair.integer ) - return; - if( !cg_drawCrosshairNames.integer ) return; diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 1f0fa005..05cbcbdf 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -2063,3 +2063,9 @@ qboolean trap_GetEntityToken( char *buffer, int bufferSize ); int trap_GetDemoState( void ); int trap_GetDemoPos( void ); void trap_GetDemoName( char *buffer, int size ); + +// cg_drawCrosshair settings +#define CROSSHAIR_ALWAYSOFF 0 +#define CROSSHAIR_RANGEDONLY 1 +#define CROSSHAIR_ALWAYSON 2 + diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 8d5929b5..1797b972 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -271,7 +271,7 @@ static cvarTable_t cvarTable[ ] = { &cg_drawIcons, "cg_drawIcons", "1", CVAR_ARCHIVE }, { &cg_drawAmmoWarning, "cg_drawAmmoWarning", "1", CVAR_ARCHIVE }, { &cg_drawAttacker, "cg_drawAttacker", "1", CVAR_ARCHIVE }, - { &cg_drawCrosshair, "cg_drawCrosshair", "4", CVAR_ARCHIVE }, + { &cg_drawCrosshair, "cg_drawCrosshair", "1", CVAR_ARCHIVE }, { &cg_drawCrosshairNames, "cg_drawCrosshairNames", "1", CVAR_ARCHIVE }, { &cg_drawRewards, "cg_drawRewards", "1", CVAR_ARCHIVE }, { &cg_crosshairX, "cg_crosshairX", "0", CVAR_ARCHIVE }, |