diff options
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_event.c | 27 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 4 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 7 |
3 files changed, 36 insertions, 2 deletions
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 1896f013..24a9e988 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -410,6 +410,11 @@ CG_Menu */ void CG_Menu( int eventParm ) { + int i; + char carriageCvar[ MAX_TOKEN_CHARS ]; + + *carriageCvar = 0; + switch( eventParm ) { case MN_TEAM: trap_SendConsoleCommand( "menu tremulous_teamselect\n" ); break; @@ -417,7 +422,22 @@ void CG_Menu( int eventParm ) case MN_H_SPAWN: trap_SendConsoleCommand( "menu tremulous_humanitem\n" ); break; case MN_D_BUILD: trap_SendConsoleCommand( "menu tremulous_alienbuild\n" ); break; case MN_H_BUILD: trap_SendConsoleCommand( "menu tremulous_humanbuild\n" ); break; - case MN_H_MCU: trap_SendConsoleCommand( "menu tremulous_humanmcu\n" ); break; + case MN_H_MCU: + for( i = WP_NONE +1; i < WP_NUM_WEAPONS; i++ ) + { + if( BG_gotWeapon( i, cg.snap->ps.stats ) ) + strcat( carriageCvar, va( "W%d ", i ) ); + } + for( i = UP_NONE +1; i < UP_NUM_UPGRADES; i++ ) + { + if( BG_gotItem( i, cg.snap->ps.stats ) ) + strcat( carriageCvar, va( "U%d ", i ) ); + } + strcat( carriageCvar, "$" ); + + trap_Cvar_Set( "ui_carriage", carriageCvar ); + trap_SendConsoleCommand( "menu tremulous_humanmcu\n" ); + break; case MN_H_BANK: trap_SendConsoleCommand( "menu tremulous_humanbank\n" ); break; case MN_H_NOROOM: trap_SendConsoleCommand( "menu tremulous_human_no_room\n" ); break; case MN_H_NOPOWER: trap_SendConsoleCommand( "menu tremulous_human_no_power\n" ); break; @@ -435,7 +455,10 @@ void CG_Menu( int eventParm ) case MN_H_NOSLOTS: trap_SendConsoleCommand( "menu tremulous_human_no_slots\n" ); break; case MN_H_NOFUNDS: trap_SendConsoleCommand( "menu tremulous_human_no_funds\n" ); break; case MN_H_ITEMHELD: trap_SendConsoleCommand( "menu tremulous_human_item_held\n" ); break; - case MN_D_INFEST: trap_SendConsoleCommand( "menu dinfest\n" ); break; + case MN_D_INFEST: + trap_Cvar_Set( "ui_currentClass", va( "%d", cg.snap->ps.stats[ STAT_PCLASS ] ) ); + trap_SendConsoleCommand( "menu tremulous_alienupgrade\n" ); + break; default: Com_Printf( "cgame: debug: no such menu %d\n", eventParm ); diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 726622c2..44b4f9d4 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1224,6 +1224,10 @@ extern vmCvar_t cg_drawSurfNormal; extern vmCvar_t cg_debugAlloc; extern vmCvar_t cg_smoothTime; +//TA: hack to get class an carriage through to UI module +extern vmCvar_t ui_currentClass; +extern vmCvar_t ui_carriage; + // // cg_main.c // diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 32cc9bf5..3a384845 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -179,6 +179,10 @@ vmCvar_t cg_drawSurfNormal; vmCvar_t cg_debugAlloc; vmCvar_t cg_smoothTime; +//TA: hack to get class an carriage through to UI module +vmCvar_t ui_currentClass; +vmCvar_t ui_carriage; + typedef struct { vmCvar_t *vmCvar; @@ -260,6 +264,9 @@ static cvarTable_t cvarTable[] = { { &cg_drawSurfNormal, "cg_drawSurfNormal", "0", CVAR_CHEAT }, { &cg_debugAlloc, "cg_debugAlloc", "0", 0 }, { &cg_smoothTime, "cg_smoothTime", "300", 0 }, + + { &ui_currentClass, "ui_currentClass", "0", 0 }, + { &ui_carriage, "ui_carriage", "", 0 }, // the following variables are created in other parts of the system, // but we also reference them here |