#ifndef IMPLEMENTATION
float autocvar_menu_slist_categories;
-float autocvar_menu_slist_categories_onlyifmultiple;
+float autocvar_menu_slist_categories_onlyifmultiple;
float autocvar_menu_slist_purethreshold;
float autocvar_menu_slist_modimpurity;
float autocvar_menu_slist_recommendations;
float autocvar_menu_slist_recommendations_maxping;
-float autocvar_menu_slist_recommendations_minfreeslots;
+float autocvar_menu_slist_recommendations_minfreeslots;
float autocvar_menu_slist_recommendations_minhumans;
-float autocvar_menu_slist_recommendations_purethreshold;
+float autocvar_menu_slist_recommendations_purethreshold;
// server cache fields
#define SLIST_FIELDS \
entity RetrieveCategoryEnt(float catnum);
float CheckCategoryOverride(float cat);
-float CheckCategoryForEntry(float entry);
+float CheckCategoryForEntry(float entry);
float m_gethostcachecategory(float entry) { return CheckCategoryOverride(CheckCategoryForEntry(entry)); }
void RegisterSLCategories();
entity catent = RetrieveCategoryEnt(cat);
if(catent)
{
- float override = (autocvar_menu_slist_categories ? catent.cat_enoverride : catent.cat_dioverride);
+ float override = (autocvar_menu_slist_categories ? catent.cat_enoverride : catent.cat_dioverride);
if(override) { return override; }
else { return cat; }
}
if(autocvar_menu_slist_recommendations)
{
string cname = gethostcachestring(SLIST_FIELD_CNAME, entry);
-
+
if(IsPromoted(cname)) { return CAT_RECOMMENDED; }
else
{
if(
///// check for minimum free slots
(freeslots >= autocvar_menu_slist_recommendations_minfreeslots)
-
+
&& // check for purity requirement
(
(autocvar_menu_slist_recommendations_purethreshold < 0)
||
(impure <= autocvar_menu_slist_recommendations_purethreshold)
)
-
+
&& // check for minimum amount of humans
(
gethostcachenumber(SLIST_FIELD_NUMHUMANS, entry)
>=
autocvar_menu_slist_recommendations_minhumans
)
-
+
&& // check for maximum latency
(
gethostcachenumber(SLIST_FIELD_PING, entry)
{
// old servers which don't report their mod name are considered modified now
case "": { return CAT_MODIFIED; }
-
+
case "xpm": { return CAT_XPM; }
case "minstagib":
case "instagib": { return CAT_INSTAGIB; }
//case "newtoys": { return CAT_NEWTOYS; }
// "cts" is allowed as compat, xdf is replacement
- case "cts":
+ case "cts":
case "xdf": { return CAT_DEFRAG; }
-
+
default: { dprintf("Found strange mod type: %s\n", modtype); return CAT_MODIFIED; }
}
}
if(me.currentSortOrder < 0) { listflags |= SLSF_DESCENDING; }
sethostcachesort(me.currentSortField, listflags);
}
-
+
resorthostcache();
if(mode >= REFRESHSERVERLIST_ASK)
refreshhostcache(mode >= REFRESHSERVERLIST_RESET);
{
float itemcount = gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT);
me.nItems = itemcount;
-
+
//float visible = floor(me.scrollPos / me.itemHeight);
// ^ unfortunately no such optimization can be made-- we must process through the
// entire list, otherwise there is no way to know which item is first in its category.
me.selectedServer = strzone(gethostcachestring(SLIST_FIELD_CNAME, me.selectedItem));
}
}
-
+
if(owned)
{
if(me.selectedServer != me.ipAddressBox.text)
SET_YRANGE(me.categoriesHeight / (me.categoriesHeight + 1), 1);
}
}
-
+
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
}
iconPos.x += iconSize.x;
-
+
// --------------
// RENDER TEXT
// --------------
-
+
// ping
s = ftos(p);
draw_Text(me.realUpperMargin * eY + (me.columnPingOrigin + me.columnPingSize - draw_TextWidth(s, 0, me.realFontSize)) * eX, s, me.realFontSize, theColor, theAlpha, 0);