]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/serverlist.c
Merge remote-tracking branch 'origin/master' into samual/splashing
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / serverlist.c
index 417806c3f23bdbd71944402450cee2280dfd1573..0c7fe148be6ea7b0eed1c01ec353c6d59ffbd282 100644 (file)
@@ -49,7 +49,6 @@ CLASS(XonoticServerList) EXTENDS(XonoticListBox)
        ATTRIB(XonoticServerList, infoButton, entity, NULL)
        ATTRIB(XonoticServerList, currentSortOrder, float, 0)
        ATTRIB(XonoticServerList, currentSortField, float, -1)
-       ATTRIB(XonoticServerList, lastBumpSelectTime, float, 0)
        ATTRIB(XonoticServerList, lastClickedServer, float, -1)
        ATTRIB(XonoticServerList, lastClickedTime, float, 0)
 
@@ -147,7 +146,7 @@ float category_draw_count;
 
 #define SLIST_CATEGORIES \
        SLIST_CATEGORY(CAT_FAVORITED,    "",            "",             ZCTX(_("SLCAT^Favorites"))) \
-       SLIST_CATEGORY(CAT_RECOMMENDED,  "",            "CAT_SERVERS",  ZCTX(_("SLCAT^Recommended"))) \
+       SLIST_CATEGORY(CAT_RECOMMENDED,  "",            "",             ZCTX(_("SLCAT^Recommended"))) \
        SLIST_CATEGORY(CAT_NORMAL,       "",            "CAT_SERVERS",  ZCTX(_("SLCAT^Normal Servers"))) \
        SLIST_CATEGORY(CAT_SERVERS,      "CAT_NORMAL",  "CAT_SERVERS",  ZCTX(_("SLCAT^Servers"))) \
        SLIST_CATEGORY(CAT_XPM,          "CAT_NORMAL",  "CAT_SERVERS",  ZCTX(_("SLCAT^Competitive Mode"))) \
@@ -206,11 +205,11 @@ void RegisterSLCategories()
                                } \
                                else \
                                { \
-                                       print(sprintf( \
+                                       printf( \
                                                "RegisterSLCategories(): Improper override '%s' for category '%s'!\n", \
                                                s, \
                                                categories[i].cat_name \
-                                       )); \
+                                       ); \
                                } \
                        } \
                        strunzone(categories[i].override_string); \
@@ -372,7 +371,7 @@ float CheckCategoryForEntry(float entry)
                        case "cts": 
                        case "xdf": { return CAT_DEFRAG; }
                        
-                       default: { dprint(sprintf("Found strange mod type: %s\n", modtype)); return CAT_MODIFIED; }
+                       default: { dprintf("Found strange mod type: %s\n", modtype); return CAT_MODIFIED; }
                }
        }
 
@@ -415,7 +414,7 @@ void XonoticServerList_toggleFavorite(entity me, string srv)
                f = 1;
                --i;
        }
-       
+
        if(!f)
        {
                s1 = "";
@@ -980,7 +979,7 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
        float m, pure, freeslots, j, sflags;
        string s, typestr, versionstr, k, v, modname;
 
-       //print(sprintf("time: %f, i: %d, item: %d, nitems: %d\n", time, i, item, me.nItems));
+       //printf("time: %f, i: %d, item: %d, nitems: %d\n", time, i, item, me.nItems);
 
        vector oldscale = draw_scale;
        vector oldshift = draw_shift;
@@ -1078,7 +1077,7 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
                theAlpha = SKINALPHA_SERVERLIST_FULL;
        else if(freeslots == 0)
                theAlpha = SKINALPHA_SERVERLIST_FULL; // g_maxplayers support
-       else if not(gethostcachenumber(SLIST_FIELD_NUMHUMANS, i))
+       else if (!gethostcachenumber(SLIST_FIELD_NUMHUMANS, i))
                theAlpha = SKINALPHA_SERVERLIST_EMPTY;
        else
                theAlpha = 1;
@@ -1164,7 +1163,7 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
 
        string n;
 
-       if not(me.seenIPv4 && me.seenIPv6)
+       if (!(me.seenIPv4 && me.seenIPv6))
        {
                iconPos_x += iconSize_x * 0.5;
        }
@@ -1241,14 +1240,11 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
 
 float XonoticServerList_keyDown(entity me, float scan, float ascii, float shift)
 {
-       float i = me.selectedItem;
        vector org, sz;
 
        org = boxToGlobal(eY * (me.selectedItem * me.itemHeight - me.scrollPos), me.origin, me.size);
        sz = boxToGlobalSize(eY * me.itemHeight + eX * (1 - me.controlWidth), me.size);
 
-       me.lastBumpSelectTime = 0;
-
        if(scan == K_ENTER || scan == K_KP_ENTER)
        {
                ServerList_Connect_Click(NULL, me);
@@ -1258,7 +1254,7 @@ float XonoticServerList_keyDown(entity me, float scan, float ascii, float shift)
        {
                if(me.nItems != 0)
                {
-                       main.serverInfoDialog.loadServerInfo(main.serverInfoDialog, i);
+                       main.serverInfoDialog.loadServerInfo(main.serverInfoDialog, me.selectedItem);
                        DialogOpenButton_Click_withCoords(me, main.serverInfoDialog, org, sz);
                        return 1;
                }