From f7b88a4ed5a8c9347d9e40e0aee22c5a7011f60e Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Mon, 24 Apr 2006 21:05:06 +0000 Subject: * Removed some \n from server connection messages * Removed nextmap cvar and associated code, replaced with "advanceMapRotation" command * Rework the text displayed during votes to be more verbose * "destroy" command now only works when cheats are enabled * Voting UI is now a frontend for "clientkick" instead of plain "kick" --- src/ui/ui_local.h | 1 + src/ui/ui_main.c | 27 +++++++++++---------------- 2 files changed, 12 insertions(+), 16 deletions(-) (limited to 'src/ui') diff --git a/src/ui/ui_local.h b/src/ui/ui_local.h index d8340695..c2604af3 100644 --- a/src/ui/ui_local.h +++ b/src/ui/ui_local.h @@ -820,6 +820,7 @@ typedef struct { qboolean teamLeader; char playerNames[MAX_CLIENTS][MAX_NAME_LENGTH]; char teamNames[MAX_CLIENTS][MAX_NAME_LENGTH]; + int clientNums[MAX_CLIENTS]; int teamClientNums[MAX_CLIENTS]; int mapCount; diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index cde1c73a..c7b90a6a 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -2134,6 +2134,7 @@ static void UI_BuildPlayerList( void ) { if (info[0]) { Q_strncpyz( uiInfo.playerNames[uiInfo.playerCount], Info_ValueForKey( info, "n" ), MAX_NAME_LENGTH ); Q_CleanStr( uiInfo.playerNames[uiInfo.playerCount] ); + uiInfo.clientNums[uiInfo.playerCount] = n; uiInfo.playerCount++; team2 = atoi(Info_ValueForKey(info, "t")); if (team2 == team) { @@ -4110,30 +4111,24 @@ static void UI_RunMenuScript(char **args) { if (ui_currentNetMap.integer >=0 && ui_currentNetMap.integer < uiInfo.mapCount) { trap_Cmd_ExecuteText( EXEC_APPEND, va("callvote map %s\n",uiInfo.mapList[ui_currentNetMap.integer].mapLoadName) ); } - } else if (Q_stricmp(name, "voteKick") == 0) { - if (uiInfo.playerIndex >= 0 && uiInfo.playerIndex < uiInfo.playerCount) { - trap_Cmd_ExecuteText( EXEC_APPEND, va("callvote kick %s\n",uiInfo.playerNames[uiInfo.playerIndex]) ); - } } - else if( Q_stricmp( name, "voteTeamKick" ) == 0 ) + else if( Q_stricmp( name, "voteKick" ) == 0 ) { if( uiInfo.playerIndex >= 0 && uiInfo.playerIndex < uiInfo.playerCount ) { - trap_Cmd_ExecuteText( EXEC_APPEND, va( "callteamvote teamkick %s\n", uiInfo.playerNames[ uiInfo.teamIndex ] ) ); + trap_Cmd_ExecuteText( EXEC_APPEND, va( "callvote clientkick %d\n", + uiInfo.clientNums[ uiInfo.playerIndex ] ) ); } } - else if (Q_stricmp(name, "voteGame") == 0) { - if (ui_netGameType.integer >= 0 && ui_netGameType.integer < uiInfo.numGameTypes) { - trap_Cmd_ExecuteText( EXEC_APPEND, va("callvote g_gametype %i\n",uiInfo.gameTypes[ui_netGameType.integer].gtEnum) ); - } - } else if (Q_stricmp(name, "voteLeader") == 0) { - if (uiInfo.teamIndex >= 0 && uiInfo.teamIndex < uiInfo.myTeamCount) { - trap_Cmd_ExecuteText( EXEC_APPEND, va("callteamvote leader %s\n",uiInfo.teamNames[uiInfo.teamIndex]) ); + else if( Q_stricmp( name, "voteTeamKick" ) == 0 ) + { + if( uiInfo.teamIndex >= 0 && uiInfo.teamIndex < uiInfo.playerCount ) + { + trap_Cmd_ExecuteText( EXEC_APPEND, va( "callteamvote teamclientkick %d\n", + uiInfo.teamClientNums[ uiInfo.teamIndex ] ) ); } } - else if (Q_stricmp(name, "addBot") == 0) { - trap_Cmd_ExecuteText( EXEC_APPEND, va("addbot %s %i %s\n", UI_GetBotNameByNumber(uiInfo.botIndex), uiInfo.skillIndex+1, (uiInfo.redBlue == 0) ? "Red" : "Blue") ); - } else if (Q_stricmp(name, "addFavorite") == 0) { + else if (Q_stricmp(name, "addFavorite") == 0) { if (ui_netSource.integer != AS_FAVORITES) { char name[MAX_NAME_LENGTH]; char addr[MAX_NAME_LENGTH]; -- cgit