]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/playerlist.qc
Merge branch 'master' into martin-t/defaults
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / playerlist.qc
index 72fe69e116ee4402a875bb6abf47fb5fae470877..c6033050ae6f45d9157b042039788773b67afa72 100644 (file)
@@ -1,28 +1,6 @@
-#ifndef PLAYERLIST_H
-#define PLAYERLIST_H
-#include "listbox.qc"
-CLASS(XonoticPlayerList, XonoticListBox)
-       ATTRIB(XonoticPlayerList, rowsPerItem, float, 1)
-       METHOD(XonoticPlayerList, resizeNotify, void(entity, vector, vector, vector, vector))
-       METHOD(XonoticPlayerList, drawListBoxItem, void(entity, int, vector, bool, bool))
-       ATTRIB(XonoticPlayerList, allowFocusSound, float, 0)
-       ATTRIB(XonoticPlayerList, realFontSize, vector, '0 0 0')
-       ATTRIB(XonoticPlayerList, columnNameOrigin, float, 0)
-       ATTRIB(XonoticPlayerList, columnNameSize, float, 0)
-       ATTRIB(XonoticPlayerList, columnScoreOrigin, float, 0)
-       ATTRIB(XonoticPlayerList, columnScoreSize, float, 0)
-       ATTRIB(XonoticPlayerList, realUpperMargin, float, 0)
-       ATTRIB(XonoticPlayerList, origin, vector, '0 0 0')
-       ATTRIB(XonoticPlayerList, itemAbsSize, vector, '0 0 0')
-       METHOD(XonoticPlayerList, setPlayerList, void(entity, string))
-       METHOD(XonoticPlayerList, getPlayerList, string(entity, float, float))
-       ATTRIB(XonoticPlayerList, playerList, float, -1)
-       ATTRIB(XonoticPlayerList, selectionDoesntMatter, bool, true)
-ENDCLASS(XonoticPlayerList)
-entity makeXonoticPlayerList();
-#endif
-
-#ifdef IMPLEMENTATION
+#include "playerlist.qh"
+
+.float realUpperMargin2;
 
 const float PLAYERPARM_SCORE = 0;
 const float PLAYERPARM_PING = 1;
@@ -128,7 +106,7 @@ void XonoticPlayerList_drawListBoxItem(entity me, int i, vector absSize, bool is
                if((t = strstrofs(score, ",", 0)) >= 0)
                        score = substring(score, 0, t);
 
-               if(stof(score) == -666)
+               if(stof(score) == FRAGS_SPECTATOR)
                        score = _("spectator");
        }
 
@@ -138,5 +116,3 @@ void XonoticPlayerList_drawListBoxItem(entity me, int i, vector absSize, bool is
        score = draw_TextShortenToWidth(score, me.columnScoreSize, 0, me.realFontSize);
        draw_Text(me.realUpperMargin2 * eY + (me.columnScoreOrigin + 1.00 * (me.columnScoreSize - draw_TextWidth(score, 1, me.realFontSize))) * eX, score, me.realFontSize, rgb, 1, 0);
 }
-
-#endif