diff options
author | Michael Levin <risujin@fastmail.fm> | 2009-10-03 11:16:05 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:14:48 +0000 |
commit | 181f6a9939ddddfc765114319fa14c74f316dd09 (patch) | |
tree | 0dd20c67eb3ec9e2d57dc9e96190cc1597a38d79 /src/ui/ui_shared.c | |
parent | 5399133ec251b57770a9adf2010af5547b9af16a (diff) |
* 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
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}, |