// item: server list
ALPHA_SERVERLIST_FULL 0.4
-ALPHA_SERVERLIST_EMPTY 0.7
+ALPHA_SERVERLIST_EMPTY 0.6
COLOR_SERVERLIST_LOWPING '0 1 0'
COLOR_SERVERLIST_MEDPING '1 0.75 0'
COLOR_SERVERLIST_HIGHPING '1 0 0'
float isfriend;
float cm;
cm = self.forceplayermodels_savecolormap;
- cm = (cm >= 1024) ? cm : (stof(getplayerkeyvalue(self.colormap - 1, "colors")) + 1024);
+ cm = (cm >= 1024) ? cm : (stof(getplayerkeyvalue(cm - 1, "colors")) + 1024);
if(teamplay)
isfriend = (cm == 1024 + 17 * myteam);
MSG_ANNCE_NOTIF(default, prefix##YELLOW, channel, sprintf(sound, strtolower(STATIC_NAME_TEAM_3)), volume, position) \
MSG_ANNCE_NOTIF(default, prefix##PINK, channel, sprintf(sound, strtolower(STATIC_NAME_TEAM_4)), volume, position)
#define MULTITEAM_ANNCE(default,prefix,teams,channel,sound,volume,position) \
- MSG_ANNCE_NOTIF_##teams(default,prefix,channel,sound,volume,position) \
+ MULTITEAM_ANNCE##teams(default,prefix,channel,sound,volume,position)
#define MSG_ANNCE_NOTIFICATIONS \
MSG_ANNCE_NOTIF(1, ANNCE_ACHIEVEMENT_AIRSHOT, CH_INFO, "airshot", VOL_BASEVOICE, ATTEN_NONE) \
string(float chars, string s, ...) strpad = #225;
string(string info, string key, string value, ...) infoadd = #226;
string(string info, string key) infoget = #227;
+float(string s1, string s2) strcmp = #228;
float(string s1, string s2, float len) strncmp = #228;
float(string s1, string s2) strcasecmp = #229;
float(string s1, string s2, float len) strncasecmp = #230;
string(float chars, string s, ...) strpad = #225; // pad string with spaces to a specified length, < 0 = left padding, > 0 = right padding
string(string info, string key, string value, ...) infoadd = #226; // sets or adds a key/value pair to an infostring - note: forbidden characters are \ and "
string(string info, string key) infoget = #227; // gets a key/value pair in an infostring, returns value or null if not found
+float(string s1, string s2) strcmp = #228; // compare two strings
float(string s1, string s2, float len) strncmp = #228; // compare two strings up to the specified number of characters, if their length differs and is within the specified limit the result will be negative, otherwise it is the difference in value of their first non-matching character.
float(string s1, string s2) strcasecmp = #229; // compare two strings with case-insensitive matching, characters a-z are considered equivalent to the matching A-Z character, no other differences, and this does not consider special characters equal even if they look similar
float(string s1, string s2, float len) strncasecmp = #230; // same as strcasecmp but with a length limit, see strncmp
string(float chars, string s, ...) strpad = #225;
string(string info, string key, string value, ...) infoadd = #226;
string(string info, string key) infoget = #227;
+float(string s1, string s2) strcmp = #228;
float(string s1, string s2, float len) strncmp = #228;
float(string s1, string s2) strcasecmp = #229;
float(string s1, string s2, float len) strncasecmp = #230;
return;
}
+ if(argv(0) == "update_conwidths_before_vid_restart")
+ {
+ updateConwidths(cvar("vid_width"), cvar("vid_height"), cvar("vid_pixelheight"));
+ return;
+ }
+
if(argv(0) == "directmenu" || argv(0) == "directpanelhudmenu")
{
string filter = string_null;
{
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;
}
me.gotoRC(me, me.rows - 1, 0);
- me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_width $_menu_vid_width; vid_height $_menu_vid_height; vid_pixelheight $_menu_vid_pixelheight; vid_desktopfullscreen $_menu_vid_desktopfullscreen; vid_restart; menu_restart; menu_cmd videosettings", COMMANDBUTTON_APPLY));
+ me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_width $_menu_vid_width; vid_height $_menu_vid_height; vid_pixelheight $_menu_vid_pixelheight; vid_desktopfullscreen $_menu_vid_desktopfullscreen; menu_cmd update_conwidths_before_vid_restart; vid_restart; menu_cmd sync", COMMANDBUTTON_APPLY));
}
#endif
ATTRIB(XonoticResolutionSlider, vid_fullscreen, float, -1)
ENDCLASS(XonoticResolutionSlider)
entity makeXonoticResolutionSlider();
-void updateConwidths(float width, float height, float pixelheight);
+float updateConwidths(float width, float height, float pixelheight);
#endif
#ifdef IMPLEMENTATION
/* private static */ float XonoticResolutionSlider_DataHasChanged;
// Updates cvars (to be called by menu.qc at startup or on detected res change)
-void updateConwidths(float width, float height, float pixelheight)
+float updateConwidths(float width, float height, float pixelheight)
{
vector r, c;
float minfactor, maxfactor;
float sz, f;
+ sz = cvar("menu_vid_scale");
+ if (sz < -1)
+ return 0; // No recalculation.
+
// Save off current settings.
cvar_set("_menu_vid_width", ftos(width));
cvar_set("_menu_vid_height", ftos(height));
r_x = width;
r_y = height;
r_z = pixelheight;
- sz = cvar("menu_vid_scale");
// calculate the base resolution
c_z = 0;
c_x = rint(c_x);
c_y = rint(c_y);
+ // Please reload resolutions list and such stuff.
+ XonoticResolutionSlider_DataHasChanged = TRUE;
+
if (c_x != cvar("vid_conwidth") || c_y != cvar("vid_conheight"))
{
cvar_set("vid_conwidth", ftos(c_x));
cvar_set("vid_conheight", ftos(c_y));
- localcmd("\nr_restart\n");
+ return 1;
}
-
- XonoticResolutionSlider_DataHasChanged = TRUE;
+ return 0;
}
entity makeXonoticResolutionSlider()
{