]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/playerlist.qc
Improve scrolling in the players list too (server info dialog)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / playerlist.qc
index 1facda299b3ddaa58ea288723f7c0f25bebf39a4..72fe69e116ee4402a875bb6abf47fb5fae470877 100644 (file)
@@ -1,8 +1,11 @@
-#ifdef INTERFACE
-CLASS(XonoticPlayerList) EXTENDS(XonoticListBox)
+#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, float, vector, float))
+       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)
@@ -14,6 +17,7 @@ CLASS(XonoticPlayerList) EXTENDS(XonoticListBox)
        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
@@ -29,14 +33,14 @@ const float PLAYERPARM_COUNT = 4;
 entity makeXonoticPlayerList()
 {
        entity me;
-       me = spawnXonoticPlayerList();
+       me = NEW(XonoticPlayerList);
        me.configureXonoticListBox(me);
        return me;
 }
 
 void XonoticPlayerList_setPlayerList(entity me, string plist)
 {
-       float buf,i,n;
+       int buf,i,n;
        string s;
 
        buf = buf_create();
@@ -91,7 +95,7 @@ void XonoticPlayerList_resizeNotify(entity me, vector relOrigin, vector relSize,
        me.columnScoreOrigin = me.columnNameOrigin + me.columnNameSize + me.realFontSize.x;
 }
 
-void XonoticPlayerList_drawListBoxItem(entity me, float i, vector absSize, float isSelected)
+void XonoticPlayerList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused)
 {
        string s;
        string score;