From: Rudolf Polzer Date: Fri, 10 Feb 2012 13:06:22 +0000 (+0100) Subject: rely on engine's togglemenu on first menu start, detect menu_restart later X-Git-Tag: xonotic-v0.6.0~74^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e13da0fa6fe750e009d4315df62b346d1c9d0abe;p=xonotic%2Fxonotic-data.pk3dir.git rely on engine's togglemenu on first menu start, detect menu_restart later --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index e1c5cfc0d..62702c662 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1627,6 +1627,7 @@ alias _gunalign_14 "cl_gunalign 3" alias _gunalign_update "_gunalign_$v_flipped$menu_cl_gunalign" set _menu_alpha "" // will be set by menu QC to the current fading of the menu, can be used by CSQC to fade items +set _menu_initialized 0 "is 0 on first menu loading, 1 later" set g_triggerimpulse_accel_power 1 "trigger_impulse accelerator power (applied BEFORE the multiplier)" set g_triggerimpulse_accel_multiplier 1 "trigger_impulse accelerator multiplier (applied AFTER the power)" diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index 3d2121d1f..2f4e72eb2 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -81,11 +81,11 @@ void m_init() localcmd("\nr_restart\n"); initConwidths(); - m_gamestatus(); - if(gamestatus & (GAME_ISSERVER | GAME_CONNECTED)) - m_hide(); - else + if(cvar("_menu_initialized")) // always show menu after menu_restart m_display(); + else + m_hide(); + cvar_set("_menu_initialized", "1"); } float MENU_ASPECT = 1.25; // 1280x1024