Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void CG_DrawPlayerEvoFraction( rectDef_t *rect )
- {
- float evos;
- int index;
- vec4_t color = {0.0f,0.0f,0.0f,1.0f};
- evos = cg.snap->ps.persistant[PERS_CREDIT]/EVOPOINT_VALUE;
- index = (int)floor( (evos-floor(evos))*9.0 ) - 1;
- if (index==-1)
- return; //no fraction
- if( index > 7 )
- index = 7;
- else if( index < 0 )
- index = 0;
- color[0]=(evos-floor(evos))/2.0f+0.5f;
- trap_R_SetColor( color );
- CG_DrawPic( rect->x, rect->y, rect->w, rect->h, cgs.media.buildWeaponTimerPie[ index ] );
- trap_R_SetColor( NULL );
- }
- static void CG_DrawPlayerCreditsValue( rectDef_t *rect, vec4_t color, qboolean padding )
- {
- int value;
- playerState_t *ps;
- centity_t *cent;
- float woffs, hoffs;
- rectDef_t rect2;
- cent = &cg_entities[ cg.snap->ps.clientNum ];
- ps = &cg.snap->ps;
- //if the build timer pie is showing don't show this
- if( ( cent->currentState.weapon == WP_ABUILD ||
- cent->currentState.weapon == WP_ABUILD2 ) && ps->stats[ STAT_MISC ] )
- return;
- value = ps->persistant[ PERS_CREDIT ];
- if( value > -1 )
- {
- if( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS &&
- !CG_AtHighestClass( ) )
- {
- if( cg.time - cg.lastEvolveAttempt <= NO_CREDITS_TIME )
- {
- if( ( ( cg.time - cg.lastEvolveAttempt ) / 300 ) % 2 )
- color[ 3 ] = 0.0f;
- }
- }
- if ( cg.predictedPlayerState.stats[ STAT_PTEAM ] == PTE_ALIENS)
- {
- value /= EVOPOINT_VALUE;
- CG_DrawPlayerEvoFraction(rect);
- }
- trap_R_SetColor( color );
- if( padding )
- CG_DrawFieldPadded( rect->x, rect->y, 4, rect->w / 4, rect->h, value );
- else
- CG_DrawField( rect->x, rect->y, 1, rect->w, rect->h, value );
- trap_R_SetColor( NULL );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement