X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fmenu%2Fxonotic%2Fsoundlist.qc;h=159cd76c53d60a2bfe8c3b3c73c9fea6a74b9679;hb=21307f327df5609b82d90496c1c6156d636d1c8d;hp=e443a53efb42ddcab91cd3d1df8804df0d8b0777;hpb=bb80a6aba067167c6ef8d5f3465f03bd34142fa2;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/menu/xonotic/soundlist.qc b/qcsrc/menu/xonotic/soundlist.qc index e443a53ef..159cd76c5 100644 --- a/qcsrc/menu/xonotic/soundlist.qc +++ b/qcsrc/menu/xonotic/soundlist.qc @@ -1,15 +1,17 @@ -#ifdef INTERFACE -CLASS(XonoticSoundList) EXTENDS(XonoticListBox) - METHOD(XonoticSoundList, configureXonoticSoundList, void(entity)) +#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, getSounds, void(entity)) - METHOD(XonoticSoundList, soundName, string(entity, float)) - METHOD(XonoticSoundList, doubleClickListBoxItem, void(entity, float, vector)) - METHOD(XonoticSoundList, keyDown, float(entity, float, float, float)) - METHOD(XonoticSoundList, destroy, void(entity)) - METHOD(XonoticSoundList, showNotify, void(entity)) + METHOD(XonoticSoundList, resizeNotify, void(entity, vector, vector, vector, vector)); + 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)); + METHOD(XonoticSoundList, keyDown, float(entity, float, float, float)); + METHOD(XonoticSoundList, destroy, void(entity)); + METHOD(XonoticSoundList, showNotify, void(entity)); ATTRIB(XonoticSoundList, listSound, float, -1) ATTRIB(XonoticSoundList, realFontSize, vector, '0 0 0') @@ -22,7 +24,7 @@ CLASS(XonoticSoundList) EXTENDS(XonoticListBox) ATTRIB(XonoticSoundList, itemAbsSize, vector, '0 0 0') ATTRIB(XonoticSoundList, filterString, string, string_null) - ATTRIB(XonoticSoundList, playlist, entity, world) + ATTRIB(XonoticSoundList, playlist, entity, NULL) ENDCLASS(XonoticSoundList) entity makeXonoticSoundList(); @@ -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