From: havoc Date: Wed, 22 Jan 2020 10:33:30 +0000 (+0000) Subject: Changed loading screen to continue during a connection attempt if the console or... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a8ae1121cb66ad41c49ea1a26d9651f48ae90497;p=xonotic%2Fdarkplaces.git Changed loading screen to continue during a connection attempt if the console or menu is not forced. Changed scr_conforcewhiledisconnected 1 to not force the console during a connection attempt, kept the old behavior as scr_conforcewhiledisconnected 2. If console is already open, the loading screen while connecting is not forced. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12507 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_screen.c b/cl_screen.c index 4cdbcf23..94d6ed10 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -690,7 +690,9 @@ static void SCR_SetUpToDrawConsole (void) framecounter = 0; #endif - if (scr_conforcewhiledisconnected.integer && key_dest == key_game && cls.signon != SIGNONS) + if (scr_conforcewhiledisconnected.integer >= 2 && key_dest == key_game && cls.signon != SIGNONS) + key_consoleactive |= KEY_CONSOLEACTIVE_FORCED; + else if (scr_conforcewhiledisconnected.integer >= 1 && key_dest == key_game && cls.signon != SIGNONS && !sv.active) key_consoleactive |= KEY_CONSOLEACTIVE_FORCED; else key_consoleactive &= ~KEY_CONSOLEACTIVE_FORCED; @@ -2061,6 +2063,7 @@ int r_stereo_side; extern cvar_t v_isometric; extern cvar_t v_isometric_verticalfov; +static void SCR_DrawLoadingScreen(qboolean clear); static void SCR_DrawScreen (void) { Draw_Frame(); @@ -2154,6 +2157,19 @@ static void SCR_DrawScreen (void) R_RenderView(0, NULL, NULL, r_refdef.view.x, r_refdef.view.y, r_refdef.view.width, r_refdef.view.height); } } + else if (key_dest == key_game && key_consoleactive == 0 && (cls.state == ca_connected || cls.connect_trying)) + { + // draw the loading screen for a while if we're still connecting and not forcing the console or menu to show up + char temp[64]; + if (cls.signon > 0) + SCR_PushLoadingScreen(false, va(temp, sizeof(temp), "Connect: Signon stage %i of %i", cls.signon, SIGNONS), 1.0); + else if (cls.connect_remainingtries > 0) + SCR_PushLoadingScreen(false, va(temp, sizeof(temp), "Connect: Trying... %i", cls.connect_remainingtries), 1.0); + else + SCR_PushLoadingScreen(false, va(temp, sizeof(temp), "Connect: Waiting %i seconds for reply", 10 + cls.connect_remainingtries), 1.0); + SCR_DrawLoadingScreen(true); + SCR_PopLoadingScreen(false); + } // Don't apply debugging stuff like r_showsurfaces to the UI r_refdef.view.showdebug = false;