From 181f6a9939ddddfc765114319fa14c74f316dd09 Mon Sep 17 00:00:00 2001 From: Michael Levin Date: Sat, 3 Oct 2009 11:16:05 +0000 Subject: * Menus_CloseAll() now takes one argument -- force. This argument determines whether to close all menus or ignore menus that don't respond to CloseAll (via the new dontCloseAll MENU_TRUE attribute). * ui_messagemode2222 and the like won't activate the teamsay menu * Say menu will no longer close when the player dies --- src/ui/ui_shared.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'src/ui/ui_shared.c') 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}, -- cgit