From: terencehill Date: Mon, 25 Apr 2016 18:15:39 +0000 (+0200) Subject: Force to show the menu 1 second after you get disconnected (without a delay it pops... X-Git-Tag: xonotic-v0.8.2~932^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=005331447be80e0e6d6dba2f062b833743028ad0;p=xonotic%2Fxonotic-data.pk3dir.git Force to show the menu 1 second after you get disconnected (without a delay it pops up for an instant on map change) --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 2056f1511..6554bb1a7 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -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 diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index bde7fbe28..b2b2d662a 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -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();