slist.controlledTextbox = e;
me.gotoRC(me, 0.5, 2.6);
- me.TD(me, 1, 0.9, e = makeXonoticCheckBox(0, "menu_slist_categories", ZCTX(_("SRVS^Categories"))));
+ me.TD(me, 1, 0.75, e = makeXonoticCheckBox(0, "menu_slist_categories", ZCTX(_("SRVS^Categories"))));
e.onClickEntity = slist;
e.onClick = ServerList_Categories_Click;
me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "menu_slist_showempty", ZCTX(_("SRVS^Empty")),
slist.filterShowEmpty = e.checked;
e.onClickEntity = slist;
e.onClick = ServerList_ShowEmpty_Click;
- me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "menu_slist_showfull", ZCTX(_("SRVS^Full")),
+ me.TD(me, 1, 0.5, e = makeXonoticCheckBox_T(0, "menu_slist_showfull", ZCTX(_("SRVS^Full")),
_("Show full servers that have no slots available")));
slist.filterShowFull = e.checked;
e.onClickEntity = slist;
e.onClick = ServerList_ShowFull_Click;
+ me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "menu_slist_showlaggy", ZCTX(_("SRVS^Laggy")),
+ _("Show high latency servers")));
+ slist.filterShowLaggy = e.checked;
+ e.onClickEntity = slist;
+ e.onClick = ServerList_ShowLaggy_Click;
me.TD(me, 1, 0.6, e = makeXonoticCheckBox_T(0, "net_slist_pause", _("Pause"),
_("Pause updating the server list to prevent servers from \"jumping around\"")));
me.TD(me, 1, 1, e = makeXonoticButton_T(_("Refresh"), '0 0 0', _("Reload the server list")));
if(!me.filterShowEmpty)
sethostcachemasknumber(++m, SLIST_FIELD_NUMHUMANS, 1, SLIST_TEST_GREATEREQUAL);
+ // show laggy button
+ if(!me.filterShowLaggy && autocvar_menu_slist_maxping > 0)
+ sethostcachemasknumber(++m, SLIST_FIELD_PING, autocvar_menu_slist_maxping, SLIST_TEST_LESSEQUAL);
+
// gametype filtering
if(typestr != "")
sethostcachemaskstring(++m, SLIST_FIELD_QCSTATUS, strcat(typestr, ":"), SLIST_TEST_STARTSWITH);
me.ipAddressBox.cursorPos = 0;
me.ipAddressBoxFocused = -1;
}
+void ServerList_ShowLaggy_Click(entity box, entity me)
+{
+ box.setChecked(box, me.filterShowLaggy = !me.filterShowLaggy);
+ me.refreshServerList(me, REFRESHSERVERLIST_REFILTER);
+
+ me.ipAddressBox.setText(me.ipAddressBox, "");
+ me.ipAddressBox.cursorPos = 0;
+ me.ipAddressBoxFocused = -1;
+}
void XonoticServerList_setSortOrder(entity me, int fld, int direction)
{
if(me.currentSortField == fld)
METHOD(XonoticServerList, setSortOrder, void(entity, float, float));
ATTRIB(XonoticServerList, filterShowEmpty, float, 1);
ATTRIB(XonoticServerList, filterShowFull, float, 1);
+ ATTRIB(XonoticServerList, filterShowLaggy, float, 0);
ATTRIB(XonoticServerList, filterString, string);
ATTRIB(XonoticServerList, controlledTextbox, entity);
ATTRIB(XonoticServerList, ipAddressBox, entity);
void ServerList_Categories_Click(entity box, entity me);
void ServerList_ShowEmpty_Click(entity box, entity me);
void ServerList_ShowFull_Click(entity box, entity me);
+void ServerList_ShowLaggy_Click(entity box, entity me);
void ServerList_Connect_Click(entity btn, entity me);
void ServerList_Update_favoriteButton(entity btn, entity me);
void ServerList_Favorite_Click(entity btn, entity me);
float autocvar_menu_slist_categories_onlyifmultiple;
float autocvar_menu_slist_purethreshold;
float autocvar_menu_slist_modimpurity;
+float autocvar_menu_slist_maxping = 300;
float autocvar_menu_slist_recommendations;
float autocvar_menu_slist_recommendations_maxping;
float autocvar_menu_slist_recommendations_minfreeslots;
// for menu server list (eventually make them have engine support?)
seta menu_slist_showfull 1 "show servers even if they are full and have no slots to join"
seta menu_slist_showempty 1 "show servers even if they are no empty and have no opponents to play against"
+seta menu_slist_showlaggy 0 "show servers even if they are very high latency (see menu_slist_maxping)"
seta menu_slist_modfilter "" // set to either: !modname or modname. modname of = means "same as we are running now".
// other serverlist cvars
seta menu_slist_categories 1
seta menu_slist_categories_onlyifmultiple 1
seta menu_slist_purethreshold 0
+seta menu_slist_maxping 300
seta menu_slist_modimpurity 0
seta menu_slist_recommendations 3
seta menu_slist_recommendations_maxping 150