diff options
Diffstat (limited to 'src/ui/ui_shared.c')
-rw-r--r-- | src/ui/ui_shared.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c index f59a7349..f41b8bdc 100644 --- a/src/ui/ui_shared.c +++ b/src/ui/ui_shared.c @@ -1555,14 +1555,18 @@ void Menus_CloseByName( const char *p ) Menus_Close( Menus_FindByName( p ) ); } -void Menus_CloseAll( void ) +void Menus_CloseAll( qboolean force ) { int i; for( i = 0; i < menuCount; i++ ) - Menus_Close( &Menus[i] ); + { + if( !( Menus[i].window.flags & WINDOW_DONTCLOSEALL ) || force ) + Menus_Close( &Menus[i] ); + } - openMenuCount = 0; + if( force ) + openMenuCount = 0; } @@ -7587,6 +7591,20 @@ qboolean MenuParse_visible( itemDef_t *item, int handle ) return qtrue; } +qboolean MenuParse_dontCloseAll( itemDef_t *item, int handle ) +{ + int i; + menuDef_t *menu = ( menuDef_t* )item; + + if( !PC_Int_Parse( handle, &i ) ) + return qfalse; + + if( i ) + menu->window.flags |= WINDOW_DONTCLOSEALL; + + return qtrue; +} + qboolean MenuParse_onOpen( itemDef_t *item, int handle ) { menuDef_t * menu = ( menuDef_t* )item; @@ -7867,6 +7885,7 @@ keywordHash_t menuParseKeywords[] = { {"aspectBias", MenuParse_aspectBias, NULL}, {"style", MenuParse_style, NULL}, {"visible", MenuParse_visible, NULL}, + {"dontCloseAll", MenuParse_dontCloseAll, NULL}, {"onOpen", MenuParse_onOpen, NULL}, {"onClose", MenuParse_onClose, NULL}, {"onESC", MenuParse_onESC, NULL}, |