]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Changed loading screen to continue during a connection attempt if the console or...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 22 Jan 2020 10:33:30 +0000 (10:33 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 22 Jan 2020 10:33:30 +0000 (10:33 +0000)
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

cl_screen.c

index 4cdbcf238ae37e9083ef2a759746511441224f1f..94d6ed102a740297d74d100495a591d692627dba 100644 (file)
@@ -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;