From 660be5cc7d3989740b4e6fbd8ed8b1d9c46ebd20 Mon Sep 17 00:00:00 2001 From: tma Date: Tue, 16 Sep 2008 21:05:22 +0000 Subject: * Move command argument completion from being hard coded to being associated with the individual commands to be completed git-svn-id: svn://svn.icculus.org/quake3/trunk@1472 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/server/sv_ccmds.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'code/server') diff --git a/code/server/sv_ccmds.c b/code/server/sv_ccmds.c index 07a3b44..01bc60d 100644 --- a/code/server/sv_ccmds.c +++ b/code/server/sv_ccmds.c @@ -1051,6 +1051,17 @@ static void SV_KillServer_f( void ) { //=========================================================== +/* +================== +SV_CompleteMapName +================== +*/ +static void SV_CompleteMapName( char *args, int argNum ) { + if( argNum == 2 ) { + Field_CompleteFilename( "maps", "bsp", qtrue ); + } +} + /* ================== SV_AddOperatorCommands @@ -1081,10 +1092,14 @@ void SV_AddOperatorCommands( void ) { Cmd_AddCommand ("map_restart", SV_MapRestart_f); Cmd_AddCommand ("sectorlist", SV_SectorList_f); Cmd_AddCommand ("map", SV_Map_f); + Cmd_SetCommandCompletionFunc( "map", SV_CompleteMapName ); #ifndef PRE_RELEASE_DEMO Cmd_AddCommand ("devmap", SV_Map_f); + Cmd_SetCommandCompletionFunc( "devmap", SV_CompleteMapName ); Cmd_AddCommand ("spmap", SV_Map_f); + Cmd_SetCommandCompletionFunc( "spmap", SV_CompleteMapName ); Cmd_AddCommand ("spdevmap", SV_Map_f); + Cmd_SetCommandCompletionFunc( "spdevmap", SV_CompleteMapName ); #endif Cmd_AddCommand ("killserver", SV_KillServer_f); if( com_dedicated->integer ) { -- cgit v1.2.3