summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cgame/cg_consolecmds.c9
-rw-r--r--src/cgame/cg_event.c115
-rw-r--r--src/cgame/cg_local.h9
-rw-r--r--src/cgame/cg_main.c9
-rw-r--r--src/game/bg_public.h2
-rw-r--r--src/game/g_buildable.c6
-rw-r--r--src/game/g_cmds.c18
7 files changed, 67 insertions, 101 deletions
diff --git a/src/cgame/cg_consolecmds.c b/src/cgame/cg_consolecmds.c
index 4e7bfd15..c36a57b8 100644
--- a/src/cgame/cg_consolecmds.c
+++ b/src/cgame/cg_consolecmds.c
@@ -244,6 +244,15 @@ static void CG_ClientMenu( const char *menuname )
trap_SendConsoleCommand( "menu mcusell\n" );
trap_SendConsoleCommand( "undefmenu mcusell\n" );
}
+ else if( !Q_stricmp( menuname, "hbankstat" ) )
+ {
+ //FIXME: implement this
+ strcpy( menuDef, "5,5|Statement|1,1,1,1|0.000,0.412,0.702,1|1,1,1,1|2|32|You have something in this bank|OK,!" );
+
+ trap_SendConsoleCommand( va( "defmenu bankstat \"%s\"\n", menuDef ) );
+ trap_SendConsoleCommand( "menu bankstat\n" );
+ trap_SendConsoleCommand( "undefmenu bankstat\n" );
+ }
else
trap_SendConsoleCommand( va( "%s not defined", menuname ) );
}
diff --git a/src/cgame/cg_event.c b/src/cgame/cg_event.c
index 289205df..f3df5871 100644
--- a/src/cgame/cg_event.c
+++ b/src/cgame/cg_event.c
@@ -428,101 +428,32 @@ void CG_Menu( int eventParm )
switch( eventParm )
{
- case MN_TEAM:
- trap_SendConsoleCommand( "menu teammenu\n" );
- break;
-
- case MN_D_CLASS:
- trap_SendConsoleCommand( "menu dclassmenu\n" );
- break;
-
- case MN_H_SPAWN:
- trap_SendConsoleCommand( "menu hsitemmenu\n" );
- break;
-
- case MN_D_BUILD:
- trap_SendConsoleCommand( "menu dbuildmenu\n" );
- break;
-
- case MN_H_BUILD:
- trap_SendConsoleCommand( "menu hbuildmenu\n" );
- break;
-
- case MN_H_MCU:
- trap_SendConsoleCommand( "menu hmcumenu\n" );
- break;
-
- case MN_H_NOROOM:
- trap_SendConsoleCommand( "menu hnoroom\n" );
- break;
-
- case MN_H_NOPOWER:
- trap_SendConsoleCommand( "menu hnopower\n" );
- break;
-
- case MN_D_NOROOM:
- trap_SendConsoleCommand( "menu dnoroom\n" );
- break;
-
- case MN_D_NOCREEP:
- trap_SendConsoleCommand( "menu dnocreep\n" );
- break;
-
- case MN_D_NOHVMND:
- trap_SendConsoleCommand( "menu dnohvmnd\n" );
- break;
-
- case MN_D_HIVEMIND:
- trap_SendConsoleCommand( "menu dhivemind\n" );
- break;
-
- case MN_D_NOASSERT:
- trap_SendConsoleCommand( "menu dnoassert\n" );
- break;
-
- case MN_D_SPWNWARN:
- trap_SendConsoleCommand( "menu dspwnwarn\n" );
- break;
-
- case MN_H_REACTOR:
- trap_SendConsoleCommand( "menu hreactor\n" );
- break;
-
- case MN_H_MCUPOWER:
- trap_SendConsoleCommand( "menu hmcupower\n" );
- break;
-
- 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_H_NOSLOTS:
- trap_SendConsoleCommand( "menu hnoslots\n" );
- break;
-
- case MN_H_NOFUNDS:
- trap_SendConsoleCommand( "menu hnofunds\n" );
- break;
-
- case MN_H_ITEMHELD:
- trap_SendConsoleCommand( "menu hitemheld\n" );
- break;
-
- case MN_D_INFEST:
- trap_SendConsoleCommand( "menu dinfest\n" );
- break;
+ case MN_TEAM: trap_SendConsoleCommand( "menu teammenu\n" ); break;
+ case MN_D_CLASS: trap_SendConsoleCommand( "menu dclassmenu\n" ); break;
+ case MN_H_SPAWN: trap_SendConsoleCommand( "menu hsitemmenu\n" ); break;
+ case MN_D_BUILD: trap_SendConsoleCommand( "menu dbuildmenu\n" ); break;
+ case MN_H_BUILD: trap_SendConsoleCommand( "menu hbuildmenu\n" ); break;
+ case MN_H_MCU: trap_SendConsoleCommand( "menu hmcumenu\n" ); break;
+ case MN_H_BANK: trap_SendConsoleCommand( "menu hbankmenu\n" ); break;
+ case MN_H_NOROOM: trap_SendConsoleCommand( "menu hnoroom\n" ); break;
+ case MN_H_NOPOWER: trap_SendConsoleCommand( "menu hnopower\n" ); break;
+ case MN_D_NOROOM: trap_SendConsoleCommand( "menu dnoroom\n" ); break;
+ case MN_D_NOCREEP: trap_SendConsoleCommand( "menu dnocreep\n" ); break;
+ case MN_D_NOHVMND: trap_SendConsoleCommand( "menu dnohvmnd\n" ); break;
+ case MN_D_HIVEMIND: trap_SendConsoleCommand( "menu dhivemind\n" ); break;
+ case MN_D_NOASSERT: trap_SendConsoleCommand( "menu dnoassert\n" ); break;
+ case MN_D_SPWNWARN: trap_SendConsoleCommand( "menu dspwnwarn\n" ); break;
+ case MN_H_REACTOR: trap_SendConsoleCommand( "menu hreactor\n" ); break;
+ 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_H_NOSLOTS: trap_SendConsoleCommand( "menu hnoslots\n" ); break;
+ case MN_H_NOFUNDS: trap_SendConsoleCommand( "menu hnofunds\n" ); break;
+ case MN_H_ITEMHELD: trap_SendConsoleCommand( "menu hitemheld\n" ); break;
+ case MN_D_INFEST: trap_SendConsoleCommand( "menu dinfest\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 f87d1b90..4f218d9a 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -736,6 +736,15 @@ typedef struct {
qhandle_t gibSkull;
qhandle_t gibBrain;
+ qhandle_t metalGib1;
+ qhandle_t metalGib2;
+ qhandle_t metalGib3;
+ qhandle_t metalGib4;
+ qhandle_t metalGib5;
+ qhandle_t metalGib6;
+ qhandle_t metalGib7;
+ qhandle_t metalGib8;
+
qhandle_t smoke2;
qhandle_t machinegunBrassModel;
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index 35a6022b..6e5ab71b 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -838,6 +838,15 @@ static void CG_RegisterGraphics( void ) {
cgs.media.gibSkull = trap_R_RegisterModel( "models/gibs/skull.md3" );
cgs.media.gibBrain = trap_R_RegisterModel( "models/gibs/brain.md3" );
+ cgs.media.metalGib1 = trap_R_RegisterModel( "models/fx/metal_gibs/m_gib1.md3" );
+ cgs.media.metalGib2 = trap_R_RegisterModel( "models/fx/metal_gibs/m_gib2.md3" );
+ cgs.media.metalGib3 = trap_R_RegisterModel( "models/fx/metal_gibs/m_gib3.md3" );
+ cgs.media.metalGib4 = trap_R_RegisterModel( "models/fx/metal_gibs/m_gib4.md3" );
+ cgs.media.metalGib5 = trap_R_RegisterModel( "models/fx/metal_gibs/m_gib5.md3" );
+ cgs.media.metalGib6 = trap_R_RegisterModel( "models/fx/metal_gibs/m_gib6.md3" );
+ cgs.media.metalGib7 = trap_R_RegisterModel( "models/fx/metal_gibs/m_gib7.md3" );
+ cgs.media.metalGib8 = trap_R_RegisterModel( "models/fx/metal_gibs/m_gib8.md3" );
+
cgs.media.smoke2 = trap_R_RegisterModel( "models/weapons2/shells/s_shell.md3" );
cgs.media.balloonShader = trap_R_RegisterShader( "sprites/balloon3" );
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index 845993d5..7af74969 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -565,13 +565,13 @@ typedef enum
MN_H_SPAWN,
MN_H_BUILD,
MN_H_MCU,
+ MN_H_BANK,
MN_H_NOROOM,
MN_H_NOPOWER,
MN_H_REACTOR,
MN_H_REPEATER,
MN_H_RPLWARN,
MN_H_RPTWARN,
- MN_H_MCUPOWER,
MN_H_NOSLOTS,
MN_H_NOFUNDS,
MN_H_ITEMHELD
diff --git a/src/game/g_buildable.c b/src/game/g_buildable.c
index 808666b5..8f9fbcab 100644
--- a/src/game/g_buildable.c
+++ b/src/game/g_buildable.c
@@ -751,7 +751,7 @@ void HMCU_Activate( gentity_t *self, gentity_t *other, gentity_t *activator )
if( self->powered )
G_AddPredictableEvent( activator, EV_MENU, MN_H_MCU );
else
- G_AddPredictableEvent( activator, EV_MENU, MN_H_MCUPOWER );
+ G_AddPredictableEvent( activator, EV_MENU, MN_H_NOPOWER );
}
/*
@@ -790,9 +790,9 @@ void HBank_Activate( gentity_t *self, gentity_t *other, gentity_t *activator )
//if this is powered then call the mcu menu
if( self->powered )
- G_AddPredictableEvent( activator, EV_MENU, MN_H_MCU );
+ G_AddPredictableEvent( activator, EV_MENU, MN_H_BANK );
else
- G_AddPredictableEvent( activator, EV_MENU, MN_H_MCUPOWER );
+ G_AddPredictableEvent( activator, EV_MENU, MN_H_NOPOWER );
}
/*
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 1d977b86..f2f7ff4d 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -1992,7 +1992,6 @@ void Cmd_Deposit_f( gentity_t *ent )
qboolean nearBank = qfalse;
trap_Argv( 1, s, sizeof( s ) );
- amount = atoi( s );
//droids don't sell stuff
if( ent->client->pers.pteam != PTE_HUMANS )
@@ -2011,6 +2010,11 @@ void Cmd_Deposit_f( gentity_t *ent )
}
}
+ if( !Q_stricmp( s, "all" ) )
+ amount = ent->client->ps.stats[ STAT_CREDIT ];
+ else
+ amount = atoi( s );
+
//no Bank nearby
if( !nearBank )
{
@@ -2024,7 +2028,7 @@ void Cmd_Deposit_f( gentity_t *ent )
bankEntity->credits[ ent->client->ps.clientNum ] += amount;
}
else
- trap_SendServerCommand( ent-g_entities, va("print \"You do not have that amount\n\"" ) );
+ G_AddPredictableEvent( ent, EV_MENU, MN_H_NOFUNDS );
}
@@ -2043,8 +2047,7 @@ void Cmd_Withdraw_f( gentity_t *ent )
qboolean nearBank = qfalse;
trap_Argv( 1, s, sizeof( s ) );
- amount = atoi( s );
-
+
//droids don't sell stuff
if( ent->client->pers.pteam != PTE_HUMANS )
return;
@@ -2062,6 +2065,11 @@ void Cmd_Withdraw_f( gentity_t *ent )
}
}
+ if( !Q_stricmp( s, "all" ) )
+ amount = bankEntity->credits[ ent->client->ps.clientNum ];
+ else
+ amount = atoi( s );
+
//no Bank nearby
if( !nearBank )
{
@@ -2075,7 +2083,7 @@ void Cmd_Withdraw_f( gentity_t *ent )
bankEntity->credits[ ent->client->ps.clientNum ] -= amount;
}
else
- trap_SendServerCommand( ent-g_entities, va("print \"You do not have that amount\n\"" ) );
+ G_AddPredictableEvent( ent, EV_MENU, MN_H_NOFUNDS );
}