X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fserverlist.c;h=f1d45ab5b08f88c0b0a23c5fd7fb52407ce8ac9a;hb=2f7b0095fa29fa4c49e0e6b88e6e7b432cfb6a31;hp=82fdbfb5eb40d4bcfcefb45cd47c383a5421710c;hpb=24f6d013a268851d6584e3f76ac0c0308f737b6f;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/serverlist.c b/qcsrc/menu/xonotic/serverlist.c index 82fdbfb5e..f1d45ab5b 100644 --- a/qcsrc/menu/xonotic/serverlist.c +++ b/qcsrc/menu/xonotic/serverlist.c @@ -64,9 +64,7 @@ void ServerList_Filter_Change(entity box, entity me); 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; @@ -82,6 +80,9 @@ float SLIST_FIELD_FREESLOTS; float SLIST_FIELD_PLAYERS; float SLIST_FIELD_QCSTATUS; float SLIST_FIELD_ISFAVORITE; +#endif + +#ifdef IMPLEMENTATION void ServerList_UpdateFieldIDs() { SLIST_FIELD_CNAME = gethostcacheindexforkey( "cname" ); @@ -600,7 +601,7 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float 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); @@ -614,6 +615,7 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float } freeslots = -1; sflags = -1; + modname = ""; for(j = 2; j < m; ++j) { if(argv(j) == "") @@ -626,8 +628,31 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float 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") + if(modname != "NIX") + if(modname != "NewToys") + pure = 0; + if(gethostcachenumber(SLIST_FIELD_FREESLOTS, i) <= 0) theAlpha = SKINALPHA_SERVERLIST_FULL; else if(freeslots == 0) @@ -714,29 +739,56 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float iconPos_x = (me.columnIconsSize - 3 * iconSize_x) * 0.5; iconPos_y = (1 - iconSize_y) * 0.5; + string n; + if not(me.seenIPv4 && me.seenIPv6) { iconPos_x += iconSize_x * 0.5; } else if(me.seenIPv4 && me.seenIPv6) { + n = string_null; if(isv6) - draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_ipv6"), iconSize, '1 1 1', 1); + draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_ipv6"), 0); // PRECACHE_PIC_MIPMAP else if(isv4) - draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_ipv4"), iconSize, '1 1 1', 1); + draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_ipv4"), 0); // PRECACHE_PIC_MIPMAP + if(n) + draw_Picture(iconPos, n, iconSize, '1 1 1', 1); iconPos_x += iconSize_x; } if(q > 0) - draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_aeslevel", ftos(q)), iconSize, '1 1 1', 1); + { + draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_aeslevel", ftos(q)), 0); // PRECACHE_PIC_MIPMAP + draw_Picture(iconPos, n, 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_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_pure1"), PRECACHE_PIC_MIPMAP); + draw_Picture(iconPos, n, iconSize, '1 1 1', 1); + } + } + else + { + draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_mod_", modname), PRECACHE_PIC_MIPMAP); + if(draw_PictureSize(n) == '0 0 0') + draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_mod_"), PRECACHE_PIC_MIPMAP); + 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)) - draw_Picture(iconPos, strcat(SKINGFX_SERVERLIST_ICON, "_stats1"), iconSize, '1 1 1', 1); + { + draw_PreloadPictureWithFlags(n = strcat(SKINGFX_SERVERLIST_ICON, "_stats1"), 0); // PRECACHE_PIC_MIPMAP + draw_Picture(iconPos, n, iconSize, '1 1 1', 1); + } iconPos_x += iconSize_x; }