diff options
author | Christopher Schwarz <lakitu7@gmail.com> | 2009-10-03 13:04:54 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:16:27 +0000 |
commit | 3fcb1c09898094cd3ecb555ad3ba913065d0fd17 (patch) | |
tree | 02fbe64e8dcc4cbe68e13d386cf35dd852f85a66 /src/ui | |
parent | a285ef54f04940e66563bc2761da7005db35ec4e (diff) |
* Automatically prompt the user for what to do when files are needed from the server and cl_allowDownload=0. (bug 3038) (Risujin, kevlarman)
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/ui_gameinfo.c | 2 | ||||
-rw-r--r-- | src/ui/ui_main.c | 31 |
2 files changed, 23 insertions, 10 deletions
diff --git a/src/ui/ui_gameinfo.c b/src/ui/ui_gameinfo.c index 4315ddfb..c11f7248 100644 --- a/src/ui/ui_gameinfo.c +++ b/src/ui/ui_gameinfo.c @@ -367,5 +367,7 @@ void UI_ServerInfo( void ) Info_ValueForKey( info, "g_unlagged" ) ); trap_Cvar_Set( "ui_serverinfo_ff", Info_ValueForKey( info, "ff" ) ); + trap_Cvar_Set( "ui_serverinfo_allowdl", + Info_ValueForKey( info, "sv_allowdownload" ) ); } } diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index ddc525e1..00cc23f2 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -2849,15 +2849,18 @@ static void UI_RunMenuScript( char **args ) Controls_SetConfig( qtrue ); else if( Q_stricmp( name, "loadControls" ) == 0 ) Controls_GetConfig(); - else if( Q_stricmp( name, "clearError" ) == 0 ) - trap_Cvar_Set( "com_errorMessage", "" ); - else if( Q_stricmp( name, "RefreshServers" ) == 0 ) - { - UI_StartServerRefresh( qtrue ); - UI_BuildServerDisplayList( qtrue ); - } - else if( Q_stricmp( name, "InitServerList" ) == 0 ) - { + else if (Q_stricmp(name, "clearError") == 0) { + trap_Cvar_Set("com_errorMessage", ""); + } else if (Q_stricmp(name, "downloadIgnore") == 0) { + trap_Cvar_Set("com_downloadPrompt", va("%d", DLP_IGNORE)); + } else if (Q_stricmp(name, "downloadCURL") == 0) { + trap_Cvar_Set("com_downloadPrompt", va("%d", DLP_CURL)); + } else if (Q_stricmp(name, "downloadUDP") == 0) { + trap_Cvar_Set("com_downloadPrompt", va("%d", DLP_UDP)); + } else if (Q_stricmp(name, "RefreshServers") == 0) { + UI_StartServerRefresh(qtrue); + UI_BuildServerDisplayList(qtrue); + } else if (Q_stricmp(name, "InitServerList") == 0) { int time = trap_RealTime( NULL ); int last; int sortColumn; @@ -4387,7 +4390,15 @@ void UI_DrawConnectScreen( qboolean overlay ) case CA_CONNECTED: { char downloadName[MAX_INFO_VALUE]; - + int prompt = trap_Cvar_VariableValue( "com_downloadPrompt" ); + + if( prompt & DLP_SHOW ) { + Com_Printf("Opening download prompt...\n"); + trap_Key_SetCatcher( KEYCATCH_UI ); + Menus_ActivateByName("download_popmenu"); + trap_Cvar_Set( "com_downloadPrompt", "0" ); + } + trap_Cvar_VariableStringBuffer( "cl_downloadName", downloadName, sizeof( downloadName ) ); if( *downloadName ) |