static void _vg_console_init(void);
static void _vg_console_write_persistent(void);
static void _vg_console_free(void);
-static void vg_execute_console_input( const char *cmd );
+static void vg_execute_console_input( const char *cmd, bool silent );
/*
* Console interface
int _vg_console_exec( int argc, const char *argv[] ){
if( argc < 1 ) return 0;
+ int silent=0;
+ if( argc == 2 ) silent=1;
+
char path[256];
strcpy( path, "cfg/" );
strncat( path, argv[0], 250 );
line[ strcspn( line, "\r\n#" ) ] = 0x00;
if( line[0] != 0x00 ){
- vg_execute_console_input( line );
+ vg_execute_console_input( line, silent );
}
}
}
static void vg_console_load_autos(void){
- _vg_console_exec( 1, (const char *[]){ "auto.conf" } );
+ _vg_console_exec( 2, (const char *[]){ "auto.conf", "silent" } );
}
static void _vg_console_write_persistent(void){
return NULL;
}
-static void vg_execute_console_input( const char *cmd )
+static void vg_execute_console_input( const char *cmd, bool silent )
{
char temp[512];
char const *args[8];
/* Cvar Matched, try get value */
if( arg_count >= 2 ){
if( cv->flags & VG_VAR_CHEAT ){
- if( !vg_console.cheats ){
+ if( !vg_console.cheats && !silent ){
vg_error( "variable is cheat protected\n" );
return;
}
return;
}
- vg_error( "No command/var named '%s'. Use 'list' to view all\n", args[0] );
+ if( !silent )
+ vg_error( "No command/var named '%s'. Use 'list' to view all\n",args[0]);
}
u32 str_lev_distance( const char *s1, const char *s2 ){
}
vg_console.history_pos = -1;
- vg_execute_console_input( vg_console.input );
+ vg_execute_console_input( vg_console.input, 0 );
_ui_textbox_move_cursor( &vg_ui.textbox.cursor_user,
&vg_ui.textbox.cursor_pos, -10000, 1 );