diff options
author | Tim Angus <tim@ngus.net> | 2001-12-21 03:20:26 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2001-12-21 03:20:26 +0000 |
commit | a7a3acb74b2a6ade77e8aac1aa779b1563dea47f (patch) | |
tree | ba9dec5482aaf97c963291dddd27ca8bcc6bc3b5 | |
parent | 4ea86bf171392a3731425efa8630429d1711c9c6 (diff) |
New menus (including dynamic ones)
-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 | ||||
-rw-r--r-- | src/ui/ui_local.h | 41 | ||||
-rw-r--r-- | src/ui/ui_main.c | 368 | ||||
-rw-r--r-- | ui/menudef.h | 159 |
6 files changed, 529 insertions, 77 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 diff --git a/src/ui/ui_local.h b/src/ui/ui_local.h index c146ddb2..ee8c2b54 100644 --- a/src/ui/ui_local.h +++ b/src/ui/ui_local.h @@ -748,6 +748,13 @@ typedef struct { const char *modDescr; } modInfo_t; +//TA: tremulous menus +typedef struct +{ + const char *text; + const char *cmd; +} tremMenuItem_t; +//TA: tremulous menus typedef struct { displayContextDef_t uiDC; @@ -808,6 +815,40 @@ typedef struct { int movieIndex; int previewMovie; +//TA: tremulous menus + tremMenuItem_t tremTeamList[ 3 ]; + int tremTeamCount; + int tremTeamIndex; + + tremMenuItem_t tremAlienClassList[ 3 ]; + int tremAlienClassCount; + int tremAlienClassIndex; + + tremMenuItem_t tremHumanItemList[ 2 ]; + int tremHumanItemCount; + int tremHumanItemIndex; + + tremMenuItem_t tremHumanMCUBuyList[ 11 ]; + int tremHumanMCUBuyCount; + int tremHumanMCUBuyIndex; + + tremMenuItem_t tremHumanMCUSellList[ 11 ]; + int tremHumanMCUSellCount; + int tremHumanMCUSellIndex; + + tremMenuItem_t tremAlienUpgradeList[ 2 ]; + int tremAlienUpgradeCount; + int tremAlienUpgradeIndex; + + tremMenuItem_t tremAlienBuildList[ 6 ]; + int tremAlienBuildCount; + int tremAlienBuildIndex; + + tremMenuItem_t tremHumanBuildList[ 11 ]; + int tremHumanBuildCount; + int tremHumanBuildIndex; +//TA: tremulous menus + serverStatus_t serverStatus; // for the showing the status of a server diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index f2ee5ea0..cab77c78 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -2813,6 +2813,252 @@ static void UI_StartSinglePlayer() { /* =============== +UI_LoadTremTeams +=============== +*/ +static void UI_LoadTremTeams( ) +{ + uiInfo.tremTeamCount = 3; + uiInfo.tremTeamList[ 0 ].text = String_Alloc( "Aliens" ); + uiInfo.tremTeamList[ 0 ].cmd = String_Alloc( "cmd team aliens" ); + + uiInfo.tremTeamList[ 1 ].text = String_Alloc( "Humans" ); + uiInfo.tremTeamList[ 1 ].cmd = String_Alloc( "cmd team humans" ); + + uiInfo.tremTeamList[ 2 ].text = String_Alloc( "Spectate" ); + uiInfo.tremTeamList[ 2 ].cmd = String_Alloc( "cmd team spectate" ); +} + +/* +=============== +UI_LoadTremAlienClasses +=============== +*/ +static void UI_LoadTremAlienClasses( ) +{ + uiInfo.tremAlienClassCount = 3; + uiInfo.tremAlienClassList[ 0 ].text = String_Alloc( "Builder" ); + uiInfo.tremAlienClassList[ 0 ].cmd = String_Alloc( "cmd class builder" ); + + uiInfo.tremAlienClassList[ 1 ].text = String_Alloc( "Advanced Builder" ); + uiInfo.tremAlienClassList[ 1 ].cmd = String_Alloc( "cmd class builderlevel1" ); + + uiInfo.tremAlienClassList[ 2 ].text = String_Alloc( "Offensive" ); + uiInfo.tremAlienClassList[ 2 ].cmd = String_Alloc( "cmd class offensive" ); +} + +/* +=============== +UI_LoadTremHumanItems +=============== +*/ +static void UI_LoadTremHumanItems( ) +{ + uiInfo.tremHumanItemCount = 2; + uiInfo.tremHumanItemList[ 0 ].text = String_Alloc( "Rifle" ); + uiInfo.tremHumanItemList[ 0 ].cmd = String_Alloc( "cmd class rifle" ); + + uiInfo.tremHumanItemList[ 1 ].text = String_Alloc( "Construction Kit" ); + uiInfo.tremHumanItemList[ 1 ].cmd = String_Alloc( "cmd class ckit" ); +} + +/* +=============== +UI_LoadTremHumanMCUBuys +=============== +*/ +static void UI_LoadTremHumanMCUBuys( ) +{ + uiInfo.tremHumanMCUBuyCount = 11; + uiInfo.tremHumanMCUBuyList[ 0 ].text = String_Alloc( "Rifle" ); + uiInfo.tremHumanMCUBuyList[ 0 ].cmd = String_Alloc( "cmd buy rifle" ); + + uiInfo.tremHumanMCUBuyList[ 1 ].text = String_Alloc( "Chaingun" ); + uiInfo.tremHumanMCUBuyList[ 1 ].cmd = String_Alloc( "cmd buy chaingun" ); + + uiInfo.tremHumanMCUBuyList[ 2 ].text = String_Alloc( "Flamer" ); + uiInfo.tremHumanMCUBuyList[ 2 ].cmd = String_Alloc( "cmd buy flamer" ); + + uiInfo.tremHumanMCUBuyList[ 3 ].text = String_Alloc( "Mass Driver" ); + uiInfo.tremHumanMCUBuyList[ 3 ].cmd = String_Alloc( "cmd buy mdriver" ); + + uiInfo.tremHumanMCUBuyList[ 4 ].text = String_Alloc( "Pulse Rifle" ); + uiInfo.tremHumanMCUBuyList[ 4 ].cmd = String_Alloc( "cmd buy prifle" ); + + uiInfo.tremHumanMCUBuyList[ 5 ].text = String_Alloc( "NVG" ); + uiInfo.tremHumanMCUBuyList[ 5 ].cmd = String_Alloc( "cmd buy nvg" ); + + uiInfo.tremHumanMCUBuyList[ 6 ].text = String_Alloc( "Torch" ); + uiInfo.tremHumanMCUBuyList[ 6 ].cmd = String_Alloc( "cmd buy torch" ); + + uiInfo.tremHumanMCUBuyList[ 7 ].text = String_Alloc( "Chest Armour" ); + uiInfo.tremHumanMCUBuyList[ 7 ].cmd = String_Alloc( "cmd buy carmour" ); + + uiInfo.tremHumanMCUBuyList[ 8 ].text = String_Alloc( "Limb Armour" ); + uiInfo.tremHumanMCUBuyList[ 8 ].cmd = String_Alloc( "cmd buy larmour" ); + + uiInfo.tremHumanMCUBuyList[ 9 ].text = String_Alloc( "Helmet" ); + uiInfo.tremHumanMCUBuyList[ 9 ].cmd = String_Alloc( "cmd buy helmet" ); + + uiInfo.tremHumanMCUBuyList[ 10 ].text = String_Alloc( "Battlesuit" ); + uiInfo.tremHumanMCUBuyList[ 10 ].cmd = String_Alloc( "cmd buy bsuit" ); +} + +/* +=============== +UI_LoadTremHumanMCUSells +=============== +*/ +static void UI_LoadTremHumanMCUSells( ) +{ + int i, j = 0; + char carriageCvar[ MAX_TOKEN_CHARS ]; + char *iterator; + char buffer[ MAX_TOKEN_CHARS ]; + char *bufPointer; + + uiInfo.tremHumanMCUSellCount = 0; + trap_Cvar_VariableStringBuffer( "ui_carriage", carriageCvar, sizeof( carriageCvar ) ); + iterator = carriageCvar; + + //simple parser to give rise to weapon/upgrade list + while( iterator && iterator[ 0 ] != '$' ) + { + bufPointer = buffer; + + if( iterator[ 0 ] == 'W' ) + { + iterator++; + + while( iterator[ 0 ] != ' ' ) + *bufPointer++ = *iterator++; + + *bufPointer++ = '\n'; + + i = atoi( buffer ); + uiInfo.tremHumanMCUSellList[ j ].text = String_Alloc( BG_FindHumanNameForWeapon( i ) ); + uiInfo.tremHumanMCUSellList[ j++ ].cmd = + String_Alloc( va( "cmd sell %s", BG_FindNameForWeapon( i ) ) ); + + uiInfo.tremHumanMCUSellCount++; + } + else if( iterator[ 0 ] == 'U' ) + { + iterator++; + + while( iterator[ 0 ] != ' ' ) + *bufPointer++ = *iterator++; + + *bufPointer++ = '\n'; + + i = atoi( buffer ); + uiInfo.tremHumanMCUSellList[ j ].text = String_Alloc( BG_FindHumanNameForUpgrade( i ) ); + uiInfo.tremHumanMCUSellList[ j++ ].cmd = + String_Alloc( va( "cmd sell %s", BG_FindNameForUpgrade( i ) ) ); + + uiInfo.tremHumanMCUSellCount++; + } + + iterator++; + } +} + +/* +=============== +UI_LoadTremAlienUpgrades( ) +=============== +*/ +static void UI_LoadTremAlienUpgrades( ) +{ + int i, j = 0; + int class = trap_Cvar_VariableValue( "ui_currentClass" ); + + uiInfo.tremAlienUpgradeCount = 0; + + for( i = PCL_NONE + 1; i < PCL_NUM_CLASSES; i++ ) + { + if( BG_ClassCanEvolveFromTo( class, i ) ) + { + uiInfo.tremAlienUpgradeList[ j ].text = String_Alloc( BG_FindNameForClassNum( i ) ); + uiInfo.tremAlienUpgradeList[ j++ ].cmd = + String_Alloc( va( "cmd class %s", BG_FindNameForClassNum( i ) ) ); + + uiInfo.tremAlienUpgradeCount++; + } + } +} + +/* +=============== +UI_LoadTremAlienBuilds +=============== +*/ +static void UI_LoadTremAlienBuilds( ) +{ + uiInfo.tremAlienBuildCount = 6; + uiInfo.tremAlienBuildList[ 0 ].text = String_Alloc( "Egg" ); + uiInfo.tremAlienBuildList[ 0 ].cmd = String_Alloc( "cmd build bioegg" ); + + uiInfo.tremAlienBuildList[ 1 ].text = String_Alloc( "Barricade" ); + uiInfo.tremAlienBuildList[ 1 ].cmd = String_Alloc( "cmd build barricade" ); + + uiInfo.tremAlienBuildList[ 2 ].text = String_Alloc( "Acid Tube" ); + uiInfo.tremAlienBuildList[ 2 ].cmd = String_Alloc( "cmd build acid_tube" ); + + uiInfo.tremAlienBuildList[ 3 ].text = String_Alloc( "Trapper" ); + uiInfo.tremAlienBuildList[ 3 ].cmd = String_Alloc( "cmd build trapper" ); + + uiInfo.tremAlienBuildList[ 4 ].text = String_Alloc( "Hivemind" ); + uiInfo.tremAlienBuildList[ 4 ].cmd = String_Alloc( "cmd build hivemind" ); + + uiInfo.tremAlienBuildList[ 5 ].text = String_Alloc( "Booster" ); + uiInfo.tremAlienBuildList[ 5 ].cmd = String_Alloc( "cmd build booster" ); +} + +/* +=============== +UI_LoadTremHumanBuilds +=============== +*/ +static void UI_LoadTremHumanBuilds( ) +{ + uiInfo.tremHumanBuildCount = 11; + uiInfo.tremHumanBuildList[ 0 ].text = String_Alloc( "Replicator" ); + uiInfo.tremHumanBuildList[ 0 ].cmd = String_Alloc( "cmd build replicator" ); + + uiInfo.tremHumanBuildList[ 1 ].text = String_Alloc( "M.C.U." ); + uiInfo.tremHumanBuildList[ 1 ].cmd = String_Alloc( "cmd build mcu" ); + + uiInfo.tremHumanBuildList[ 2 ].text = String_Alloc( "Computer" ); + uiInfo.tremHumanBuildList[ 2 ].cmd = String_Alloc( "cmd build computer" ); + + uiInfo.tremHumanBuildList[ 3 ].text = String_Alloc( "Medistation" ); + uiInfo.tremHumanBuildList[ 3 ].cmd = String_Alloc( "cmd build medistat" ); + + uiInfo.tremHumanBuildList[ 4 ].text = String_Alloc( "Bank" ); + uiInfo.tremHumanBuildList[ 4 ].cmd = String_Alloc( "cmd build bank" ); + + uiInfo.tremHumanBuildList[ 5 ].text = String_Alloc( "Machinegun Turret" ); + uiInfo.tremHumanBuildList[ 5 ].cmd = String_Alloc( "cmd build mgturret" ); + + uiInfo.tremHumanBuildList[ 6 ].text = String_Alloc( "Plasma Turret" ); + uiInfo.tremHumanBuildList[ 6 ].cmd = String_Alloc( "cmd build plasmaturret" ); + + uiInfo.tremHumanBuildList[ 7 ].text = String_Alloc( "Tesla Generator" ); + uiInfo.tremHumanBuildList[ 7 ].cmd = String_Alloc( "cmd build tesla" ); + + uiInfo.tremHumanBuildList[ 8 ].text = String_Alloc( "Floatmine" ); + uiInfo.tremHumanBuildList[ 8 ].cmd = String_Alloc( "cmd build floatmine" ); + + uiInfo.tremHumanBuildList[ 9 ].text = String_Alloc( "Reactor" ); + uiInfo.tremHumanBuildList[ 9 ].cmd = String_Alloc( "cmd build reactor" ); + + uiInfo.tremHumanBuildList[ 10 ].text = String_Alloc( "Repeater" ); + uiInfo.tremHumanBuildList[ 10 ].cmd = String_Alloc( "cmd build repeater" ); +} + +/* +=============== UI_LoadMods =============== */ @@ -3297,7 +3543,44 @@ static void UI_RunMenuScript(char **args) { UI_LoadMovies(); } else if (Q_stricmp(name, "LoadMods") == 0) { UI_LoadMods(); - } else if (Q_stricmp(name, "playMovie") == 0) { + } + +//TA: tremulous menus + else if( Q_stricmp( name, "LoadTeams" ) == 0 ) + UI_LoadTremTeams( ); + else if( Q_stricmp( name, "JoinTeam" ) == 0 ) + trap_Cmd_ExecuteText( EXEC_APPEND, uiInfo.tremTeamList[ uiInfo.tremTeamIndex ].cmd ); + else if( Q_stricmp( name, "LoadHumanItems" ) == 0 ) + UI_LoadTremHumanItems( ); + else if( Q_stricmp( name, "SpawnWithHumanItem" ) == 0 ) + trap_Cmd_ExecuteText( EXEC_APPEND, uiInfo.tremHumanItemList[ uiInfo.tremHumanItemIndex ].cmd ); + else if( Q_stricmp( name, "LoadAlienClasses" ) == 0 ) + UI_LoadTremAlienClasses( ); + else if( Q_stricmp( name, "SpawnAsAlienClass" ) == 0 ) + trap_Cmd_ExecuteText( EXEC_APPEND, uiInfo.tremAlienClassList[ uiInfo.tremAlienClassIndex ].cmd ); + else if( Q_stricmp( name, "LoadHumanMCUBuys" ) == 0 ) + UI_LoadTremHumanMCUBuys( ); + else if( Q_stricmp( name, "BuyFromMCU" ) == 0 ) + trap_Cmd_ExecuteText( EXEC_APPEND, uiInfo.tremHumanMCUBuyList[ uiInfo.tremHumanMCUBuyIndex ].cmd ); + else if( Q_stricmp( name, "LoadHumanMCUSells" ) == 0 ) + UI_LoadTremHumanMCUSells( ); + else if( Q_stricmp( name, "SellToMCU" ) == 0 ) + trap_Cmd_ExecuteText( EXEC_APPEND, uiInfo.tremHumanMCUSellList[ uiInfo.tremHumanMCUSellIndex ].cmd ); + else if( Q_stricmp( name, "LoadAlienUpgrades" ) == 0 ) + UI_LoadTremAlienUpgrades( ); + else if( Q_stricmp( name, "UpgradeToNewClass" ) == 0 ) + trap_Cmd_ExecuteText( EXEC_APPEND, uiInfo.tremAlienUpgradeList[ uiInfo.tremAlienUpgradeIndex ].cmd ); + else if( Q_stricmp( name, "LoadAlienBuilds" ) == 0 ) + UI_LoadTremAlienBuilds( ); + else if( Q_stricmp( name, "BuildAlienBuildable" ) == 0 ) + trap_Cmd_ExecuteText( EXEC_APPEND, uiInfo.tremAlienBuildList[ uiInfo.tremAlienBuildIndex ].cmd ); + else if( Q_stricmp( name, "LoadHumanBuilds" ) == 0 ) + UI_LoadTremHumanBuilds( ); + else if( Q_stricmp( name, "BuildHumanBuildable" ) == 0 ) + trap_Cmd_ExecuteText( EXEC_APPEND, uiInfo.tremHumanBuildList[ uiInfo.tremHumanBuildIndex ].cmd ); +//TA: tremulous menus + + else if (Q_stricmp(name, "playMovie") == 0) { if (uiInfo.previewMovie >= 0) { trap_CIN_StopCinematic(uiInfo.previewMovie); } @@ -4218,6 +4501,26 @@ static int UI_FeederCount(float feederID) { } else if (feederID == FEEDER_DEMOS) { return uiInfo.demoCount; } + +//TA: tremulous menus + else if( feederID == FEEDER_TREMTEAMS ) + return uiInfo.tremTeamCount; + else if( feederID == FEEDER_TREMHUMANITEMS ) + return uiInfo.tremHumanItemCount; + else if( feederID == FEEDER_TREMALIENCLASSES ) + return uiInfo.tremAlienClassCount; + else if( feederID == FEEDER_TREMHUMANMCUBUY ) + return uiInfo.tremHumanMCUBuyCount; + else if( feederID == FEEDER_TREMHUMANMCUSELL ) + return uiInfo.tremHumanMCUSellCount; + else if( feederID == FEEDER_TREMALIENUPGRADE ) + return uiInfo.tremAlienUpgradeCount; + else if( feederID == FEEDER_TREMALIENBUILD ) + return uiInfo.tremAlienBuildCount; + else if( feederID == FEEDER_TREMHUMANBUILD ) + return uiInfo.tremHumanBuildCount; +//TA: tremulous menus + return 0; } @@ -4383,6 +4686,50 @@ static const char *UI_FeederItemText(float feederID, int index, int column, qhan return uiInfo.demoList[index]; } } + +//TA: tremulous menus + else if( feederID == FEEDER_TREMTEAMS ) + { + if( index >= 0 && index < uiInfo.tremTeamCount ) + return uiInfo.tremTeamList[ index ].text; + } + else if( feederID == FEEDER_TREMHUMANITEMS ) + { + if( index >= 0 && index < uiInfo.tremHumanItemCount ) + return uiInfo.tremHumanItemList[ index ].text; + } + else if( feederID == FEEDER_TREMALIENCLASSES ) + { + if( index >= 0 && index < uiInfo.tremAlienClassCount ) + return uiInfo.tremAlienClassList[ index ].text; + } + else if( feederID == FEEDER_TREMHUMANMCUBUY ) + { + if( index >= 0 && index < uiInfo.tremHumanMCUBuyCount ) + return uiInfo.tremHumanMCUBuyList[ index ].text; + } + else if( feederID == FEEDER_TREMHUMANMCUSELL ) + { + if( index >= 0 && index < uiInfo.tremHumanMCUSellCount ) + return uiInfo.tremHumanMCUSellList[ index ].text; + } + else if( feederID == FEEDER_TREMALIENUPGRADE ) + { + if( index >= 0 && index < uiInfo.tremAlienUpgradeCount ) + return uiInfo.tremAlienUpgradeList[ index ].text; + } + else if( feederID == FEEDER_TREMALIENBUILD ) + { + if( index >= 0 && index < uiInfo.tremAlienBuildCount ) + return uiInfo.tremAlienBuildList[ index ].text; + } + else if( feederID == FEEDER_TREMHUMANBUILD ) + { + if( index >= 0 && index < uiInfo.tremHumanBuildCount ) + return uiInfo.tremHumanBuildList[ index ].text; + } +//TA: tremulous menus + return ""; } @@ -4496,6 +4843,25 @@ static void UI_FeederSelection(float feederID, int index) { } else if (feederID == FEEDER_DEMOS) { uiInfo.demoIndex = index; } + +//TA: tremulous menus + else if( feederID == FEEDER_TREMTEAMS ) + uiInfo.tremTeamIndex = index; + else if( feederID == FEEDER_TREMHUMANITEMS ) + uiInfo.tremHumanItemIndex = index; + else if( feederID == FEEDER_TREMALIENCLASSES ) + uiInfo.tremAlienClassIndex = index; + else if( feederID == FEEDER_TREMHUMANMCUBUY ) + uiInfo.tremHumanMCUBuyIndex = index; + else if( feederID == FEEDER_TREMHUMANMCUSELL ) + uiInfo.tremHumanMCUSellIndex = index; + else if( feederID == FEEDER_TREMALIENUPGRADE ) + uiInfo.tremAlienUpgradeIndex = index; + else if( feederID == FEEDER_TREMALIENBUILD ) + uiInfo.tremAlienBuildIndex = index; + else if( feederID == FEEDER_TREMHUMANBUILD ) + uiInfo.tremHumanBuildIndex = index; +//TA: tremulous menus } static qboolean Team_Parse(char **p) { diff --git a/ui/menudef.h b/ui/menudef.h index d061e226..bedefc46 100644 --- a/ui/menudef.h +++ b/ui/menudef.h @@ -12,7 +12,7 @@ #define ITEM_TYPE_SLIDER 10 // mouse speed, volume, etc. #define ITEM_TYPE_YESNO 11 // yes no cvar setting #define ITEM_TYPE_MULTI 12 // multiple list setting, enumerated -#define ITEM_TYPE_BIND 13 // multiple list setting, enumerated +#define ITEM_TYPE_BIND 13 // multiple list setting, enumerated #define ITEM_ALIGN_LEFT 0 // left alignment #define ITEM_ALIGN_CENTER 1 // center alignment @@ -42,30 +42,41 @@ #define MENU_TRUE 1 // uh.. true #define MENU_FALSE 0 // and false -#define HUD_VERTICAL 0x00 -#define HUD_HORIZONTAL 0x01 +#define HUD_VERTICAL 0x00 +#define HUD_HORIZONTAL 0x01 // list box element types #define LISTBOX_TEXT 0x00 #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_REDTEAM_LIST 0x05 // red team members -#define FEEDER_BLUETEAM_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_REDTEAM_LIST 0x05 // red team members +#define FEEDER_BLUETEAM_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_TREMHUMANMCUBUY 0x13 //human mcu +#define FEEDER_TREMHUMANMCUSELL 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 #define CG_SHOW_BLUE_TEAM_HAS_REDFLAG 0x00000001 @@ -79,31 +90,31 @@ #define CG_SHOW_SINGLEPLAYER 0x00000100 #define CG_SHOW_TOURNAMENT 0x00000200 #define CG_SHOW_DURINGINCOMINGVOICE 0x00000400 -#define CG_SHOW_IF_PLAYER_HAS_FLAG 0x00000800 -#define CG_SHOW_LANPLAYONLY 0x00001000 -#define CG_SHOW_MINED 0x00002000 -#define CG_SHOW_HEALTHOK 0x00004000 -#define CG_SHOW_TEAMINFO 0x00008000 -#define CG_SHOW_NOTEAMINFO 0x00010000 +#define CG_SHOW_IF_PLAYER_HAS_FLAG 0x00000800 +#define CG_SHOW_LANPLAYONLY 0x00001000 +#define CG_SHOW_MINED 0x00002000 +#define CG_SHOW_HEALTHOK 0x00004000 +#define CG_SHOW_TEAMINFO 0x00008000 +#define CG_SHOW_NOTEAMINFO 0x00010000 #define CG_SHOW_OTHERTEAMHASFLAG 0x00020000 #define CG_SHOW_YOURTEAMHASENEMYFLAG 0x00040000 #define CG_SHOW_ANYNONTEAMGAME 0x00080000 -#define CG_SHOW_2DONLY 0x10000000 +#define CG_SHOW_2DONLY 0x10000000 -#define UI_SHOW_LEADER 0x00000001 -#define UI_SHOW_NOTLEADER 0x00000002 -#define UI_SHOW_FAVORITESERVERS 0x00000004 -#define UI_SHOW_ANYNONTEAMGAME 0x00000008 -#define UI_SHOW_ANYTEAMGAME 0x00000010 -#define UI_SHOW_NEWHIGHSCORE 0x00000020 -#define UI_SHOW_DEMOAVAILABLE 0x00000040 -#define UI_SHOW_NEWBESTTIME 0x00000080 -#define UI_SHOW_FFA 0x00000100 -#define UI_SHOW_NOTFFA 0x00000200 -#define UI_SHOW_NETANYNONTEAMGAME 0x00000400 -#define UI_SHOW_NETANYTEAMGAME 0x00000800 -#define UI_SHOW_NOTFAVORITESERVERS 0x00001000 +#define UI_SHOW_LEADER 0x00000001 +#define UI_SHOW_NOTLEADER 0x00000002 +#define UI_SHOW_FAVORITESERVERS 0x00000004 +#define UI_SHOW_ANYNONTEAMGAME 0x00000008 +#define UI_SHOW_ANYTEAMGAME 0x00000010 +#define UI_SHOW_NEWHIGHSCORE 0x00000020 +#define UI_SHOW_DEMOAVAILABLE 0x00000040 +#define UI_SHOW_NEWBESTTIME 0x00000080 +#define UI_SHOW_FFA 0x00000100 +#define UI_SHOW_NOTFFA 0x00000200 +#define UI_SHOW_NETANYNONTEAMGAME 0x00000400 +#define UI_SHOW_NETANYTEAMGAME 0x00000800 +#define UI_SHOW_NOTFAVORITESERVERS 0x00001000 @@ -147,14 +158,14 @@ #define CG_RED_SCORE 28 #define CG_RED_NAME 29 #define CG_BLUE_NAME 30 -#define CG_HARVESTER_SKULLS 31 // only shows in harvester -#define CG_ONEFLAG_STATUS 32 // only shows in one flag +#define CG_HARVESTER_SKULLS 31 // only shows in harvester +#define CG_ONEFLAG_STATUS 32 // only shows in one flag #define CG_PLAYER_LOCATION 33 #define CG_TEAM_COLOR 34 #define CG_CTF_POWERUP 35 -#define CG_AREA_POWERUP 36 -#define CG_AREA_LAGOMETER 37 // painted with old system +#define CG_AREA_POWERUP 36 +#define CG_AREA_LAGOMETER 37 // painted with old system #define CG_PLAYER_HASFLAG 38 #define CG_GAME_TYPE 39 // not done @@ -183,8 +194,8 @@ #define CG_VOICE_HEAD 62 #define CG_VOICE_NAME 63 #define CG_PLAYER_HASFLAG2D 64 -#define CG_HARVESTER_SKULLS2D 65 // only shows in harvester -#define CG_CAPFRAGLIMIT 66 +#define CG_HARVESTER_SKULLS2D 65 // only shows in harvester +#define CG_CAPFRAGLIMIT 66 #define CG_1STPLACE 67 #define CG_2NDPLACE 68 #define CG_CAPTURES 69 @@ -249,32 +260,32 @@ #define UI_STARTMAPCINEMATIC 255 #define UI_MAPS_SELECTION 256 -#define VOICECHAT_GETFLAG "getflag" // command someone to get the flag -#define VOICECHAT_OFFENSE "offense" // command someone to go on offense -#define VOICECHAT_DEFEND "defend" // command someone to go on defense -#define VOICECHAT_DEFENDFLAG "defendflag" // command someone to defend the flag -#define VOICECHAT_PATROL "patrol" // command someone to go on patrol (roam) -#define VOICECHAT_CAMP "camp" // command someone to camp (we don't have sounds for this one) -#define VOICECHAT_FOLLOWME "followme" // command someone to follow you -#define VOICECHAT_RETURNFLAG "returnflag" // command someone to return our flag -#define VOICECHAT_FOLLOWFLAGCARRIER "followflagcarrier" // command someone to follow the flag carrier -#define VOICECHAT_YES "yes" // yes, affirmative, etc. -#define VOICECHAT_NO "no" // no, negative, etc. -#define VOICECHAT_ONGETFLAG "ongetflag" // I'm getting the flag -#define VOICECHAT_ONOFFENSE "onoffense" // I'm on offense -#define VOICECHAT_ONDEFENSE "ondefense" // I'm on defense -#define VOICECHAT_ONPATROL "onpatrol" // I'm on patrol (roaming) -#define VOICECHAT_ONCAMPING "oncamp" // I'm camping somewhere -#define VOICECHAT_ONFOLLOW "onfollow" // I'm following -#define VOICECHAT_ONFOLLOWCARRIER "onfollowcarrier" // I'm following the flag carrier -#define VOICECHAT_ONRETURNFLAG "onreturnflag" // I'm returning our flag -#define VOICECHAT_INPOSITION "inposition" // I'm in position -#define VOICECHAT_IHAVEFLAG "ihaveflag" // I have the flag -#define VOICECHAT_BASEATTACK "baseattack" // the base is under attack -#define VOICECHAT_ENEMYHASFLAG "enemyhasflag" // the enemy has our flag (CTF) -#define VOICECHAT_STARTLEADER "startleader" // I'm the leader -#define VOICECHAT_STOPLEADER "stopleader" // I resign leadership -#define VOICECHAT_TRASH "trash" // lots of trash talk -#define VOICECHAT_WHOISLEADER "whoisleader" // who is the team leader -#define VOICECHAT_WANTONDEFENSE "wantondefense" // I want to be on defense -#define VOICECHAT_WANTONOFFENSE "wantonoffense" // I want to be on offense +#define VOICECHAT_GETFLAG "getflag" // command someone to get the flag +#define VOICECHAT_OFFENSE "offense" // command someone to go on offense +#define VOICECHAT_DEFEND "defend" // command someone to go on defense +#define VOICECHAT_DEFENDFLAG "defendflag" // command someone to defend the flag +#define VOICECHAT_PATROL "patrol" // command someone to go on patrol (roam) +#define VOICECHAT_CAMP "camp" // command someone to camp (we don't have sounds for this one) +#define VOICECHAT_FOLLOWME "followme" // command someone to follow you +#define VOICECHAT_RETURNFLAG "returnflag" // command someone to return our flag +#define VOICECHAT_FOLLOWFLAGCARRIER "followflagcarrier" // command someone to follow the flag carrier +#define VOICECHAT_YES "yes" // yes, affirmative, etc. +#define VOICECHAT_NO "no" // no, negative, etc. +#define VOICECHAT_ONGETFLAG "ongetflag" // I'm getting the flag +#define VOICECHAT_ONOFFENSE "onoffense" // I'm on offense +#define VOICECHAT_ONDEFENSE "ondefense" // I'm on defense +#define VOICECHAT_ONPATROL "onpatrol" // I'm on patrol (roaming) +#define VOICECHAT_ONCAMPING "oncamp" // I'm camping somewhere +#define VOICECHAT_ONFOLLOW "onfollow" // I'm following +#define VOICECHAT_ONFOLLOWCARRIER "onfollowcarrier" // I'm following the flag carrier +#define VOICECHAT_ONRETURNFLAG "onreturnflag" // I'm returning our flag +#define VOICECHAT_INPOSITION "inposition" // I'm in position +#define VOICECHAT_IHAVEFLAG "ihaveflag" // I have the flag +#define VOICECHAT_BASEATTACK "baseattack" // the base is under attack +#define VOICECHAT_ENEMYHASFLAG "enemyhasflag" // the enemy has our flag (CTF) +#define VOICECHAT_STARTLEADER "startleader" // I'm the leader +#define VOICECHAT_STOPLEADER "stopleader" // I resign leadership +#define VOICECHAT_TRASH "trash" // lots of trash talk +#define VOICECHAT_WHOISLEADER "whoisleader" // who is the team leader +#define VOICECHAT_WANTONDEFENSE "wantondefense" // I want to be on defense +#define VOICECHAT_WANTONOFFENSE "wantonoffense" // I want to be on offense |