Fixed the server about menu, made the UI handle illegal models and skins

better.
This commit is contained in:
Richard Allen 2002-07-26 22:28:38 +00:00
parent bec61db61b
commit 14d2c25468
7 changed files with 117 additions and 21 deletions

View file

@ -11,6 +11,11 @@
* Fixed the missing weapon/item menu in the player menu
* Added g_RQ3_version and g_RQ3_showOwnKills to the about server menu
* Fixed missing shader errors in the UI on numerous places.
* Fixed the about server UI menu values
* Made the UI handle illegal models and skins more robustly
* UI model previw is fixed.
* UI model previw and selection now controls DM gametype models, not team models.
* Added a radiosoundset selection dialog to the UI

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.112 2002/07/26 22:28:38 jbravo
// Fixed the server about menu, made the UI handle illegal models and skins
// better.
//
// Revision 1.111 2002/07/26 06:21:43 jbravo
// Fixed the MM settings stuff so it works on remote servers also.
// Removed the MM_NAMES_COLOR since it broke on nicks with color in them.
@ -1734,6 +1738,13 @@ extern vmCvar_t cg_RQ3_forceteamtalk;
extern vmCvar_t cg_RQ3_limchasecam;
extern vmCvar_t cg_RQ3_tgren;
extern vmCvar_t cg_RQ3_friendlyFire;
// JBravo: cvars for the about menu
extern vmCvar_t cg_RQ3_hostname;
extern vmCvar_t cg_RQ3_needpass;
extern vmCvar_t cg_RQ3_capturelimit;
extern vmCvar_t cg_RQ3_dmflags;
extern vmCvar_t cg_RQ3_bot_minplayers;
extern vmCvar_t cg_RQ3_showOwnKills;
//Slicer: matchmode team status cvars
//extern vmCvar_t cg_RQ3_RefID;

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.101 2002/07/26 22:28:38 jbravo
// Fixed the server about menu, made the UI handle illegal models and skins
// better.
//
// Revision 1.100 2002/07/26 06:21:43 jbravo
// Fixed the MM settings stuff so it works on remote servers also.
// Removed the MM_NAMES_COLOR since it broke on nicks with color in them.
@ -485,6 +489,14 @@ vmCvar_t cg_RQ3_forceteamtalk;
vmCvar_t cg_RQ3_limchasecam;
vmCvar_t cg_RQ3_tgren;
vmCvar_t cg_RQ3_friendlyFire;
vmCvar_t cg_RQ3_version;
// JBravo: cvars for the about menu
vmCvar_t cg_RQ3_hostname;
vmCvar_t cg_RQ3_needpass;
vmCvar_t cg_RQ3_capturelimit;
vmCvar_t cg_RQ3_dmflags;
vmCvar_t cg_RQ3_bot_minplayers;
vmCvar_t cg_RQ3_showOwnKills;
typedef struct {
vmCvar_t *vmCvar;
@ -656,15 +668,23 @@ static cvarTable_t cvarTable[] = { // bk001129
//Slicer: Team Status Cvars for MM
{&cg_RQ3_matchmode, "g_RQ3_matchmode", "0", 0},
// JBravo: more MM ingame cvars.
{&cg_RQ3_timelimit, "cg_RQ3_timelimit", "0", CVAR_ROM},
{&cg_RQ3_timelimit, "timelimit", "0", CVAR_ROM},
{&cg_RQ3_roundlimit, "cg_RQ3_roundlimit", "0", CVAR_ROM},
{&cg_RQ3_roundtimelimit, "cg_RQ3_roundtimelimit", "0", CVAR_ROM},
{&cg_RQ3_fraglimit, "cg_RQ3_fraglimit", "0", CVAR_ROM},
{&cg_RQ3_fraglimit, "fraglimit", "0", CVAR_ROM},
{&cg_RQ3_maxplayers, "cg_RQ3_maxplayers", "0", CVAR_ROM},
{&cg_RQ3_forceteamtalk, "cg_RQ3_forceteamtalk", "0", CVAR_ROM},
{&cg_RQ3_limchasecam, "cg_RQ3_limchasecam", "0", CVAR_ROM},
{&cg_RQ3_tgren, "cg_RQ3_tgren", "0", CVAR_ROM},
{&cg_RQ3_friendlyFire, "cg_RQ3_friendlyFire", "0", CVAR_ROM},
{&cg_RQ3_version, "g_RQ3_version", "0", CVAR_ROM},
// JBravo: cvars for the about menu.
{&cg_RQ3_hostname, "sv_hostname", "0", CVAR_ROM},
{&cg_RQ3_needpass, "g_needpass", "0", CVAR_ROM},
{&cg_RQ3_capturelimit, "capturelimit", "0", CVAR_ROM},
{&cg_RQ3_dmflags, "dmflags", "0", CVAR_ROM},
{&cg_RQ3_bot_minplayers, "bot_minplayers", "0", CVAR_ROM},
{&cg_RQ3_showOwnKills, "g_RQ3_showOwnKills", "0", CVAR_ROM},
//{ &cg_RQ3_RefID, "g_RQ3_RefID", "0", 0}
// { &cg_pmove_fixed, "cg_pmove_fixed", "0", CVAR_USERINFO | CVAR_ARCHIVE }

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.109 2002/07/26 22:28:38 jbravo
// Fixed the server about menu, made the UI handle illegal models and skins
// better.
//
// Revision 1.108 2002/07/26 06:21:43 jbravo
// Fixed the MM settings stuff so it works on remote servers also.
// Removed the MM_NAMES_COLOR since it broke on nicks with color in them.
@ -1470,6 +1474,7 @@ void ClientBegin(int clientNum)
gclient_t *client;
int flags, savedPing = 0, i;
int savedPers[MAX_PERSISTANT];
char str[256];
ent = g_entities + clientNum;
client = level.clients + clientNum;
@ -1559,7 +1564,19 @@ void ClientBegin(int clientNum)
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i %s %i", CVARSET, settings2[i],
trap_Cvar_VariableIntegerValue(settings[i])));
}
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i cg_RQ3_capturelimit %i", CVARSET,
trap_Cvar_VariableIntegerValue("capturelimit")));
}
// JBravo: setting cvars for the about menu
trap_Cvar_VariableStringBuffer("sv_hostname", str, sizeof(str));
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i cg_RQ3_hostname %s", CVARSET, str));
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i cg_RQ3_needpass %i", CVARSET, g_needpass.integer));
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i cg_RQ3_dmflags %i", CVARSET, g_dmflags.integer));
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i cg_RQ3_showOwnKills %i", CVARSET, g_RQ3_showOwnKills.integer));
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i cg_RQ3_timelimit %i", CVARSET, g_timelimit.integer));
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i cg_RQ3_fraglimit %i", CVARSET, g_fraglimit.integer));
trap_SendServerCommand(ent - g_entities, va("rq3_cmd %i cg_RQ3_bot_minplayers %i", CVARSET,
trap_Cvar_VariableIntegerValue("bot_minplayers")));
// count current clients and rank for scoreboard
CalculateRanks();

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.105 2002/07/26 22:28:38 jbravo
// Fixed the server about menu, made the UI handle illegal models and skins
// better.
//
// Revision 1.104 2002/07/26 06:46:31 jbravo
// Added a map_restart after successful callvote g_gametype votes.
//
@ -437,7 +441,7 @@ static cvarTable_t gameCvarTable[] = {
// latched vars
{&g_gametype, "g_gametype", "0", CVAR_SERVERINFO | CVAR_USERINFO | CVAR_LATCH, 0, qfalse},
{&g_maxclients, "sv_maxclients", "8", CVAR_SERVERINFO | CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse},
{&g_maxclients, "sv_maxclients", "8", CVAR_SERVERINFO | CVAR_SYSTEMINFO | CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse},
{&g_maxGameClients, "g_maxGameClients", "0", CVAR_SERVERINFO | CVAR_LATCH | CVAR_ARCHIVE, 0, qfalse},
// change anytime vars
@ -485,7 +489,7 @@ static cvarTable_t gameCvarTable[] = {
{&g_podiumDrop, "g_podiumDrop", "70", 0, 0, qfalse},
//Makro - changed default to 0
{&g_allowVote, "g_allowVote", "0", CVAR_ARCHIVE, 0, qfalse},
{&g_allowVote, "g_allowVote", "0", CVAR_ARCHIVE | CVAR_SYSTEMINFO, 0, qfalse},
{&g_listEntity, "g_listEntity", "0", 0, 0, qfalse},
// NiceAss: Taken out of the missionpack
@ -557,7 +561,7 @@ static cvarTable_t gameCvarTable[] = {
{&g_RQ3_NextMapID, "g_RQ3_NextMapID", "-1", CVAR_SYSTEMINFO, 0, qfalse},
{&g_RQ3_NextMap, "g_RQ3_NextMap", "", CVAR_SYSTEMINFO, 0, qfalse},
//Makro - for server browsers
{&g_RQ3_version, "g_RQ3_version", "Beta 2.1", CVAR_SERVERINFO | CVAR_ROM, 0, qfalse}
{&g_RQ3_version, "g_RQ3_version", "Beta 2.2", CVAR_SERVERINFO | CVAR_SYSTEMINFO | CVAR_ROM, 0, qfalse}
};
// bk001129 - made static to avoid aliasing

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.45 2002/07/26 22:28:38 jbravo
// Fixed the server about menu, made the UI handle illegal models and skins
// better.
//
// Revision 1.44 2002/07/26 06:21:43 jbravo
// Fixed the MM settings stuff so it works on remote servers also.
// Removed the MM_NAMES_COLOR since it broke on nicks with color in them.
@ -1600,8 +1604,8 @@ static void UI_DrawPlayerModel(rectDef_t * rect)
} else {
strcpy(team, UI_Cvar_VariableString("ui_teamName"));
strcpy(model, UI_Cvar_VariableString("team_model"));
strcpy(head, UI_Cvar_VariableString("team_headmodel"));
strcpy(model, UI_Cvar_VariableString("model"));
strcpy(head, UI_Cvar_VariableString("headmodel"));
if (q3Model) {
q3Model = qfalse;
updateModel = qtrue;
@ -4682,7 +4686,7 @@ static void UI_BuildServerDisplayList(qboolean force)
if (len == 0) {
//Makro - changing from Team Arena to RQ3 beta2
//strcpy(uiInfo.serverStatus.motd, "Welcome to Team Arena!");
strcpy(uiInfo.serverStatus.motd, " *** Welcome to Reaction Quake 3 beta 2.1 *** ");
strcpy(uiInfo.serverStatus.motd, " *** Welcome to Reaction Quake 3 Beta 2.2 *** ");
len = strlen(uiInfo.serverStatus.motd);
}
if (len != uiInfo.serverStatus.motdLen) {
@ -5435,8 +5439,8 @@ static void UI_FeederSelection(float feederID, int index)
UI_SelectedHead(index, &actual);
index = actual;
if (index >= 0 && index < uiInfo.characterCount) {
trap_Cvar_Set("team_model", va("%s", uiInfo.characterList[index].base));
trap_Cvar_Set("team_headmodel", va("*%s", uiInfo.characterList[index].name));
trap_Cvar_Set("model", va("%s", uiInfo.characterList[index].base));
trap_Cvar_Set("headmodel", va("*%s", uiInfo.characterList[index].name));
updateModel = qtrue;
}
} else if (feederID == FEEDER_Q3HEADS) {

View file

@ -5,6 +5,10 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.6 2002/07/26 22:28:38 jbravo
// Fixed the server about menu, made the UI handle illegal models and skins
// better.
//
// Revision 1.5 2002/06/16 20:06:15 jbravo
// Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap"
//
@ -968,7 +972,12 @@ static qboolean UI_RegisterClientSkin(playerInfo_t * pi, const char *modelName,
}
pi->legsSkin = trap_R_RegisterSkin(filename);
}
// JBravo: adding
if (!pi->legsSkin) {
Com_sprintf(filename, sizeof(filename), "models/players/%s/lower_%s.skin",
modelName, skinName);
pi->legsSkin = trap_R_RegisterSkin(filename);
}
if (teamName && *teamName) {
Com_sprintf(filename, sizeof(filename), "models/players/%s/%s/upper_%s.skin", modelName, teamName,
skinName);
@ -986,13 +995,26 @@ static qboolean UI_RegisterClientSkin(playerInfo_t * pi, const char *modelName,
}
pi->torsoSkin = trap_R_RegisterSkin(filename);
}
// JBravo: adding
if (!pi->torsoSkin) {
Com_sprintf(filename, sizeof(filename), "models/players/%s/upper_%s.skin", modelName, skinName);
pi->torsoSkin = trap_R_RegisterSkin(filename);
}
if (UI_FindClientHeadFile(filename, sizeof(filename), teamName, headModelName, headSkinName, "head", "skin")) {
pi->headSkin = trap_R_RegisterSkin(filename);
}
if (!pi->legsSkin || !pi->torsoSkin || !pi->headSkin) {
return qfalse;
// JBravo: No need for errors if the skin doesnt exsist. Lets drop in a default instead.
Com_sprintf(filename, sizeof(filename), "models/players/grunt/lower_resdog.skin");
pi->legsSkin = trap_R_RegisterSkin(filename);
Com_sprintf(filename, sizeof(filename), "models/players/grunt/upper_resdog.skin");
pi->torsoSkin = trap_R_RegisterSkin(filename);
Com_sprintf(filename, sizeof(filename), "models/players/grunt/head_resdog.skin");
pi->headSkin = trap_R_RegisterSkin(filename);
trap_Cvar_Set("model", "grunt/resdog");
trap_Cvar_Set("headmodel", "grunt/resdog");
}
return qtrue;
@ -1143,7 +1165,6 @@ qboolean UI_RegisterClientModelname(playerInfo_t * pi, const char *modelSkinName
}
Q_strncpyz(modelName, modelSkinName, sizeof(modelName));
slash = strchr(modelName, '/');
if (!slash) {
// modelName did not include a skin name
@ -1171,8 +1192,12 @@ qboolean UI_RegisterClientModelname(playerInfo_t * pi, const char *modelSkinName
Com_sprintf(filename, sizeof(filename), "models/players/characters/%s/lower.md3", modelName);
pi->legsModel = trap_R_RegisterModel(filename);
if (!pi->legsModel) {
Com_Printf("Failed to load model file %s\n", filename);
return qfalse;
// JBravo: no errors on bad models. Defaults in stead.
Com_sprintf(filename, sizeof(filename), "models/players/grunt/lower.md3");
pi->legsModel = trap_R_RegisterModel(filename);
trap_Cvar_Set("model", "grunt/resdog");
//Com_Printf("Failed to load model file %s\n", filename);
//return qfalse;
}
}
@ -1182,8 +1207,12 @@ qboolean UI_RegisterClientModelname(playerInfo_t * pi, const char *modelSkinName
Com_sprintf(filename, sizeof(filename), "models/players/characters/%s/upper.md3", modelName);
pi->torsoModel = trap_R_RegisterModel(filename);
if (!pi->torsoModel) {
Com_Printf("Failed to load model file %s\n", filename);
return qfalse;
// JBravo: no errors on bad models. Defaults in stead.
Com_sprintf(filename, sizeof(filename), "models/players/grunt/upper.md3");
pi->torsoModel = trap_R_RegisterModel(filename);
trap_Cvar_Set("model", "grunt/resdog");
//Com_Printf("Failed to load model file %s\n", filename);
//return qfalse;
}
}
@ -1200,8 +1229,11 @@ qboolean UI_RegisterClientModelname(playerInfo_t * pi, const char *modelSkinName
}
if (!pi->headModel) {
Com_Printf("Failed to load model file %s\n", filename);
return qfalse;
Com_sprintf(filename, sizeof(filename), "models/players/grunt/head.md3");
pi->headModel = trap_R_RegisterModel(filename);
trap_Cvar_Set("model", "grunt/resdog");
//Com_Printf("Failed to load model file %s\n", filename);
//return qfalse;
}
// if any skins failed to load, fall back to default
if (!UI_RegisterClientSkin(pi, modelName, skinName, headModelName, headSkinName, teamName)) {
@ -1214,11 +1246,14 @@ qboolean UI_RegisterClientModelname(playerInfo_t * pi, const char *modelSkinName
Com_sprintf(filename, sizeof(filename), "models/players/%s/animation.cfg", modelName);
if (!UI_ParseAnimationFile(filename, pi->animations)) {
Com_sprintf(filename, sizeof(filename), "models/players/characters/%s/animation.cfg", modelName);
if (!UI_ParseAnimationFile(filename, pi->animations)) {
Com_sprintf(filename, sizeof(filename), "models/players/grunt/animation.cfg");
if (!UI_ParseAnimationFile(filename, pi->animations)) {
Com_Printf("Failed to load animation file %s\n", filename);
return qfalse;
}
}
}
return qtrue;
}