From: Rudolf Polzer Date: Fri, 10 Feb 2012 13:01:54 +0000 (+0100) Subject: don't start up with menu when a demo is played back X-Git-Tag: xonotic-v0.6.0~74^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=37ba9242ff5729780e8d3ad05deb5a30a5c7fec4;p=xonotic%2Fxonotic-data.pk3dir.git don't start up with menu when a demo is played back --- diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index 42b40568b..3d2121d1f 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -26,6 +26,17 @@ void m_sync() loadAllCvars(main); } +void m_gamestatus() +{ + gamestatus = 0; + if(isserver()) + gamestatus = gamestatus | GAME_ISSERVER; + if(clientstate() == CS_CONNECTED || isdemo()) + gamestatus = gamestatus | GAME_CONNECTED; + if(cvar("developer")) + gamestatus = gamestatus | GAME_DEVELOPER; +} + void m_init() { cvar_set("_menu_alpha", "0"); @@ -70,7 +81,11 @@ void m_init() localcmd("\nr_restart\n"); initConwidths(); - m_display(); + m_gamestatus(); + if(gamestatus & (GAME_ISSERVER | GAME_CONNECTED)) + m_hide(); + else + m_display(); } float MENU_ASPECT = 1.25; // 1280x1024 @@ -641,6 +656,8 @@ void m_draw() float t; float realFrametime; + m_gamestatus(); + execute_next_frame(); menuMouseMode = cvar("menu_mouse_absolute"); @@ -695,14 +712,6 @@ void m_draw() if(cvar("cl_capturevideo")) frametime = t / cvar("cl_capturevideo_fps"); // make capturevideo work smoothly - gamestatus = 0; - if(isserver()) - gamestatus = gamestatus | GAME_ISSERVER; - if(clientstate() == CS_CONNECTED) - gamestatus = gamestatus | GAME_CONNECTED; - if(cvar("developer")) - gamestatus = gamestatus | GAME_DEVELOPER; - prevMenuAlpha = menuAlpha; if(Menu_Active) {