X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fmenu.qc;h=382a19d2ded3074b4fae4dabc92c9e73e13b819f;hb=8956fac358b1f67619049037f188cbffd6fe1b36;hp=eb68729bad9bacc5d80e5d80b4602dea51c91192;hpb=117b5f5c44a743f9189e378bc0fcc33c23068c27;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index eb68729ba..382a19d2d 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -17,7 +17,7 @@ float menuNotTheFirstFrame; float menuMouseMode; float conwidth_s, conheight_s, vidwidth_s, vidheight_s, vidpixelheight_s, - realconwidth, realconheight, screenconwidth, screenconheight; + realconwidth, realconheight; void m_sync() { @@ -56,7 +56,7 @@ void m_init() check_unacceptable_compiler_bugs(); #ifdef WATERMARK - print(sprintf(_("^4MQC Build information: ^1%s\n"), WATERMARK)); + printf(_("^4MQC Build information: ^1%s\n"), WATERMARK); #endif // list all game dirs (TEST) @@ -67,7 +67,7 @@ void m_init() for(i = 0; ; ++i) { s = getgamedirinfo(i, GETGAMEDIRINFO_NAME); - if not(s) + if (!s) break; dprint(s, ": ", getgamedirinfo(i, GETGAMEDIRINFO_DESCRIPTION)); } @@ -77,6 +77,8 @@ void m_init() CALL_ACCUMULATED_FUNCTION(RegisterWeapons); CALL_ACCUMULATED_FUNCTION(RegisterGametypes); + RegisterSLCategories(); + float ddsload = cvar("r_texture_dds_load"); float texcomp = cvar("gl_texturecompression"); updateCompression(); @@ -94,11 +96,10 @@ void m_init() } const float MENU_ASPECT = 1.25; // 1280x1024 -const float MENU_MINHEIGHT = 600; void draw_reset_cropped() { - draw_reset(screenconwidth, screenconheight, 0.5 * (realconwidth - screenconwidth), 0.5 * (realconheight - screenconheight)); + draw_reset(conwidth, conheight, 0.5 * (realconwidth - conwidth), 0.5 * (realconheight - conheight)); } void draw_reset_full() { @@ -109,7 +110,8 @@ void UpdateConWidthHeight(float w, float h, float p) { if (w != vidwidth_s || h != vidheight_s || p != vidpixelheight_s) { - updateConwidths(w, h, p); + if (updateConwidths(w, h, p)) + localcmd(sprintf("\nexec %s\n", cvar_string("menu_font_cfg"))); vidwidth_s = w; vidheight_s = h; vidpixelheight_s = p; @@ -130,18 +132,6 @@ void UpdateConWidthHeight(float w, float h, float p) conwidth = realconwidth; conheight = realconwidth / MENU_ASPECT; } - screenconwidth = conwidth; - screenconheight = conheight; - if(conwidth < MENU_MINHEIGHT * MENU_ASPECT) - { - conheight *= MENU_MINHEIGHT * MENU_ASPECT / conwidth; - conwidth = MENU_MINHEIGHT * MENU_ASPECT; - } - if(conheight < MENU_MINHEIGHT) - { - conwidth *= MENU_MINHEIGHT / conheight; - conheight = MENU_MINHEIGHT; - } if(main) { if(conwidth_s != conwidth || conheight_s != conheight) @@ -453,7 +443,7 @@ float m_allocatetooltipbox(vector pos) v = pos + avoidplus; if(m_testtooltipbox(v)) return TRUE; - + // bottom center v_x = pos_x - menuTooltipSize_x * 0.5; if(m_testtooltipbox(v)) @@ -473,12 +463,12 @@ float m_allocatetooltipbox(vector pos) v_x = pos_x - menuTooltipSize_x * 0.5; if(m_testtooltipbox(v)) return TRUE; - + // top right v_x = pos_x + avoidplus_x; if(m_testtooltipbox(v)) return TRUE; - + return FALSE; } entity m_findtooltipitem(entity root, vector pos) @@ -1002,7 +992,7 @@ void m_goto(string itemname) for(e = NULL; (e = find(e, name, itemname)); ) if(e.classname != "vtbl") break; - + if((e) && (!e.requiresConnection || (gamestatus & (GAME_ISSERVER | GAME_CONNECTED)))) { m_hide();