]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/xonotic/skinlist.qc
Listbox: highlight item under the cursor
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / xonotic / skinlist.qc
index 9990c83fe162ee2c2ab4f37ea7e1c43a1fcf24ce..174e64f48ad6f8bd86a8bbb8e70623e9ba792367 100644 (file)
@@ -3,7 +3,7 @@ CLASS(XonoticSkinList) EXTENDS(XonoticListBox)
        METHOD(XonoticSkinList, configureXonoticSkinList, void(entity))
        ATTRIB(XonoticSkinList, rowsPerItem, float, 4)
        METHOD(XonoticSkinList, resizeNotify, void(entity, vector, vector, vector, vector))
-       METHOD(XonoticSkinList, drawListBoxItem, void(entity, float, vector, float))
+       METHOD(XonoticSkinList, drawListBoxItem, void(entity, int, vector, bool, float))
        METHOD(XonoticSkinList, getSkins, void(entity))
        METHOD(XonoticSkinList, setSkin, void(entity))
        METHOD(XonoticSkinList, loadCvars, void(entity))
@@ -149,12 +149,14 @@ void XonoticSkinList_resizeNotify(entity me, vector relOrigin, vector relSize, v
        me.columnNameSize = 1 - me.columnPreviewSize - 2 * me.realFontSize.x;
 }
 
-void XonoticSkinList_drawListBoxItem(entity me, float i, vector absSize, float isSelected)
+void XonoticSkinList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, float highlightedTime)
 {
        string s;
 
        if(isSelected)
                draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
+       else if(highlightedTime)
+               draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, getHighlightAlpha(SKINALPHA_LISTBOX_SELECTED * 0.1, highlightedTime));
 
        s = me.skinParameter(me, i, SKINPARM_PREVIEW);
        draw_Picture(me.columnPreviewOrigin * eX, s, me.columnPreviewSize * eX + eY, '1 1 1', 1);