8000 mint-arena: Add auto completion for testmodel and testgun · Turtle-Arena/turtle-arena-code@74cffed · GitHub
[go: up one dir, main page]

Skip to content

Commit 74cffed

Browse files
committed
mint-arena: Add auto completion for testmodel and testgun
Completing filenames doesn't work for more than 2 directories deep. This will be fixed in next Spearmint release.
1 parent d3a427a commit 74cffed

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

code/cgame/cg_consolecmds.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -951,8 +951,8 @@ void CG_ToggleMenu_f( void ) {
951951
static consoleCommand_t cg_commands[] = {
952952
{ "+vstr", CG_VstrDown_f, 0, CG_VstrComplete },
953953
{ "-vstr", CG_VstrUp_f, 0, CG_VstrComplete },
954-
{ "testgun", CG_TestGun_f, CMD_INGAME },
955-
{ "testmodel", CG_TestModel_f, CMD_INGAME },
954+
{ "testgun", CG_TestGun_f, CMD_INGAME, CG_TestModelComplete },
955+
{ "testmodel", CG_TestModel_f, CMD_INGAME, CG_TestModelComplete },
956956
{ "nextframe", CG_TestModelNextFrame_f, CMD_INGAME },
957957
{ "prevframe", CG_TestModelPrevFrame_f, CMD_INGAME },
958958
{ "nextskin", CG_TestModelNextSkin_f, CMD_INGAME },

code/cgame/cg_local.h

+1
Original file line numberDiff line numberDiff line change
@@ -1551,6 +1551,7 @@ void Key_SetCatcher( int catcher );
15511551
// cg_view.c
15521552
//
15531553
void CG_TestModel_f (void);
1554+
void CG_TestModelComplete( char *args, int argNum );
15541555
void CG_TestGun_f (void);
15551556
void CG_TestModelNextFrame_f (void);
15561557
void CG_TestModelPrevFrame_f (void);

code/cgame/cg_view.c

+11
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,17 @@ void CG_TestModel_f (void) {
107107
cg.testGun = qfalse;
108108
}
109109

110+
/*
111+
=================
112+
CG_TestModelComplete
113+
=================
114+
*/
115+
void CG_TestModelComplete( char *args, int argNum ) {
116+
if ( argNum == 2 ) {
117+
trap_Field_CompleteFilename( "", "$models", qfalse, qfalse );
118+
}
119+
}
120+
110121
/*
111122
=================
112123
CG_TestGun_f

0 commit comments

Comments
 (0)
0