vid_width 1024
vid_height 768
vid_pixelheight 1
+vid_resizable 0 // cannot be turned on before it is sure it cannot cause a r_restart
+vid_desktopfullscreen 1
prvm_language en
set _menu_prvm_language ""
set _menu_vid_width "$vid_width"
set _menu_vid_height "$vid_height"
set _menu_vid_pixelheight "$vid_pixelheight"
seta menu_vid_scale 0
+ seta menu_vid_allowdualscreenresolution 0
// 2D resolution 800x600
vid_conwidth 800
vid_conheight 600
seta sv_defaultplayerskin_pink 0
seta sv_defaultplayercolors "" "set to 16*shirt+pants to force a color, note: it does NOT depend on defaultcharacter! Set to \"\" to disable"
set sv_autoscreenshot 0 "if set to 1, the server forces all clients to create a local screenshot once the map ended"
- net_messagetimeout 300
+ net_messagetimeout 30
net_connecttimeout 30
sv_jumpstep 1 // step up stairs while jumping, makes it easier to reach ledges
set ekg 0 "Throw huge amounts of gibs"
makesaved v_kicktime
// ticrate
- //sys_ticrate 0.0166667
- sys_ticrate 0.0333333
+ //sys_ticrate 0.0166667 // 60fps. This would be ideal, but kills home routers.
+ sys_ticrate 0.0333333 // Use 30fps instead.
cl_netfps 60 // should match or be a multiple
sv_gameplayfix_delayprojectiles 0
sv_gameplayfix_q2airaccelerate 1
mod_q3shader_default_polygonfactor 0
// allow fullbright
- set sv_allow_fullbright 0 "when set, clients may use r_fullbright on this server without getting a night vision effect overlay"
+ set sv_allow_fullbright 1 "when set, clients may use r_fullbright on this server without getting a night vision effect overlay"
// auto-teams (team selection by player ID)
// any player not listed is forced to spectate
}
}
- float MENU_ASPECT = 1.25; // 1280x1024
- float MENU_MINHEIGHT = 600;
+ const float MENU_ASPECT = 1.25; // 1280x1024
+ const float MENU_MINHEIGHT = 600;
-float conwidth_s, conheight_s, realconwidth, realconheight, screenconwidth, screenconheight;
+float conwidth_s, conheight_s, vidwidth_s, vidheight_s, realconwidth,
+ realconheight, screenconwidth, screenconheight;
void draw_reset_cropped()
{
draw_reset(screenconwidth, screenconheight, 0.5 * (realconwidth - screenconwidth), 0.5 * (realconheight - screenconheight));
{
draw_reset(realconwidth, realconheight, 0, 0);
}
-void UpdateConWidthHeight()
+
+void UpdateConWidthHeight(float w, float h)
{
+ if (w != vidwidth_s || h != vidheight_s)
+ {
+ initConwidths(w, h);
+ updateConwidths();
+ vidwidth_s = w;
+ vidheight_s = h;
+ }
conwidth_s = conwidth;
conheight_s = conheight;
realconwidth = cvar("vid_conwidth");
string s;
conwidth = conheight = -1;
- UpdateConWidthHeight();
+ UpdateConWidthHeight(cvar("vid_width"), cvar("vid_height"));
draw_reset_cropped();
menuInitialized = 0;
return;
if(!Menu_Active)
return;
+
+ if(menuMouseMode)
+ if(key >= K_MOUSE1 && key <= K_MOUSE3)
+ {
+ // detect a click outside of the game window
+ vector p = getmousepos();
+ if(p_x < 0 || p_x > realconwidth || p_y < 0 || p_y > realconheight)
+ {
+ ++mouseButtonsPressed;
+ return;
+ }
+ }
+
if(keyGrabber)
{
entity e;
if(key == K_SHIFT) menuShiftState |= S_SHIFT;
}
- float SCALEMODE_CROP = 0;
- float SCALEMODE_LETTERBOX = 1;
- float SCALEMODE_WIDTH = 2;
- float SCALEMODE_HEIGHT = 3;
- float SCALEMODE_STRETCH = 4;
+ const float SCALEMODE_CROP = 0;
+ const float SCALEMODE_LETTERBOX = 1;
+ const float SCALEMODE_WIDTH = 2;
+ const float SCALEMODE_HEIGHT = 3;
+ const float SCALEMODE_STRETCH = 4;
void draw_Picture_Aligned(vector algn, float scalemode, string img, float a)
{
vector sz, org, isz, isz_w, isz_h;
}
}
-void m_draw()
+void m_draw(float width, float height)
{
float t;
float realFrametime;
anim.tickAll(anim);
if(main)
- UpdateConWidthHeight();
+ {
+#ifdef COMPAT_XON070_OLD_M_DRAW
+ UpdateConWidthHeight(width ? width : cvar("vid_width"), height ? height : cvar("vid_height"));
+#else
+ UpdateConWidthHeight(width, height);
+#endif
+ }
if(!menuInitialized)
{
for(e = NULL; (e = find(e, name, itemname)); )
if(e.classname != "vtbl")
break;
- if(e)
+
+ if((e) && (!e.requiresConnection || (gamestatus & (GAME_ISSERVER | GAME_CONNECTED))))
{
m_hide();
m_activate_window(e);
#endif
#ifdef IMPLEMENTATION
-void initConwidths()
+void initConwidths(float width, float height)
{
- cvar_set("_menu_vid_width", cvar_string("vid_width"));
- cvar_set("_menu_vid_height", cvar_string("vid_height"));
+ cvar_set("_menu_vid_width", ftos(width));
+ cvar_set("_menu_vid_height", ftos(height));
cvar_set("_menu_vid_pixelheight", cvar_string("vid_pixelheight"));
}
void updateConwidths()
me.addValue(me, strzone(sprintf(_("%dx%d"), w, h)), strzone(strcat(ftos(w), " ", ftos(h), " ", ftos(pixelheight))));
// FIXME (in case you ever want to dynamically instantiate this): THIS IS NEVER FREED
}
+ float autocvar_menu_vid_allowdualscreenresolution;
void XonoticResolutionSlider_configureXonoticResolutionSlider(entity me)
{
float i;
if(r_x < 640 || r_y < 480)
continue;
if(r_x > 2 * r_y) // likely dualscreen resolution, skip this one
- continue;
+ if(autocvar_menu_vid_allowdualscreenresolution <= 0)
+ continue;
+
me.addResolution(me, r_x, r_y, r_z);
}