]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Force to show the menu 1 second after you get disconnected (without a delay it pops...
authorterencehill <piuntn@gmail.com>
Mon, 25 Apr 2016 18:15:39 +0000 (20:15 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 25 Apr 2016 18:15:39 +0000 (20:15 +0200)
defaultXonotic.cfg
qcsrc/menu/menu.qc

index 2056f15115d79f83f170c5128fc9a38ea0b4d040..6554bb1a76bccd80cb217e09d2f64ed73101ee9f 100644 (file)
@@ -809,6 +809,7 @@ seta menu_tooltips 1 "menu tooltips: 0 disabled, 1 enabled, 2 also shows cvar or
 set menu_picmip_bypass 0 "bypass texture quality enforcement based on system resources, not recommended and may cause crashes!"
 set menu_showboxes 0 "show item bounding boxes (debug)"
 set menu_cvarlist_onlymodified 0 "show only modified cvars in the cvar list"
+set menu_force_on_disconnection 1 "force to show the menu this number of seconds after you get disconnected (0 to disable)"
 
 r_textbrightness 0.2
 r_textcontrast 0.8
index bde7fbe281ce1423e7dc4448ec7ca0e8ebc2dafd..b2b2d662af8677faecf6de0daf9ecbdf66dc91ce 100644 (file)
@@ -669,9 +669,24 @@ void m_tooltip(vector pos)
        }
 }
 
+float autocvar_menu_force_on_disconnection;
 void m_draw(float width, float height)
 {
-       if (clientstate() == CS_DISCONNECTED) m_toggle(true);
+       if (autocvar_menu_force_on_disconnection > 0)
+       {
+               static float connected_time;
+               if (clientstate() == CS_DISCONNECTED)
+               {
+                       if (connected_time && time - connected_time > autocvar_menu_force_on_disconnection)
+                       {
+                               m_toggle(true);
+                               connected_time = 0;
+                       }
+               }
+               else
+                       connected_time = time;
+       }
+
        m_gamestatus();
 
        execute_next_frame();