From c3f60ca5b8c6a76bc32559c3cbd4f4acaf413535 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Mon, 1 Sep 2003 20:46:28 +0000 Subject: * Menus are now automatically closed upon death --- src/ui/ui_atoms.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/ui') diff --git a/src/ui/ui_atoms.c b/src/ui/ui_atoms.c index 41f538ff..b8adacdd 100644 --- a/src/ui/ui_atoms.c +++ b/src/ui/ui_atoms.c @@ -368,11 +368,11 @@ qboolean UI_ConsoleCommand( int realTime ) return qtrue; } - if ( Q_stricmp (cmd, "menu") == 0 ) + if( Q_stricmp ( cmd, "menu" ) == 0 ) { arg1 = UI_Argv( 1 ); - if( Menu_Count() > 0 ) + if( Menu_Count( ) > 0 ) { trap_Key_SetCatcher( KEYCATCH_UI ); Menus_ActivateByName( arg1 ); @@ -380,6 +380,18 @@ qboolean UI_ConsoleCommand( int realTime ) } } + if( Q_stricmp ( cmd, "closemenus" ) == 0 ) + { + if( Menu_Count( ) > 0 ) + { + trap_Key_SetCatcher( trap_Key_GetCatcher( ) & ~KEYCATCH_UI ); + trap_Key_ClearStates( ); + trap_Cvar_Set( "cl_paused", "0" ); + Menus_CloseAll( ); + return qtrue; + } + } + if ( Q_stricmp (cmd, "ui_cdkey") == 0 ) { //UI_CDKeyMenu_f(); return qtrue; -- cgit