for(int i = 0; i < category_draw_count; ++i) { category_name[i] = -1; category_item[i] = -1; }
category_draw_count = 0;
+ me.nItems = gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT);
+
if(autocvar_menu_slist_categories >= 0) // if less than 0, don't even draw a category heading for favorites
{
- float itemcount = gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT);
- me.nItems = itemcount;
+ int itemcount = me.nItems;
//float visible = floor(me.scrollPos / me.itemHeight);
// ^ unfortunately no such optimization can be made-- we must process through the
me.nItems = itemcount;
}
}
- else { me.nItems = gethostcachevalue(SLIST_HOSTCACHEVIEWCOUNT); }
me.connectButton.disabled = (me.ipAddressBox.text == "");
//me.disconnectButton.disabled = (!(gamestatus & (GAME_ISSERVER | GAME_CONNECTED)));
if (me.nItems != 0)
main.serverInfoDialog.loadServerInfo(main.serverInfoDialog, me.selectedItem);
- float thisPos = me.getItemStart(me, me.selectedItem);
- float thisHeight = me.getItemHeight(me, me.selectedItem);
+ float thisPos = me.getItemStart(me, me.selectedItem);
+ float thisHeight = me.getItemHeight(me, me.selectedItem);
vector org = boxToGlobal(eY * (thisPos - me.scrollPos), me.origin, me.size);
vector sz = boxToGlobalSize(eY * thisHeight + eX * (1 - me.controlWidth), me.size);
DialogOpenButton_Click_withCoords(me, main.serverInfoDialog, org, sz);
pos = pos / me.itemHeight;
for (int i = category_draw_count - 1; i >= 0; --i) {
int itemidx = category_item[i];
- float itempos = i * me.categoriesHeight + category_item[i] * me.serversHeight;
+ float itempos = i * me.categoriesHeight + itemidx * me.serversHeight;
if (pos >= itempos + me.categoriesHeight + me.serversHeight)
return itemidx + 1 + floor((pos - (itempos + me.categoriesHeight + me.serversHeight)) / me.serversHeight);
if (pos >= itempos)
{
for (int i = category_draw_count - 1; i >= 0; --i) {
int itemidx = category_item[i];
- float itempos = i * me.categoriesHeight + category_item[i] * me.serversHeight;
+ float itempos = i * me.categoriesHeight + itemidx * me.serversHeight;
if (item >= itemidx + 1)
return (itempos + me.categoriesHeight + (1 + item - (itemidx + 1)) * me.serversHeight) * me.itemHeight;
if (item >= itemidx)