X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fdemolist.qc;h=f46ee407b6c82ecc8fa272df54e6eb7df379645c;hb=7ecebcaed42364cf2c048c484ef4c7c173f62748;hp=170a4bba67211d3f0abe0438168edea6212de7aa;hpb=244f8292cf03247e90bf1a0c3fee1f491f6b93a0;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/demolist.qc b/qcsrc/menu/xonotic/demolist.qc index 170a4bba6..f46ee407b 100644 --- a/qcsrc/menu/xonotic/demolist.qc +++ b/qcsrc/menu/xonotic/demolist.qc @@ -1,9 +1,11 @@ -#ifdef INTERFACE +#ifndef DEMOLIST_H +#define DEMOLIST_H +#include "listbox.qc" CLASS(XonoticDemoList, XonoticListBox) 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, drawListBoxItem, void(entity, int, vector, bool, bool)) METHOD(XonoticDemoList, getDemos, void(entity)) METHOD(XonoticDemoList, startDemo, void(entity)) METHOD(XonoticDemoList, timeDemo, void(entity)) @@ -133,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);