From f5392aaef785aeaf7eb56b448c6deeb42fea00e2 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sat, 31 Mar 2001 22:04:08 +0000 Subject: Added to and reorganised menus --- src/cgame/cg_event.c | 36 ++++++++++++++++++++++++------------ src/game/bg_public.h | 27 +++++++++++++++------------ src/game/g_active.c | 4 ++-- src/game/g_buildable.c | 13 +++++++++---- src/game/g_client.c | 6 +++--- src/game/g_cmds.c | 24 +++++++++++++++++++----- src/game/g_local.h | 3 +++ src/game/g_weapon.c | 4 ++-- 8 files changed, 77 insertions(+), 40 deletions(-) diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index 1826e1ba..851022b8 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -430,51 +430,63 @@ void CG_Menu( int eventParm ) trap_SendConsoleCommand( "menu teammenu\n" ); break; - case MN_DROID: + case MN_D_CLASS: trap_SendConsoleCommand( "menu dclassmenu\n" ); break; - case MN_HUMAN: + case MN_H_SPAWN: trap_SendConsoleCommand( "menu hsitemmenu\n" ); break; - case MN_ABUILD: + case MN_D_BUILD: trap_SendConsoleCommand( "menu dbuildmenu\n" ); break; - case MN_HBUILD: + case MN_H_BUILD: trap_SendConsoleCommand( "menu hbuildmenu\n" ); break; - case MN_MCU: + case MN_H_MCU: trap_SendConsoleCommand( "menu hmcumenu\n" ); break; - case MN_HNOROOM: + case MN_H_NOROOM: trap_SendConsoleCommand( "menu hnoroom\n" ); break; - case MN_HNOPOWER: + case MN_H_NOPOWER: trap_SendConsoleCommand( "menu hnopower\n" ); break; - case MN_DNOROOM: + case MN_D_NOROOM: trap_SendConsoleCommand( "menu dnoroom\n" ); break; - case MN_NOCREEP: + case MN_D_NOCREEP: trap_SendConsoleCommand( "menu dnocreep\n" ); break; - case MN_REACTOR: + case MN_H_REACTOR: trap_SendConsoleCommand( "menu hreactor\n" ); break; - case MN_MCUPOWER: + case MN_H_MCUPOWER: trap_SendConsoleCommand( "menu hmcupower\n" ); break; - case MN_INFEST: + case MN_H_REPEATER: + trap_SendConsoleCommand( "menu hrepeater\n" ); + break; + + case MN_H_RPLWARN: + trap_SendConsoleCommand( "menu hrplwarn\n" ); + break; + + case MN_H_RPTWARN: + trap_SendConsoleCommand( "menu hrptwarn\n" ); + break; + + case MN_D_INFEST: 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++ ) { diff --git a/src/game/bg_public.h b/src/game/bg_public.h index 70652f23..ea60c52f 100644 --- a/src/game/bg_public.h +++ b/src/game/bg_public.h @@ -516,18 +516,21 @@ typedef enum { typedef enum { MN_TEAM, - MN_DROID, - MN_HUMAN, - MN_ABUILD, - MN_HBUILD, - MN_MCU, - MN_INFEST, - MN_DNOROOM, - MN_HNOROOM, - MN_HNOPOWER, - MN_NOCREEP, - MN_REACTOR, - MN_MCUPOWER + MN_D_CLASS, + MN_D_BUILD, + MN_D_INFEST, + MN_D_NOROOM, + MN_D_NOCREEP, + MN_H_SPAWN, + MN_H_BUILD, + MN_H_MCU, + MN_H_NOROOM, + MN_H_NOPOWER, + MN_H_REACTOR, + MN_H_REPEATER, + MN_H_RPLWARN, + MN_H_RPTWARN, + MN_H_MCUPOWER } dynMenu_t; // animations diff --git a/src/game/g_active.c b/src/game/g_active.c index 514224c9..18da18d7 100644 --- a/src/game/g_active.c +++ b/src/game/g_active.c @@ -365,11 +365,11 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd ) { } else if( client->pers.pteam == PTE_DROIDS ) { - G_AddPredictableEvent( ent, EV_MENU, MN_DROID ); + G_AddPredictableEvent( ent, EV_MENU, MN_D_CLASS ); } else if( client->pers.pteam == PTE_HUMANS ) { - G_AddPredictableEvent( ent, EV_MENU, MN_HUMAN ); + G_AddPredictableEvent( ent, EV_MENU, MN_H_SPAWN ); } } diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c index 5c3cab37..4ca06519 100644 --- a/src/game/g_buildable.c +++ b/src/game/g_buildable.c @@ -311,9 +311,9 @@ void HMCU_Activate( gentity_t *self, gentity_t *other, gentity_t *activator ) if( activator->client->ps.stats[ STAT_PTEAM ] != PTE_HUMANS ) return; if( self->powered ) - G_AddPredictableEvent( activator, EV_MENU, MN_MCU ); + G_AddPredictableEvent( activator, EV_MENU, MN_H_MCU ); else - G_AddPredictableEvent( activator, EV_MENU, MN_MCUPOWER ); + G_AddPredictableEvent( activator, EV_MENU, MN_H_MCUPOWER ); } /* @@ -650,8 +650,13 @@ itemBuildError_t itemFits( gentity_t *ent, buildable_t buildable, int distance ) ) ) { - if( buildable != BA_H_SPAWN && buildable != BA_H_REACTOR && buildable != BA_H_REPEATER ) - reason = IBE_NOPOWER; + if( buildable != BA_H_REACTOR ) + reason = IBE_REPEATER; + + if( buildable == BA_H_SPAWN ) + reason = IBE_RPLWARN; + else if( buildable == BA_H_REPEATER ) + reason = IBE_RPTWARN; } if( BG_FindReactorTestForBuildable( buildable ) ) diff --git a/src/game/g_client.c b/src/game/g_client.c index cb41b37a..15a42ba5 100644 --- a/src/game/g_client.c +++ b/src/game/g_client.c @@ -542,7 +542,7 @@ void InfestBody( gentity_t *self, gentity_t *other, gentity_t *activator ) { if( activator->client->ps.stats[ STAT_PTEAM ] != PTE_DROIDS ) return; - G_AddPredictableEvent( activator, EV_MENU, MN_INFEST ); + G_AddPredictableEvent( activator, EV_MENU, MN_D_INFEST ); } /* @@ -1275,9 +1275,9 @@ void ClientSpawn( gentity_t *ent, gentity_t *spawn ) { if( client->sess.sessionTeam == TEAM_SPECTATOR ) { if( teamLocal == PTE_DROIDS ) - G_AddPredictableEvent( ent, EV_MENU, MN_DROID ); + G_AddPredictableEvent( ent, EV_MENU, MN_D_CLASS ); else if( teamLocal == PTE_HUMANS ) - G_AddPredictableEvent( ent, EV_MENU, MN_HUMAN ); + G_AddPredictableEvent( ent, EV_MENU, MN_H_SPAWN ); } // increment the spawncount so the client will detect the respawn diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 228a0af1..cf7af411 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1925,11 +1925,11 @@ void Cmd_Build_f( gentity_t *ent ) break; case IBE_NOCREEP: - G_AddPredictableEvent( ent, EV_MENU, MN_NOCREEP ); + G_AddPredictableEvent( ent, EV_MENU, MN_D_NOCREEP ); break; case IBE_NOROOM: - G_AddPredictableEvent( ent, EV_MENU, MN_DNOROOM ); + G_AddPredictableEvent( ent, EV_MENU, MN_D_NOROOM ); break; } } @@ -1951,15 +1951,29 @@ void Cmd_Build_f( gentity_t *ent ) break; case IBE_REACTOR: - G_AddPredictableEvent( ent, EV_MENU, MN_REACTOR ); + G_AddPredictableEvent( ent, EV_MENU, MN_H_REACTOR ); + break; + + case IBE_REPEATER: + G_AddPredictableEvent( ent, EV_MENU, MN_H_REPEATER ); break; case IBE_NOROOM: - G_AddPredictableEvent( ent, EV_MENU, MN_HNOROOM ); + G_AddPredictableEvent( ent, EV_MENU, MN_H_NOROOM ); break; case IBE_NOPOWER: - G_AddPredictableEvent( ent, EV_MENU, MN_HNOPOWER ); + G_AddPredictableEvent( ent, EV_MENU, MN_H_NOPOWER ); + break; + + case IBE_RPLWARN: + G_AddPredictableEvent( ent, EV_MENU, MN_H_RPLWARN ); + Build_Item( ent, buildable, 80 ); + break; + + case IBE_RPTWARN: + G_AddPredictableEvent( ent, EV_MENU, MN_H_RPTWARN ); + Build_Item( ent, buildable, 80 ); break; } } diff --git a/src/game/g_local.h b/src/game/g_local.h index 2236e0d8..b6c0aeb1 100644 --- a/src/game/g_local.h +++ b/src/game/g_local.h @@ -483,6 +483,9 @@ typedef enum IBE_NOROOM, IBE_NOCREEP, IBE_REACTOR, + IBE_REPEATER, + IBE_RPLWARN, + IBE_RPTWARN, IBE_NOPOWER, IBE_MAXERRORS diff --git a/src/game/g_weapon.c b/src/game/g_weapon.c index f378212a..fb2a85ee 100644 --- a/src/game/g_weapon.c +++ b/src/game/g_weapon.c @@ -593,7 +593,7 @@ Weapon_Abuild_Fire */ void Weapon_Abuild_Fire( gentity_t *ent ) { - G_AddPredictableEvent( ent, EV_MENU, MN_ABUILD ); + G_AddPredictableEvent( ent, EV_MENU, MN_D_BUILD ); } /* @@ -603,7 +603,7 @@ Weapon_Hbuild_Fire */ void Weapon_Hbuild_Fire( gentity_t *ent ) { - G_AddPredictableEvent( ent, EV_MENU, MN_HBUILD ); + G_AddPredictableEvent( ent, EV_MENU, MN_H_BUILD ); } ///////build weapons -- cgit