summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cgame/cg_draw.c79
-rw-r--r--src/game/g_active.c5
-rw-r--r--src/game/tremulous.h6
-rw-r--r--ui/menudef.h48
4 files changed, 82 insertions, 56 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 2c9b12b9..a479f3b4 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -352,14 +352,20 @@ static void CG_DrawField( int x, int y, int width, int cw, int ch, int value )
}
}
-static void CG_DrawProgressBar( rectDef_t *rect, vec4_t color,
- float scale, int align, int textStyle, float progress )
+static void CG_DrawProgressBar( rectDef_t *rect, vec4_t color, float scale,
+ int align, int textStyle, int special, float progress )
{
- float rimWidth = rect->h / 10.0f;
+ float rimWidth = rect->h / 20.0f;
float doneWidth, leftWidth;
float tx, ty, tw, th;
char textBuffer[ 8 ];
+ if( rimWidth < 0.6f )
+ rimWidth = 0.6f;
+
+ if( special >= 0.0f )
+ rimWidth = special;
+
if( progress < 0.0f )
progress = 0.0f;
else if( progress > 1.0f )
@@ -371,12 +377,25 @@ static void CG_DrawProgressBar( rectDef_t *rect, vec4_t color,
trap_R_SetColor( color );
//draw rim and bar
- CG_DrawPic( rect->x, rect->y, rimWidth + doneWidth, rect->h, cgs.media.whiteShader );
- CG_DrawPic( rimWidth + rect->x + doneWidth, rect->y,
- leftWidth, rimWidth, cgs.media.whiteShader );
- CG_DrawPic( rimWidth + rect->x + doneWidth, rect->y + rect->h - rimWidth,
- leftWidth, rimWidth, cgs.media.whiteShader );
- CG_DrawPic( rect->x + rect->w - rimWidth, rect->y, rimWidth, rect->h, cgs.media.whiteShader );
+ if( align == ITEM_ALIGN_RIGHT )
+ {
+ CG_DrawPic( rect->x, rect->y, rimWidth, rect->h, cgs.media.whiteShader );
+ CG_DrawPic( rect->x + rimWidth, rect->y,
+ leftWidth, rimWidth, cgs.media.whiteShader );
+ CG_DrawPic( rect->x + rimWidth, rect->y + rect->h - rimWidth,
+ leftWidth, rimWidth, cgs.media.whiteShader );
+ CG_DrawPic( rect->x + rimWidth + leftWidth, rect->y,
+ rimWidth + doneWidth, rect->h, cgs.media.whiteShader );
+ }
+ else
+ {
+ CG_DrawPic( rect->x, rect->y, rimWidth + doneWidth, rect->h, cgs.media.whiteShader );
+ CG_DrawPic( rimWidth + rect->x + doneWidth, rect->y,
+ leftWidth, rimWidth, cgs.media.whiteShader );
+ CG_DrawPic( rimWidth + rect->x + doneWidth, rect->y + rect->h - rimWidth,
+ leftWidth, rimWidth, cgs.media.whiteShader );
+ CG_DrawPic( rect->x + rect->w - rimWidth, rect->y, rimWidth, rect->h, cgs.media.whiteShader );
+ }
trap_R_SetColor( NULL );
@@ -466,13 +485,14 @@ static void CG_DrawPlayerBankValue( rectDef_t *rect, vec4_t color )
}
}
-static void CG_DrawPlayerStamina( rectDef_t *rect, vec4_t color, float scale, int align, int textStyle )
+static void CG_DrawPlayerStamina( rectDef_t *rect, vec4_t color, float scale,
+ int align, int textStyle, int special )
{
playerState_t *ps = &cg.snap->ps;
int stamina = ps->stats[ STAT_STAMINA ];
float progress = ( (float)stamina + (float)MAX_STAMINA ) / ( (float)MAX_STAMINA * 2.0f );
- CG_DrawProgressBar( rect, color, scale, align, textStyle, progress );
+ CG_DrawProgressBar( rect, color, scale, align, textStyle, special, progress );
}
static void CG_DrawPlayerAmmoValue( rectDef_t *rect, vec4_t color )
@@ -571,7 +591,8 @@ static void CG_DrawPlayerHealthValue( rectDef_t *rect, vec4_t color )
trap_R_SetColor( NULL );
}
-static void CG_DrawPlayerHealthBar( rectDef_t *rect, vec4_t color, float scale, int align, int textStyle )
+static void CG_DrawPlayerHealthBar( rectDef_t *rect, vec4_t color, float scale,
+ int align, int textStyle, int special )
{
playerState_t *ps;
float total;
@@ -579,7 +600,7 @@ static void CG_DrawPlayerHealthBar( rectDef_t *rect, vec4_t color, float scale,
ps = &cg.snap->ps;
total = ( (float)ps->stats[ STAT_HEALTH ] / (float)ps->stats[ STAT_MAX_HEALTH ] );
- CG_DrawProgressBar( rect, color, scale, align, textStyle, total );
+ CG_DrawProgressBar( rect, color, scale, align, textStyle, special, total );
}
static void CG_DrawProgressLabel( rectDef_t *rect, float text_x, float text_y, vec4_t color,
@@ -614,9 +635,10 @@ static void CG_DrawProgressLabel( rectDef_t *rect, float text_x, float text_y, v
s, 0, 0, ITEM_TEXTSTYLE_NEON );
}
-static void CG_DrawMediaProgress( rectDef_t *rect, vec4_t color, float scale, int align, int textStyle )
+static void CG_DrawMediaProgress( rectDef_t *rect, vec4_t color, float scale,
+ int align, int textStyle, int special )
{
- CG_DrawProgressBar( rect, color, scale, align, textStyle, cg.mediaFraction );
+ CG_DrawProgressBar( rect, color, scale, align, textStyle, special, cg.mediaFraction );
}
static void CG_DrawMediaProgressLabel( rectDef_t *rect, float text_x, float text_y,
@@ -625,9 +647,10 @@ static void CG_DrawMediaProgressLabel( rectDef_t *rect, float text_x, float text
CG_DrawProgressLabel( rect, text_x, text_y, color, scale, align, "Map and Textures", cg.mediaFraction );
}
-static void CG_DrawBuildablesProgress( rectDef_t *rect, vec4_t color, float scale, int align, int textStyle )
+static void CG_DrawBuildablesProgress( rectDef_t *rect, vec4_t color, float scale,
+ int align, int textStyle, int special )
{
- CG_DrawProgressBar( rect, color, scale, align, textStyle, cg.buildablesFraction );
+ CG_DrawProgressBar( rect, color, scale, align, textStyle, special, cg.buildablesFraction );
}
static void CG_DrawBuildablesProgressLabel( rectDef_t *rect, float text_x, float text_y,
@@ -636,9 +659,10 @@ static void CG_DrawBuildablesProgressLabel( rectDef_t *rect, float text_x, float
CG_DrawProgressLabel( rect, text_x, text_y, color, scale, align, "Buildable Models", cg.buildablesFraction );
}
-static void CG_DrawCharModelProgress( rectDef_t *rect, vec4_t color, float scale, int align, int textStyle )
+static void CG_DrawCharModelProgress( rectDef_t *rect, vec4_t color, float scale,
+ int align, int textStyle, int special )
{
- CG_DrawProgressBar( rect, color, scale, align, textStyle, cg.charModelFraction );
+ CG_DrawProgressBar( rect, color, scale, align, textStyle, special, cg.charModelFraction );
}
static void CG_DrawCharModelProgressLabel( rectDef_t *rect, float text_x, float text_y,
@@ -647,12 +671,13 @@ static void CG_DrawCharModelProgressLabel( rectDef_t *rect, float text_x, float
CG_DrawProgressLabel( rect, text_x, text_y, color, scale, align, "Character Models", cg.charModelFraction );
}
-static void CG_DrawOverallProgress( rectDef_t *rect, vec4_t color, float scale, int align, int textStyle )
+static void CG_DrawOverallProgress( rectDef_t *rect, vec4_t color, float scale,
+ int align, int textStyle, int special )
{
float total;
total = ( cg.charModelFraction + cg.buildablesFraction + cg.mediaFraction ) / 3.0f;
- CG_DrawProgressBar( rect, color, scale, align, textStyle, total );
+ CG_DrawProgressBar( rect, color, scale, align, textStyle, special, total );
}
static void CG_DrawLevelShot( rectDef_t *rect )
@@ -1530,7 +1555,7 @@ void CG_OwnerDraw( float x, float y, float w, float h, float text_x,
CG_DrawPlayerBankValue( &rect, color );
break;
case CG_PLAYER_STAMINA:
- CG_DrawPlayerStamina( &rect, color, scale, align, textStyle );
+ CG_DrawPlayerStamina( &rect, color, scale, align, textStyle, special );
break;
case CG_PLAYER_AMMO_VALUE:
CG_DrawPlayerAmmoValue( &rect, color );
@@ -1542,7 +1567,7 @@ void CG_OwnerDraw( float x, float y, float w, float h, float text_x,
CG_DrawPlayerHealthValue( &rect, color );
break;
case CG_PLAYER_HEALTH_BAR:
- CG_DrawPlayerHealthBar( &rect, color, scale, align, textStyle );
+ CG_DrawPlayerHealthBar( &rect, color, scale, align, textStyle, special );
break;
case CG_AREA_SYSTEMCHAT:
CG_DrawAreaSystemChat( &rect, scale, color, shader );
@@ -1571,25 +1596,25 @@ void CG_OwnerDraw( float x, float y, float w, float h, float text_x,
CG_DrawLevelShot( &rect );
break;
case CG_LOAD_MEDIA:
- CG_DrawMediaProgress( &rect, color, scale, align, textStyle );
+ CG_DrawMediaProgress( &rect, color, scale, align, textStyle, special );
break;
case CG_LOAD_MEDIA_LABEL:
CG_DrawMediaProgressLabel( &rect, text_x, text_y, color, scale, align );
break;
case CG_LOAD_BUILDABLES:
- CG_DrawBuildablesProgress( &rect, color, scale, align, textStyle );
+ CG_DrawBuildablesProgress( &rect, color, scale, align, textStyle, special );
break;
case CG_LOAD_BUILDABLES_LABEL:
CG_DrawBuildablesProgressLabel( &rect, text_x, text_y, color, scale, align );
break;
case CG_LOAD_CHARMODEL:
- CG_DrawCharModelProgress( &rect, color, scale, align, textStyle );
+ CG_DrawCharModelProgress( &rect, color, scale, align, textStyle, special );
break;
case CG_LOAD_CHARMODEL_LABEL:
CG_DrawCharModelProgressLabel( &rect, text_x, text_y, color, scale, align );
break;
case CG_LOAD_OVERALL:
- CG_DrawOverallProgress( &rect, color, scale, align, textStyle );
+ CG_DrawOverallProgress( &rect, color, scale, align, textStyle, special );
break;
case CG_LOAD_LEVELNAME:
CG_DrawLevelName( &rect, text_x, text_y, color, scale, align, textStyle );
diff --git a/src/game/g_active.c b/src/game/g_active.c
index ed4034d9..463868db 100644
--- a/src/game/g_active.c
+++ b/src/game/g_active.c
@@ -399,11 +399,6 @@ qboolean ClientInactivityTimer( gclient_t *client )
return qtrue;
}
-#define STAMINA_STOP_RESTORE 10
-#define STAMINA_WALK_RESTORE 5
-#define STAMINA_SPRINT_TAKE 10
-#define STAMINA_LARMOUR_TAKE 5
-
/*
==================
ClientTimerActions
diff --git a/src/game/tremulous.h b/src/game/tremulous.h
index 29c5b8e2..6d25456e 100644
--- a/src/game/tremulous.h
+++ b/src/game/tremulous.h
@@ -464,3 +464,9 @@
#define HUMAN_JOG_MODIFIER 0.8f
#define HUMAN_BACK_MODIFIER 0.5f
#define HUMAN_SIDE_MODIFIER 0.75f
+
+#define STAMINA_STOP_RESTORE 10
+#define STAMINA_WALK_RESTORE 5
+#define STAMINA_SPRINT_TAKE 10
+#define STAMINA_LARMOUR_TAKE 5
+
diff --git a/ui/menudef.h b/ui/menudef.h
index 7b920b7b..35bc6afd 100644
--- a/ui/menudef.h
+++ b/ui/menudef.h
@@ -51,32 +51,32 @@
#define LISTBOX_IMAGE 0x01
// list feeders
-#define FEEDER_HEADS 0x00 // model heads
-#define FEEDER_MAPS 0x01 // text maps based on game type
-#define FEEDER_SERVERS 0x02 // servers
-#define FEEDER_CLANS 0x03 // clan names
-#define FEEDER_ALLMAPS 0x04 // all maps available, in graphic format
-#define FEEDER_ALIENTEAM_LIST 0x05 // red team members
-#define FEEDER_HUMANTEAM_LIST 0x06 // blue team members
-#define FEEDER_PLAYER_LIST 0x07 // players
-#define FEEDER_TEAM_LIST 0x08 // team members for team voting
-#define FEEDER_MODS 0x09 // team members for team voting
-#define FEEDER_DEMOS 0x0a // team members for team voting
-#define FEEDER_SCOREBOARD 0x0b // team members for team voting
-#define FEEDER_Q3HEADS 0x0c // model heads
-#define FEEDER_SERVERSTATUS 0x0d // server status
-#define FEEDER_FINDPLAYER 0x0e // find player
-#define FEEDER_CINEMATICS 0x0f // cinematics
+#define FEEDER_HEADS 0x00 // model heads
+#define FEEDER_MAPS 0x01 // text maps based on game type
+#define FEEDER_SERVERS 0x02 // servers
+#define FEEDER_CLANS 0x03 // clan names
+#define FEEDER_ALLMAPS 0x04 // all maps available, in graphic format
+#define FEEDER_ALIENTEAM_LIST 0x05 // red team members
+#define FEEDER_HUMANTEAM_LIST 0x06 // blue team members
+#define FEEDER_PLAYER_LIST 0x07 // players
+#define FEEDER_TEAM_LIST 0x08 // team members for team voting
+#define FEEDER_MODS 0x09 // team members for team voting
+#define FEEDER_DEMOS 0x0a // team members for team voting
+#define FEEDER_SCOREBOARD 0x0b // team members for team voting
+#define FEEDER_Q3HEADS 0x0c // model heads
+#define FEEDER_SERVERSTATUS 0x0d // server status
+#define FEEDER_FINDPLAYER 0x0e // find player
+#define FEEDER_CINEMATICS 0x0f // cinematics
//TA: tremulous menus
-#define FEEDER_TREMTEAMS 0x10 //teams
-#define FEEDER_TREMALIENCLASSES 0x11 //alien classes
-#define FEEDER_TREMHUMANITEMS 0x12 //human items
-#define FEEDER_TREMHUMANARMOURYBUY 0x13 //human buy
-#define FEEDER_TREMHUMANARMOURYSELL 0x14 //human sell
-#define FEEDER_TREMALIENUPGRADE 0x15 //alien upgrade
-#define FEEDER_TREMALIENBUILD 0x16 //alien buildables
-#define FEEDER_TREMHUMANBUILD 0x17 //human buildables
+#define FEEDER_TREMTEAMS 0x10 //teams
+#define FEEDER_TREMALIENCLASSES 0x11 //alien classes
+#define FEEDER_TREMHUMANITEMS 0x12 //human items
+#define FEEDER_TREMHUMANARMOURYBUY 0x13 //human buy
+#define FEEDER_TREMHUMANARMOURYSELL 0x14 //human sell
+#define FEEDER_TREMALIENUPGRADE 0x15 //alien upgrade
+#define FEEDER_TREMALIENBUILD 0x16 //alien buildables
+#define FEEDER_TREMHUMANBUILD 0x17 //human buildables
//TA: tremulous menus
// display flags