mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-02-06 12:14:15 +00:00
engine: console: sort output in commmand autocomplete for bind
This commit is contained in:
parent
7aa163f713
commit
364c96f45c
@ -598,6 +598,16 @@ static void Con_AddCommandToList( const char *s, const char *unused1, const char
|
|||||||
list->cmds[list->matchCount++] = copystring( s );
|
list->cmds[list->matchCount++] = copystring( s );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
=================
|
||||||
|
Con_SortCmds
|
||||||
|
=================
|
||||||
|
*/
|
||||||
|
static int Con_SortCmds( const void *arg1, const void *arg2 )
|
||||||
|
{
|
||||||
|
return Q_stricmp( *(const char **)arg1, *(const char **)arg2 );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=====================================
|
=====================================
|
||||||
Cmd_GetCommandsList
|
Cmd_GetCommandsList
|
||||||
@ -632,6 +642,8 @@ qboolean Cmd_GetCommandsList( const char *s, char *completedname, int length )
|
|||||||
Q_strncpy( completedname, matchbuf, length );
|
Q_strncpy( completedname, matchbuf, length );
|
||||||
if( list.matchCount == 1 ) return true;
|
if( list.matchCount == 1 ) return true;
|
||||||
|
|
||||||
|
qsort( list.cmds, list.matchCount, sizeof( char* ), Con_SortCmds );
|
||||||
|
|
||||||
for( i = 0; i < list.matchCount; i++ )
|
for( i = 0; i < list.matchCount; i++ )
|
||||||
{
|
{
|
||||||
Q_strncpy( matchbuf, list.cmds[i], sizeof( matchbuf ));
|
Q_strncpy( matchbuf, list.cmds[i], sizeof( matchbuf ));
|
||||||
@ -1026,16 +1038,6 @@ qboolean Cmd_AutocompleteName( const char *source, int arg, char *buffer, size_t
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
=================
|
|
||||||
Con_SortCmds
|
|
||||||
=================
|
|
||||||
*/
|
|
||||||
static int Con_SortCmds( const void *arg1, const void *arg2 )
|
|
||||||
{
|
|
||||||
return Q_stricmp( *(const char **)arg1, *(const char **)arg2 );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
===============
|
||||||
Con_PrintCmdMatches
|
Con_PrintCmdMatches
|
||||||
|
Loading…
x
Reference in New Issue
Block a user