]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/serverlist.qc
Add a checkbox to filter high latency servers (enabled by default with a ping limit...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / serverlist.qc
index 578e1eca6f35c9deb4900a49caec0f01dba2ad20..b0f561d91efced1358ca4efc8a9155b70c484df9 100644 (file)
@@ -341,6 +341,10 @@ void XonoticServerList_refreshServerList(entity me, int mode)
                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);
@@ -679,6 +683,15 @@ void ServerList_ShowFull_Click(entity box, entity me)
        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)