From: Rudolf Polzer Date: Fri, 10 Feb 2012 13:09:50 +0000 (+0100) Subject: fix default language to save a useless menu_restart on first startup X-Git-Tag: xonotic-v0.6.0~74^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=30d896d89b513d312302ffa6ebd18b4f0dc55d79;p=xonotic%2Fxonotic-data.pk3dir.git fix default language to save a useless menu_restart on first startup --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 62702c662..734f9c8bb 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -86,6 +86,7 @@ vid_fullscreen 1 vid_width 1024 vid_height 768 vid_pixelheight 1 +prvm_language en set _menu_prvm_language "" set _menu_vid_width "$vid_width" set _menu_vid_height "$vid_height" diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index 2f4e72eb2..b541a7f06 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -39,6 +39,7 @@ void m_gamestatus() void m_init() { + float restarting = 0; cvar_set("_menu_alpha", "0"); prvm_language = cvar_string("prvm_language"); if(prvm_language == "") @@ -46,6 +47,7 @@ void m_init() prvm_language = "en"; cvar_set("prvm_language", prvm_language); localcmd("\nmenu_restart\n"); + restarting = 1; } prvm_language = strzone(prvm_language); cvar_set("_menu_prvm_language", prvm_language); @@ -81,11 +83,14 @@ void m_init() localcmd("\nr_restart\n"); initConwidths(); - if(cvar("_menu_initialized")) // always show menu after menu_restart - m_display(); - else - m_hide(); - cvar_set("_menu_initialized", "1"); + if(!restarting) + { + 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