diff options
author | Tim Angus <tim@ngus.net> | 2003-03-22 02:25:18 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2003-03-22 02:25:18 +0000 |
commit | 62a23c3088d9766003a2df61c374b8e7af5a7fdb (patch) | |
tree | 958e4884a28a9595dc9d17e880dcbe762258ea20 /src | |
parent | b75d0e2a7e2d29e8575dea17c2c45fc8f3dd5b50 (diff) |
* Code support for the new armoury menu
Diffstat (limited to 'src')
-rw-r--r-- | src/cgame/cg_event.c | 16 | ||||
-rw-r--r-- | src/game/g_cmds.c | 8 | ||||
-rw-r--r-- | src/ui/ui_main.c | 6 |
3 files changed, 19 insertions, 11 deletions
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c index abf703e3..1d30e416 100644 --- a/src/cgame/cg_event.c +++ b/src/cgame/cg_event.c @@ -336,14 +336,14 @@ void CG_Menu( int eventParm ) switch( eventParm ) { - case MN_TEAM: trap_SendConsoleCommand( "menu tremulous_teamselect\n" ); break; - case MN_A_CLASS: trap_SendConsoleCommand( "menu tremulous_alienclass\n" ); break; - case MN_H_SPAWN: trap_SendConsoleCommand( "menu tremulous_humanitem\n" ); break; - case MN_A_BUILD: trap_SendConsoleCommand( "menu tremulous_alienbuild\n" ); break; - case MN_H_BUILD: trap_SendConsoleCommand( "menu tremulous_humanbuild\n" ); break; - case MN_H_ARMOURY: trap_SendConsoleCommand( "menu tremulous_humanarmoury\n" ); break; - case MN_H_BANK: trap_SendConsoleCommand( "menu tremulous_humanbank\n" ); break; - case MN_A_OBANK: trap_SendConsoleCommand( "menu tremulous_alienbank\n" ); break; + case MN_TEAM: trap_SendConsoleCommand( "menu tremulous_teamselect\n" ); break; + case MN_A_CLASS: trap_SendConsoleCommand( "menu tremulous_alienclass\n" ); break; + case MN_H_SPAWN: trap_SendConsoleCommand( "menu tremulous_humanitem\n" ); break; + case MN_A_BUILD: trap_SendConsoleCommand( "menu tremulous_alienbuild\n" ); break; + case MN_H_BUILD: trap_SendConsoleCommand( "menu tremulous_humanbuild\n" ); break; + case MN_H_ARMOURY: trap_SendConsoleCommand( "menu tremulous_humanarmoury\n" ); break; + case MN_H_BANK: trap_SendConsoleCommand( "menu tremulous_humanbank\n" ); break; + case MN_A_OBANK: trap_SendConsoleCommand( "menu tremulous_alienbank\n" ); break; case MN_H_NOROOM: trap_Cvar_Set( "ui_dialog", "There is no room to build here. Move until the buildable turns " diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 47163acc..c197bdaa 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1434,7 +1434,10 @@ void Cmd_Buy_f( gentity_t *ent ) //if the buyer previously had no items at all, force a new selection if( numItems == 0 ) - G_AddEvent( ent, EV_NEXT_WEAPON, 0 ); + G_AddPredictableEvent( ent, EV_NEXT_WEAPON, 0 ); + + //retrigger the armoury menu + G_AddPredictableEvent( ent, EV_MENU, MN_H_ARMOURY ); //update ClientInfo ClientUserinfoChanged( ent->client->ps.clientNum ); @@ -1518,6 +1521,9 @@ void Cmd_Sell_f( gentity_t *ent ) else trap_SendServerCommand( ent-g_entities, va( "print \"Unknown item\n\"" ) ); + //retrigger the armoury menu + G_AddPredictableEvent( ent, EV_MENU, MN_H_ARMOURY ); + //update ClientInfo ClientUserinfoChanged( ent->client->ps.clientNum ); } diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index a48b78bc..2bfe2b18 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -3415,7 +3415,8 @@ static void UI_LoadTremHumanArmouryBuys( ) if( BG_FindTeamForWeapon( i ) == WUT_HUMANS && BG_FindPurchasableForWeapon( i ) && BG_FindStagesForWeapon( i, stage ) && - !( BG_FindSlotsForWeapon( i ) & slots ) ) + !( BG_FindSlotsForWeapon( i ) & slots ) && + !( weapons & ( 1 << i ) ) ) { uiInfo.tremHumanArmouryBuyList[ j ].text = String_Alloc( BG_FindHumanNameForWeapon( i ) ); @@ -3434,7 +3435,8 @@ static void UI_LoadTremHumanArmouryBuys( ) { if( BG_FindTeamForUpgrade( i ) == WUT_HUMANS && BG_FindStagesForUpgrade( i, stage ) && - !( BG_FindSlotsForUpgrade( i ) & slots ) ) + !( BG_FindSlotsForUpgrade( i ) & slots ) && + !( upgrades & ( 1 << i ) ) ) { uiInfo.tremHumanArmouryBuyList[ j ].text = String_Alloc( BG_FindHumanNameForUpgrade( i ) ); |