diff options
| author | Tim Angus <tim@ngus.net> | 2001-03-29 03:08:41 +0000 | 
|---|---|---|
| committer | Tim Angus <tim@ngus.net> | 2001-03-29 03:08:41 +0000 | 
| commit | 55e3be2877a148bceab1af75009686d100d1c90a (patch) | |
| tree | 84f9a4c90267e29f09437ab44ca5bf953b78f404 /src/cgame | |
| parent | cfbc2d72a7878cbbdc7980603878213d64873202 (diff) | |
Fixed a couple of power bugs. Implemented a client side power meter.
Diffstat (limited to 'src/cgame')
| -rw-r--r-- | src/cgame/cg_draw.c | 32 | ||||
| -rw-r--r-- | src/cgame/cg_event.c | 12 | 
2 files changed, 42 insertions, 2 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 534aa705..02e77449 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -533,6 +533,38 @@ static void CG_DrawStatusBar( void ) {    }    // +  // power +  // +  #define PWR_HEIGHT 10 +  #define PWR_WIDTH  80 +  #define PWR_X      555 +  #define PWR_Y      20 +  if( ps->stats[ STAT_PTEAM ] == PTE_HUMANS ) +  { +    int total = cgs.hBuildPointsTotal; +    int allocated = total - cgs.hBuildPoints; +    int powered = total - cgs.hBuildPointsPowered; + +    int awidth = (int)( (float)allocated / ( total / PWR_WIDTH ) ); +    int pwidth = (int)( (float)powered / ( total / PWR_WIDTH ) ); +    vec4_t bcolor = { 0.5, 0.5, 0.5, 0.5 }; + +    //Com_Printf( "%d %d %d\n", allocated, powered, total ); +     +    trap_R_SetColor( bcolor );   // white +    CG_DrawPic( PWR_X, PWR_Y, PWR_WIDTH, PWR_HEIGHT, cgs.media.whiteShader ); + +    trap_R_SetColor( colors[0] ); // green +    CG_DrawPic( PWR_X, PWR_Y, awidth, PWR_HEIGHT, cgs.media.whiteShader ); +     +    if( allocated > powered ) +    { +      trap_R_SetColor( colors[1] ); // red +      CG_DrawPic( PWR_X + pwidth, PWR_Y, awidth - pwidth, PWR_HEIGHT, cgs.media.whiteShader ); +    } +  } + +  //    // health+armor    //    if( ps->stats[ STAT_PTEAM ] == PTE_DROIDS ) diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 9d0c9052..1826e1ba 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -450,10 +450,18 @@ void CG_Menu( int eventParm )        trap_SendConsoleCommand( "menu hmcumenu\n" );        break; -    case MN_NOROOM: +    case MN_HNOROOM:        trap_SendConsoleCommand( "menu hnoroom\n" );        break; +    case MN_HNOPOWER: +      trap_SendConsoleCommand( "menu hnopower\n" ); +      break; + +    case MN_DNOROOM: +      trap_SendConsoleCommand( "menu dnoroom\n" ); +      break; +      case MN_NOCREEP:        trap_SendConsoleCommand( "menu dnocreep\n" );        break; @@ -467,7 +475,7 @@ void CG_Menu( int eventParm )        break;      case MN_INFEST: -      strcpy( menuDef, "5,5|Infest|0.8,0,0.8,1|0.6,0,0.6,0.8|1,0,1,1|1|16|" ); +      strcpy( menuDef, "5,5|Infest|0.976,0.957,0.0,1.0|0.933,0.612,0.0,1.0|0.976,0.957,0.0,1.0|1|16|" );        for( i = PCL_NONE + 1; i < PCL_NUM_CLASSES; i++ )        {          if( BG_ClassCanEvolveFromTo( cg.snap->ps.stats[ STAT_PCLASS ], i ) )  | 
