void ServerList_Favorite_Click(entity btn, entity me);
void ServerList_Info_Click(entity btn, entity me);
void ServerList_Update_favoriteButton(entity btn, entity me);
-#endif
-#ifdef IMPLEMENTATION
float SLIST_FIELD_CNAME;
float SLIST_FIELD_PING;
float SLIST_FIELD_GAME;
float SLIST_FIELD_PLAYERS;
float SLIST_FIELD_QCSTATUS;
float SLIST_FIELD_ISFAVORITE;
+#endif
+
+#ifdef IMPLEMENTATION
void ServerList_UpdateFieldIDs()
{
SLIST_FIELD_CNAME = gethostcacheindexforkey( "cname" );
else
s = "";
- for(i = 1; ; ++i) // 20 modes ought to be enough for anyone
+ for(i = 1; ; i *= 2) // 20 modes ought to be enough for anyone
{
- t = GametypeNameFromType(i);
+ t = MapInfo_Type_ToString(i);
if(i > 1)
- if(t == GametypeNameFromType(0)) // it repeats (default case)
+ if(t == "") // it repeats (default case)
{
// no type was found
// choose the first one
- s = t;
+ s = MapInfo_Type_ToString(1);
break;
}
- if(s == GametypeNameFromType(i))
+ if(s == t)
{
// the type was found
// choose the next one
- s = GametypeNameFromType(i + 1);
- if(s == GametypeNameFromType(0))
- s = "";
+ s = MapInfo_Type_ToString(i * 2);
+ if(s == "")
+ s = MapInfo_Type_ToString(1);
break;
}
}
vector theColor;
float theAlpha;
float m, pure, freeslots, j, sflags;
- string s, typestr, versionstr, k, v;
+ string s, typestr, versionstr, k, v, modname;
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
}
freeslots = -1;
sflags = -1;
+ modname = "";
for(j = 2; j < m; ++j)
{
if(argv(j) == "")
freeslots = stof(v);
else if(k == "F")
sflags = stof(v);
+ else if(k == "M")
+ modname = v;
}
+#ifdef COMPAT_NO_MOD_IS_XONOTIC
+ if(modname == "")
+ modname = "Xonotic";
+#endif
+
+ SLIST_FIELD_MOD = gethostcacheindexforkey("mod");
+ s = gethostcachestring(SLIST_FIELD_MOD, i);
+ if(s != "data")
+ if(modname == "Xonotic")
+ modname = s;
+
+ // list the mods here on which the pure server check actually works
+ if(modname != "Xonotic")
+ if(modname != "MinstaGib")
+ if(modname != "CTS")
+ pure = 0;
+
if(gethostcachenumber(SLIST_FIELD_FREESLOTS, i) <= 0)
theAlpha = SKINALPHA_SERVERLIST_FULL;
else if(freeslots == 0)
draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_aeslevel", ftos(q)), iconSize, '1 1 1', 1);
iconPos_x += iconSize_x;
- if(pure == 0)
- draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_pure1"), iconSize, '1 1 1', 1);
+ if(modname == "Xonotic")
+ {
+ if(pure == 0)
+ draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_pure1"), iconSize, '1 1 1', 1);
+ }
+ else
+ {
+ string n;
+ n = strcat(SKINGFX_SERVERLIST_ICON, "_mod_", modname);
+ if(draw_PictureSize(n) == '0 0 0')
+ n = strcat(SKINGFX_SERVERLIST_ICON, "_mod_");
+ if(pure == 0)
+ draw_Picture(iconPos, n, iconSize, '1 1 1', 1);
+ else
+ draw_Picture(iconPos, n, iconSize, '1 1 1', SKINALPHA_SERVERLIST_ICON_NONPURE);
+ }
iconPos_x += iconSize_x;
if(sflags >= 0 && (sflags & SERVERFLAG_PLAYERSTATS))