]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/demolist.qc
Don't play any animation when loading the initial value of a slider since the animati...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / demolist.qc
index 4f759f68ad7e6e58bd70e60c5d003014052e5dfd..2459d7ca1e9b932f04f909f1307c4954b763c982 100644 (file)
@@ -2,18 +2,18 @@
 #define DEMOLIST_H
 #include "listbox.qc"
 CLASS(XonoticDemoList, XonoticListBox)
-       METHOD(XonoticDemoList, configureXonoticDemoList, void(entity))
+       METHOD(XonoticDemoList, configureXonoticDemoList, void(entity));
        ATTRIB(XonoticDemoList, rowsPerItem, float, 1)
-       METHOD(XonoticDemoList, resizeNotify, void(entity, vector, vector, vector, vector))
-       METHOD(XonoticDemoList, drawListBoxItem, void(entity, float, vector, float))
-       METHOD(XonoticDemoList, getDemos, void(entity))
-       METHOD(XonoticDemoList, startDemo, void(entity))
-       METHOD(XonoticDemoList, timeDemo, void(entity))
-       METHOD(XonoticDemoList, demoName, string(entity, float))
-       METHOD(XonoticDemoList, doubleClickListBoxItem, void(entity, float, vector))
-       METHOD(XonoticDemoList, keyDown, float(entity, float, float, float))
-       METHOD(XonoticDemoList, destroy, void(entity))
-       METHOD(XonoticDemoList, showNotify, void(entity))
+       METHOD(XonoticDemoList, resizeNotify, void(entity, vector, vector, vector, vector));
+       METHOD(XonoticDemoList, drawListBoxItem, void(entity, int, vector, bool, bool));
+       METHOD(XonoticDemoList, getDemos, void(entity));
+       METHOD(XonoticDemoList, startDemo, void(entity));
+       METHOD(XonoticDemoList, timeDemo, void(entity));
+       METHOD(XonoticDemoList, demoName, string(entity, float));
+       METHOD(XonoticDemoList, doubleClickListBoxItem, void(entity, float, vector));
+       METHOD(XonoticDemoList, keyDown, float(entity, float, float, float));
+       METHOD(XonoticDemoList, destroy, void(entity));
+       METHOD(XonoticDemoList, showNotify, void(entity));
 
        ATTRIB(XonoticDemoList, listDemo, float, -1)
        ATTRIB(XonoticDemoList, realFontSize, vector, '0 0 0')
@@ -135,11 +135,16 @@ void XonoticDemoList_resizeNotify(entity me, vector relOrigin, vector relSize, v
        me.columnNameSize = 1 - 2 * me.realFontSize.x;
 }
 
-void XonoticDemoList_drawListBoxItem(entity me, float i, vector absSize, float isSelected)
+void XonoticDemoList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused)
 {
        string s;
        if(isSelected)
                draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
+       else if(isFocused)
+       {
+               me.focusedItemAlpha = getFadedAlpha(me.focusedItemAlpha, SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED);
+               draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_FOCUSED, me.focusedItemAlpha);
+       }
 
        s = me.demoName(me,i);
        s = draw_TextShortenToWidth(s, me.columnNameSize, 0, me.realFontSize);