*/
if(me.nItems == 0)
return;
- if(gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT) != me.nItems)
- return; // sorry, it would be wrong
+ //if(gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT) != me.nItems)
+ // return; // sorry, it would be wrong
if(me.selectedServer)
strunzone(me.selectedServer);
me.nextRefreshTime = time + 10;
me.refreshServerList(me, 1);
}
+float category_drawn;
void XonoticServerList_draw(entity me)
{
float i, found, owned;
owned = ((me.selectedServer == me.ipAddressBox.text) && (me.ipAddressBox.text != ""));
- me.nItems = gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT);
+ me.nItems = gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT) + 1;
me.connectButton.disabled = ((me.nItems == 0) && (me.ipAddressBox.text == ""));
me.infoButton.disabled = ((me.nItems == 0) || !owned);
me.ipAddressBoxFocused = me.ipAddressBox.focused;
}
+ category_drawn = 0;
SUPER(XonoticServerList).draw(me);
}
void ServerList_PingSort_Click(entity btn, entity me)
me.lastClickedServer = i;
me.lastClickedTime = time;
}
+float category_drawn;
void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float isSelected)
{
// layout: Ping, Server name, Map name, NP, TP, MP
float m, pure, freeslots, j, sflags;
string s, typestr, versionstr, k, v, modname;
+ print(sprintf("time: %f, category_drawn: %d, i: %d\n", time, category_drawn, i));
+ if(category_drawn) { i -= 1; }
+ else
+ {
+ draw_Text(me.realUpperMargin * eY + (me.columnNameOrigin + (me.columnNameSize - draw_TextWidth("category", 0, me.realFontSize)) * 0.5) * eX, "category", me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0);
+ category_drawn = TRUE;
+ return;
+ }
if(isSelected)
draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);