void XonoticServerList_draw(entity me)
{
- int i;
- bool found = false, owned;
-
if(_Nex_ExtResponseSystem_BannedServersNeedsRefresh)
{
if(!me.needsRefresh)
me.refreshServerList(me, REFRESHSERVERLIST_RESORT);
}
- owned = ((me.selectedServer == me.ipAddressBox.text) && (me.ipAddressBox.text != ""));
+ bool owned = ((me.selectedServer == me.ipAddressBox.text) && (me.ipAddressBox.text != ""));
- for(i = 0; i < category_draw_count; ++i) { category_name[i] = -1; category_item[i] = -1; }
+ for(int i = 0; i < category_draw_count; ++i) { category_name[i] = -1; category_item[i] = -1; }
category_draw_count = 0;
if(autocvar_menu_slist_categories >= 0) // if less than 0, don't even draw a category heading for favorites
me.infoButton.disabled = (me.lockedSelectedItem || me.nItems == 0 || !owned);
me.favoriteButton.disabled = (me.lockedSelectedItem || (me.nItems == 0 && me.ipAddressBox.text == ""));
+ bool found = false;
if(me.lockedSelectedItem)
{
if(me.nItems > 0)
}
else if(me.selectedServer)
{
- for(i = 0; i < me.nItems; ++i)
+ for(int i = 0; i < me.nItems; ++i)
{
if(gethostcachestring(SLIST_FIELD_CNAME, i) == me.selectedServer)
{
int XonoticServerList_getItemAtPos(entity me, float pos)
{
pos = pos / me.itemHeight;
- int i;
- for (i = category_draw_count - 1; i >= 0; --i) {
+ for (int i = category_draw_count - 1; i >= 0; --i) {
int itemidx = category_item[i];
float itempos = i * me.categoriesHeight + category_item[i];
if (pos >= itempos + me.categoriesHeight + 1)
}
float XonoticServerList_getItemStart(entity me, int item)
{
- int i;
- for (i = category_draw_count - 1; i >= 0; --i) {
+ for (int i = category_draw_count - 1; i >= 0; --i) {
int itemidx = category_item[i];
float itempos = i * me.categoriesHeight + category_item[i];
if (item >= itemidx + 1)
}
float XonoticServerList_getItemHeight(entity me, int item)
{
- int i;
- for (i = 0; i < category_draw_count; ++i) {
+ for (int i = 0; i < category_draw_count; ++i) {
// Matches exactly the headings with increased height.
if (item == category_item[i])
return me.itemHeight * (me.categoriesHeight + 1);