X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fsoundlist.qc;h=2b98c5fe52296a8f287c4294a3766019487262ea;hp=e443a53efb42ddcab91cd3d1df8804df0d8b0777;hb=b2fa86504c5f79fb70897d94a4a3c88333f96407;hpb=d1ec6cd7b36e2c16817720fe5cce775fc3d26357 diff --git a/qcsrc/menu/xonotic/soundlist.qc b/qcsrc/menu/xonotic/soundlist.qc index e443a53ef..2b98c5fe5 100644 --- a/qcsrc/menu/xonotic/soundlist.qc +++ b/qcsrc/menu/xonotic/soundlist.qc @@ -1,9 +1,11 @@ -#ifdef INTERFACE -CLASS(XonoticSoundList) EXTENDS(XonoticListBox) +#ifndef SOUNDLIST_H +#define SOUNDLIST_H +#include "listbox.qc" +CLASS(XonoticSoundList, XonoticListBox) METHOD(XonoticSoundList, configureXonoticSoundList, void(entity)) ATTRIB(XonoticSoundList, rowsPerItem, float, 1) METHOD(XonoticSoundList, resizeNotify, void(entity, vector, vector, vector, vector)) - METHOD(XonoticSoundList, drawListBoxItem, void(entity, float, vector, float)) + METHOD(XonoticSoundList, drawListBoxItem, void(entity, int, vector, bool, bool)) METHOD(XonoticSoundList, getSounds, void(entity)) METHOD(XonoticSoundList, soundName, string(entity, float)) METHOD(XonoticSoundList, doubleClickListBoxItem, void(entity, float, vector)) @@ -38,7 +40,7 @@ void SoundList_Menu_Track_Reset(entity box, entity me); entity makeXonoticSoundList() { entity me; - me = spawnXonoticSoundList(); + me = NEW(XonoticSoundList); me.configureXonoticSoundList(me); return me; } @@ -101,11 +103,16 @@ void XonoticSoundList_resizeNotify(entity me, vector relOrigin, vector relSize, me.columnNameSize = 1 - me.columnNameOrigin - me.realFontSize.x; } -void XonoticSoundList_drawListBoxItem(entity me, float i, vector absSize, float isSelected) +void XonoticSoundList_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.soundName(me,i); if(s == cvar_string("menu_cdtrack")) // current menu track