summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_draw.c5
-rw-r--r--src/game/bg_misc.c49
-rw-r--r--src/game/bg_public.h4
-rw-r--r--src/game/g_client.c6
-rw-r--r--src/game/g_main.c10
5 files changed, 68 insertions, 6 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 42eebdbe..bd497cc5 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -2075,8 +2075,11 @@ static void CG_Draw2D( void )
{
if( cg_drawStatus.integer )
{
- Menu_PaintAll();
+ /*Menu_PaintAll();*/
/*CG_DrawTimedMenus();*/
+ Menu_Paint(
+ Menus_FindByName(
+ BG_FindHudNameForClass( cg.predictedPlayerState.stats[ STAT_PCLASS ] ) ), qtrue );
}
CG_DrawAmmoWarning();
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index 9f0d2ff4..80da6c98 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -1243,6 +1243,7 @@ classAttributes_t bg_classList[ ] =
"Builder", //char *humanName;
"lucy", //char *modelname;
"default", //char *skinname;
+ "alien_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -15, -15, -20 }, //vec3_t mins;
{ 15, 15, 20 }, //vec3_t maxs;
@@ -1269,6 +1270,7 @@ classAttributes_t bg_classList[ ] =
"Advanced Builder", //char *humanname;
"lucy", //char *modelname;
"angel", //char *skinname;
+ "alien_hud", //char *hudname;
( 1 << S2 )|( 1 << S3 ), //int stages
{ -20, -20, -20 }, //vec3_t mins;
{ 20, 20, 20 }, //vec3_t maxs;
@@ -1295,6 +1297,7 @@ classAttributes_t bg_classList[ ] =
"Offensive", //char *humanname;
"klesk", //char *modelname;
"default", //char *skinname;
+ "alien_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -15, -15, -15 }, //vec3_t mins;
{ 15, 15, 15 }, //vec3_t maxs;
@@ -1321,6 +1324,7 @@ classAttributes_t bg_classList[ ] =
"Offensive Level 1", //char *humanname;
"anarki", //char *modelname;
"default", //char *skinname;
+ "alien_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -24, -24, -24 }, //vec3_t mins;
{ 24, 24, 24 }, //vec3_t maxs;
@@ -1347,6 +1351,7 @@ classAttributes_t bg_classList[ ] =
"Offensive Level 1 Upgrade", //char *humanname;
"anarki", //char *modelname;
"default", //char *skinname;
+ "alien_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -24, -24, -24 }, //vec3_t mins;
{ 24, 24, 24 }, //vec3_t maxs;
@@ -1373,6 +1378,7 @@ classAttributes_t bg_classList[ ] =
"Offensive Level 2", //char *humanname;
"bones", //char *modelname;
"default", //char *skinname;
+ "alien_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -24, -24, -24 }, //vec3_t mins;
{ 24, 24, 24 }, //vec3_t maxs;
@@ -1399,6 +1405,7 @@ classAttributes_t bg_classList[ ] =
"Offensive Level 2 Upgrade", //char *humanname;
"bones", //char *modelname;
"default", //char *skinname;
+ "alien_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -24, -24, -24 }, //vec3_t mins;
{ 24, 24, 24 }, //vec3_t maxs;
@@ -1425,6 +1432,7 @@ classAttributes_t bg_classList[ ] =
"Offensive Level 3", //char *humanname;
"orbb", //char *modelname;
"default", //char *skinname;
+ "alien_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -15, -15, -15 }, //vec3_t mins;
{ 15, 15, 15 }, //vec3_t maxs;
@@ -1451,6 +1459,7 @@ classAttributes_t bg_classList[ ] =
"Offensive Level 3 Upgrade", //char *humanname;
"orbb", //char *modelname;
"default", //char *skinname;
+ "alien_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -15, -15, -15 }, //vec3_t mins;
{ 15, 15, 15 }, //vec3_t maxs;
@@ -1477,6 +1486,7 @@ classAttributes_t bg_classList[ ] =
"Offensive Level 4", //char *humanname;
"xaero", //char *modelname;
"default", //char *skinname;
+ "alien_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -15, -15, -15 }, //vec3_t mins;
{ 15, 15, 15 }, //vec3_t maxs;
@@ -1503,6 +1513,7 @@ classAttributes_t bg_classList[ ] =
"Human", //char *humanname;
"sarge", //char *modelname;
"default", //char *skinname;
+ "human_hud", //char *hudname;
( 1 << S1 )|( 1 << S2 )|( 1 << S3 ), //int stages
{ -15, -15, -24 }, //vec3_t mins;
{ 15, 15, 32 }, //vec3_t maxs;
@@ -1605,6 +1616,44 @@ char *BG_FindModelNameForClass( int pclass )
/*
==============
+BG_FindSkinNameForClass
+==============
+*/
+char *BG_FindSkinNameForClass( int pclass )
+{
+ int i;
+
+ for( i = 0; i < bg_numPclasses; i++ )
+ {
+ if( bg_classList[ i ].classNum == pclass )
+ return bg_classList[ i ].skinName;
+ }
+
+ //note: must return a valid modelName!
+ return bg_classList[ 0 ].skinName;
+}
+
+/*
+==============
+BG_FindHudNameForClass
+==============
+*/
+char *BG_FindHudNameForClass( int pclass )
+{
+ int i;
+
+ for( i = 0; i < bg_numPclasses; i++ )
+ {
+ if( bg_classList[ i ].classNum == pclass )
+ return bg_classList[ i ].hudName;
+ }
+
+ //note: must return a valid modelName!
+ return bg_classList[ 0 ].hudName;
+}
+
+/*
+==============
BG_FindStagesForClass
==============
*/
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index 84e82148..26fbd152 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -832,6 +832,8 @@ typedef struct
char *modelName;
char *skinName;
+ char *hudName;
+
int stages;
vec3_t mins;
@@ -1004,6 +1006,8 @@ int BG_FindClassNumForName( char *name );
char *BG_FindNameForClassNum( int pclass );
char *BG_FindHumanNameForClassNum( int pclass );
char *BG_FindModelNameForClass( int pclass );
+char *BG_FindSkinNameForClass( int pclass );
+char *BG_FindHudNameForClass( int pclass );
qboolean BG_FindStagesForClass( int pclass, stage_t stage );
void BG_FindBBoxForClass( int pclass, vec3_t mins, vec3_t maxs, vec3_t cmaxs, vec3_t dmins, vec3_t dmaxs );
void BG_FindViewheightForClass( int pclass, int *viewheight, int *cViewheight );
diff --git a/src/game/g_client.c b/src/game/g_client.c
index 0d21a686..8f6678a5 100644
--- a/src/game/g_client.c
+++ b/src/game/g_client.c
@@ -1001,6 +1001,7 @@ void ClientUserinfoChanged( int clientNum ) {
int teamTask, teamLeader, team, health;
char *s;
char model[MAX_QPATH];
+ char buffer[ MAX_QPATH ];
char oldname[MAX_STRING_CHARS];
gclient_t *client;
char c1[MAX_INFO_STRING];
@@ -1063,8 +1064,9 @@ void ClientUserinfoChanged( int clientNum ) {
client->pers.maxHealth = 0;
// set model
- s = BG_FindModelNameForClass( client->pers.pclass );
- Q_strncpyz( model, s, sizeof( model ) );
+ Com_sprintf( buffer, MAX_QPATH, "%s/%s", BG_FindModelNameForClass( client->pers.pclass ),
+ BG_FindSkinNameForClass( client->pers.pclass ) );
+ Q_strncpyz( model, buffer, sizeof( model ) );
// wallwalk follow
s = Info_ValueForKey( userinfo, "cg_wwFollow" );
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 0561b484..112f1854 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -312,13 +312,17 @@ G_RegisterPlayerModels
*/
void G_RegisterPlayerModels( void )
{
- char *s, *class;
+ char buffer[ MAX_INFO_STRING ];
+ char *s;
int i;
for( i = PCL_NONE + 1; i < PCL_NUM_CLASSES; i++ )
{
- class = BG_FindModelNameForClass( i );
- s = va("n\\%s%d\\t\\%i\\model\\%s\\hmodel\\%s\\g_redteam\\%s\\g_blueteam\\%s\\c1\\%s\\hc\\%i\\w\\%i\\l\\%i\\tt\\%d\\tl\\%d", "precache", i, 0, class, class, 0, 0, "7", 100, 0, 0, 0, 0);
+ Com_sprintf( buffer, MAX_INFO_STRING, "%s/%s",
+ BG_FindModelNameForClass( i ), BG_FindSkinNameForClass( i ) );
+ s = va( "n\\%s%d\\t\\%i\\model\\%s\\hmodel\\%s\\g_redteam\\%s\\"
+ "g_blueteam\\%s\\c1\\%s\\hc\\%i\\w\\%i\\l\\%i\\tt\\%d\\tl\\%d",
+ "precache", i, 0, buffer, buffer, 0, 0, "7", 100, 0, 0, 0, 0);
trap_SetConfigstring( CS_PRECACHES + i, s );
}