summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2007-10-02 21:29:25 +0000
committerTim Angus <tim@ngus.net>2007-10-02 21:29:25 +0000
commitdd0dd03f6f94a15b8764973e4c893526d8cfd722 (patch)
tree4a3989e08a16d58e6b4f9fda7380e20ba05b8a28 /src/cgame
parente6513f95705560250f00f1ccc0707e01e318192f (diff)
* Merge of ioq3-r1189
+ Fix bug that prevented key up events getting to cgame/ui when not in game + Use Key_[GS]etCatcher everywhere to set keycatcher + Clear all key states when the catcher changes * Slim down client userinfo somewhat * Remove some redundant client autocomplete commands * Actually make use of "menuStack" in the UI module + No longer close all menus when exiting one, instead reverting to the next one on the stack + Cleanup the menu activation functions a little * Truncate text in list columns if it exceeds the column width * Remove maxChars field from columns member of ITEM_TYPE_LISTBOX * Revert r992 due to more general and less buggy/hacky fix from ioq3
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_consolecmds.c8
-rw-r--r--src/cgame/cg_draw.c2
-rw-r--r--src/cgame/cg_local.h15
-rw-r--r--src/cgame/cg_main.c12
-rw-r--r--src/cgame/cg_players.c74
-rw-r--r--src/cgame/cg_tutorial.c1
6 files changed, 5 insertions, 107 deletions
diff --git a/src/cgame/cg_consolecmds.c b/src/cgame/cg_consolecmds.c
index 3dc7ef4d..65177875 100644
--- a/src/cgame/cg_consolecmds.c
+++ b/src/cgame/cg_consolecmds.c
@@ -282,13 +282,6 @@ void CG_InitConsoleCommands( void )
trap_AddCommand( "say" );
trap_AddCommand( "say_team" );
trap_AddCommand( "tell" );
- trap_AddCommand( "vsay" );
- trap_AddCommand( "vsay_team" );
- trap_AddCommand( "vtell" );
- trap_AddCommand( "vtaunt" );
- trap_AddCommand( "vosay" );
- trap_AddCommand( "vosay_team" );
- trap_AddCommand( "votell" );
trap_AddCommand( "give" );
trap_AddCommand( "god" );
trap_AddCommand( "notarget" );
@@ -303,7 +296,6 @@ void CG_InitConsoleCommands( void )
trap_AddCommand( "callteamvote" );
trap_AddCommand( "teamvote" );
trap_AddCommand( "stats" );
- trap_AddCommand( "teamtask" );
trap_AddCommand( "class" );
trap_AddCommand( "build" );
trap_AddCommand( "buy" );
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 774b10c4..a5d458cf 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -2802,7 +2802,7 @@ CG_ShowTeamMenus
*/
void CG_ShowTeamMenu( void )
{
- Menus_OpenByName( "teamMenu" );
+ Menus_ActivateByName( "teamMenu" );
}
/*
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 4952eef4..2ed268e7 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -79,10 +79,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define TEAM_OVERLAY_MAXNAME_WIDTH 12
#define TEAM_OVERLAY_MAXLOCATION_WIDTH 16
-#define DEFAULT_MODEL "sarge"
-#define DEFAULT_TEAM_MODEL "sarge"
-#define DEFAULT_TEAM_HEAD "sarge"
-
typedef enum
{
FOOTSTEP_NORMAL,
@@ -708,8 +704,6 @@ typedef struct
char name[ MAX_QPATH ];
pTeam_t team;
- int botSkill; // 0 = not bot, 1-5 = bot
-
vec3_t color1;
vec3_t color2;
@@ -720,10 +714,6 @@ typedef struct
int curWeapon;
int handicap;
- int wins, losses; // in tourney mode
-
- int teamTask; // task in teamplay (offence/defence)
- qboolean teamLeader; // true when this is a team leader
int medkitUsageTime;
int invulnerabilityStartTime;
@@ -736,8 +726,6 @@ typedef struct
// gameplay
char modelName[ MAX_QPATH ];
char skinName[ MAX_QPATH ];
- char headModelName[ MAX_QPATH ];
- char headSkinName[ MAX_QPATH ];
qboolean newAnims; // true if using the new mission pack animations
qboolean fixedlegs; // true if legs yaw is always the same as torso yaw
@@ -1461,7 +1449,6 @@ extern vmCvar_t cg_forceModel;
extern vmCvar_t cg_buildScript;
extern vmCvar_t cg_paused;
extern vmCvar_t cg_blood;
-extern vmCvar_t cg_predictItems;
extern vmCvar_t cg_deferPlayers;
extern vmCvar_t cg_drawFriend;
extern vmCvar_t cg_teamChatsOnly;
@@ -1471,7 +1458,6 @@ extern vmCvar_t cg_scorePlum;
extern vmCvar_t cg_smoothClients;
extern vmCvar_t pmove_fixed;
extern vmCvar_t pmove_msec;
-//extern vmCvar_t cg_pmove_fixed;
extern vmCvar_t cg_cameraOrbit;
extern vmCvar_t cg_cameraOrbitDelay;
extern vmCvar_t cg_timescaleFadeEnd;
@@ -1486,7 +1472,6 @@ extern vmCvar_t cg_oldRail;
extern vmCvar_t cg_oldRocket;
extern vmCvar_t cg_oldPlasma;
extern vmCvar_t cg_trueLightning;
-extern vmCvar_t cg_creepRes;
extern vmCvar_t cg_drawSurfNormal;
extern vmCvar_t cg_drawBBOX;
extern vmCvar_t cg_debugAlloc;
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index 3f20ce20..9bc39014 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -170,7 +170,6 @@ vmCvar_t cg_buildScript;
vmCvar_t cg_forceModel;
vmCvar_t cg_paused;
vmCvar_t cg_blood;
-vmCvar_t cg_predictItems;
vmCvar_t cg_deferPlayers;
vmCvar_t cg_drawTeamOverlay;
vmCvar_t cg_teamOverlayUserinfo;
@@ -182,7 +181,6 @@ vmCvar_t cg_hudFiles;
vmCvar_t cg_scorePlum;
vmCvar_t cg_smoothClients;
vmCvar_t pmove_fixed;
-//vmCvar_t cg_pmove_fixed;
vmCvar_t pmove_msec;
vmCvar_t cg_pmove_msec;
vmCvar_t cg_cameraMode;
@@ -199,7 +197,6 @@ vmCvar_t cg_oldRail;
vmCvar_t cg_oldRocket;
vmCvar_t cg_oldPlasma;
vmCvar_t cg_trueLightning;
-vmCvar_t cg_creepRes;
vmCvar_t cg_drawSurfNormal;
vmCvar_t cg_drawBBOX;
vmCvar_t cg_debugAlloc;
@@ -306,7 +303,6 @@ static cvarTable_t cvarTable[ ] =
{ &cg_thirdPersonAngle, "cg_thirdPersonAngle", "0", CVAR_CHEAT },
{ &cg_thirdPerson, "cg_thirdPerson", "0", CVAR_CHEAT },
{ &cg_forceModel, "cg_forceModel", "0", CVAR_ARCHIVE },
- { &cg_predictItems, "cg_predictItems", "1", CVAR_ARCHIVE },
{ &cg_deferPlayers, "cg_deferPlayers", "1", CVAR_ARCHIVE },
{ &cg_drawTeamOverlay, "cg_drawTeamOverlay", "0", CVAR_ARCHIVE },
{ &cg_teamOverlayUserinfo, "teamoverlay", "0", CVAR_ROM | CVAR_USERINFO },
@@ -315,7 +311,6 @@ static cvarTable_t cvarTable[ ] =
{ &cg_teamChatsOnly, "cg_teamChatsOnly", "0", CVAR_ARCHIVE },
{ &cg_noVoiceChats, "cg_noVoiceChats", "0", CVAR_ARCHIVE },
{ &cg_noVoiceText, "cg_noVoiceText", "0", CVAR_ARCHIVE },
- { &cg_creepRes, "cg_creepRes", "16", CVAR_ARCHIVE },
{ &cg_drawSurfNormal, "cg_drawSurfNormal", "0", CVAR_CHEAT },
{ &cg_drawBBOX, "cg_drawBBOX", "0", CVAR_CHEAT },
{ &cg_debugAlloc, "cg_debugAlloc", "0", 0 },
@@ -366,7 +361,6 @@ static cvarTable_t cvarTable[ ] =
{ &cg_timescaleFadeEnd, "cg_timescaleFadeEnd", "1", 0},
{ &cg_timescaleFadeSpeed, "cg_timescaleFadeSpeed", "0", 0},
{ &cg_timescale, "timescale", "1", 0},
- { &cg_scorePlum, "cg_scorePlums", "1", CVAR_USERINFO | CVAR_ARCHIVE},
{ &cg_smoothClients, "cg_smoothClients", "0", CVAR_USERINFO | CVAR_ARCHIVE},
{ &cg_cameraMode, "com_cameraMode", "0", CVAR_CHEAT},
@@ -380,7 +374,6 @@ static cvarTable_t cvarTable[ ] =
{ &cg_oldRocket, "cg_oldRocket", "1", CVAR_ARCHIVE},
{ &cg_oldPlasma, "cg_oldPlasma", "1", CVAR_ARCHIVE},
{ &cg_trueLightning, "cg_trueLightning", "0.0", CVAR_ARCHIVE}
-// { &cg_pmove_fixed, "cg_pmove_fixed", "0", CVAR_USERINFO | CVAR_ARCHIVE }
};
static int cvarTableSize = sizeof( cvarTable ) / sizeof( cvarTable[0] );
@@ -409,11 +402,6 @@ void CG_RegisterCvars( void )
trap_Cvar_VariableStringBuffer( "sv_running", var, sizeof( var ) );
cgs.localServer = atoi( var );
forceModelModificationCount = cg_forceModel.modificationCount;
-
- trap_Cvar_Register( NULL, "model", DEFAULT_MODEL, CVAR_USERINFO | CVAR_ARCHIVE );
- trap_Cvar_Register( NULL, "headmodel", DEFAULT_MODEL, CVAR_USERINFO | CVAR_ARCHIVE );
- trap_Cvar_Register( NULL, "team_model", DEFAULT_TEAM_MODEL, CVAR_USERINFO | CVAR_ARCHIVE );
- trap_Cvar_Register( NULL, "team_headmodel", DEFAULT_TEAM_HEAD, CVAR_USERINFO | CVAR_ARCHIVE );
}
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index f0800fa5..ad517800 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -484,15 +484,6 @@ static qboolean CG_RegisterClientModelname( clientInfo_t *ci, const char *modelN
return qfalse;
}
- //FIXME: skins do not load without icon present. do we want icons anyway?
-/* Com_sprintf( filename, sizeof( filename ), "models/players/%s/icon_%s.tga", modelName, skinName );
- ci->modelIcon = trap_R_RegisterShaderNoMip( filename );
- if( !ci->modelIcon )
- {
- Com_Printf( "Failed to load icon file: %s\n", filename );
- return qfalse;
- }*/
-
return qtrue;
}
@@ -535,24 +526,16 @@ Load it now, taking the disk hits
*/
static void CG_LoadClientInfo( clientInfo_t *ci )
{
- const char *dir, *fallback;
+ const char *dir;
int i;
const char *s;
int clientNum;
if( !CG_RegisterClientModelname( ci, ci->modelName, ci->skinName ) )
- {
- if( cg_buildScript.integer )
- CG_Error( "CG_RegisterClientModelname( %s, %s ) failed", ci->modelName, ci->skinName );
-
- // fall back
- if( !CG_RegisterClientModelname( ci, DEFAULT_MODEL, "default" ) )
- CG_Error( "DEFAULT_MODEL (%s) failed to register", DEFAULT_MODEL );
- }
+ CG_Error( "CG_RegisterClientModelname( %s, %s ) failed", ci->modelName, ci->skinName );
// sounds
dir = ci->modelName;
- fallback = DEFAULT_MODEL;
for( i = 0; i < MAX_CUSTOM_SOUNDS; i++ )
{
@@ -578,15 +561,11 @@ static void CG_LoadClientInfo( clientInfo_t *ci )
s = cg_customSoundNames[ 0 ]; //death1
ci->sounds[ i ] = trap_S_RegisterSound( va( "sound/player/%s/%s", dir, s + 1 ), qfalse );
- if( !ci->sounds[ i ] )
- ci->sounds[ i ] = trap_S_RegisterSound( va( "sound/player/%s/%s", fallback, s + 1 ), qfalse );
}
}
else
{
ci->sounds[ i ] = trap_S_RegisterSound( va( "sound/player/%s/%s", dir, s + 1 ), qfalse );
- if( !ci->sounds[ i ] )
- ci->sounds[ i ] = trap_S_RegisterSound( va( "sound/player/%s/%s", fallback, s + 1 ), qfalse );
}
}
@@ -728,19 +707,12 @@ void CG_PrecacheClientInfo( pClass_t class, char *model, char *skin )
// model
Q_strncpyz( newInfo.modelName, model, sizeof( newInfo.modelName ) );
- Q_strncpyz( newInfo.headModelName, model, sizeof( newInfo.headModelName ) );
- // modelName didn not include a skin name
+ // modelName did not include a skin name
if( !skin )
- {
Q_strncpyz( newInfo.skinName, "default", sizeof( newInfo.skinName ) );
- Q_strncpyz( newInfo.headSkinName, "default", sizeof( newInfo.headSkinName ) );
- }
else
- {
Q_strncpyz( newInfo.skinName, skin, sizeof( newInfo.skinName ) );
- Q_strncpyz( newInfo.headSkinName, skin, sizeof( newInfo.headSkinName ) );
- }
newInfo.infoValid = qtrue;
@@ -786,34 +758,14 @@ void CG_NewClientInfo( int clientNum )
v = Info_ValueForKey( configstring, "c2" );
CG_ColorFromString( v, newInfo.color2 );
- // bot skill
- v = Info_ValueForKey( configstring, "skill" );
- newInfo.botSkill = atoi( v );
-
// handicap
v = Info_ValueForKey( configstring, "hc" );
newInfo.handicap = atoi( v );
- // wins
- v = Info_ValueForKey( configstring, "w" );
- newInfo.wins = atoi( v );
-
- // losses
- v = Info_ValueForKey( configstring, "l" );
- newInfo.losses = atoi( v );
-
// team
v = Info_ValueForKey( configstring, "t" );
newInfo.team = atoi( v );
- // team task
- v = Info_ValueForKey( configstring, "tt" );
- newInfo.teamTask = atoi( v );
-
- // team leader
- v = Info_ValueForKey( configstring, "tl" );
- newInfo.teamLeader = atoi( v );
-
// model
v = Info_ValueForKey( configstring, "model" );
Q_strncpyz( newInfo.modelName, v, sizeof( newInfo.modelName ) );
@@ -832,26 +784,6 @@ void CG_NewClientInfo( int clientNum )
*slash = 0;
}
- //CG_Printf( "NCI: %s\n", v );
-
- // head model
- v = Info_ValueForKey( configstring, "hmodel" );
- Q_strncpyz( newInfo.headModelName, v, sizeof( newInfo.headModelName ) );
-
- slash = strchr( newInfo.headModelName, '/' );
-
- if( !slash )
- {
- // modelName didn not include a skin name
- Q_strncpyz( newInfo.headSkinName, "default", sizeof( newInfo.headSkinName ) );
- }
- else
- {
- Q_strncpyz( newInfo.headSkinName, slash + 1, sizeof( newInfo.headSkinName ) );
- // truncate modelName
- *slash = 0;
- }
-
// replace whatever was there with the new one
newInfo.infoValid = qtrue;
*ci = newInfo;
diff --git a/src/cgame/cg_tutorial.c b/src/cgame/cg_tutorial.c
index 9997abcd..21242a75 100644
--- a/src/cgame/cg_tutorial.c
+++ b/src/cgame/cg_tutorial.c
@@ -646,6 +646,7 @@ const char *CG_TutorialText( void )
break;
case PCL_HUMAN:
+ case PCL_HUMAN_BSUIT:
CG_HumanText( text, ps );
break;