-#ifdef INTERFACE
-CLASS(XonoticPlayList) EXTENDS(XonoticListBox)
+#ifndef PLAYLIST_H
+#define PLAYLIST_H
+#include "listbox.qc"
+CLASS(XonoticPlayList, XonoticListBox)
METHOD(XonoticPlayList, configureXonoticPlayList, void(entity))
ATTRIB(XonoticPlayList, rowsPerItem, float, 1)
METHOD(XonoticPlayList, resizeNotify, void(entity, vector, vector, vector, vector))
METHOD(XonoticPlayList, draw, void(entity))
- METHOD(XonoticPlayList, drawListBoxItem, void(entity, float, vector, float))
+ METHOD(XonoticPlayList, drawListBoxItem, void(entity, int, vector, bool, bool))
METHOD(XonoticPlayList, stopSound, void(entity))
METHOD(XonoticPlayList, startSound, void(entity, float))
METHOD(XonoticPlayList, resumeSound, void(entity))
entity makeXonoticPlayList()
{
entity me;
- me = spawnXonoticPlayList();
+ me = NEW(XonoticPlayList);
me.configureXonoticPlayList(me);
return me;
}
void XonoticPlayList_removeSelectedFromPlayList(entity me)
{
- float i, cpt = FALSE;
+ float i, cpt = false;
string s = "";
me.nItems = tokenize_console(cvar_string("music_playlist_list0"));
if(me.nItems == 0)
if(cvar("music_playlist_index") == 0 || cvar("music_playlist_index") == 999)
{
if(cvar("music_playlist_current0") == i)
- cpt = TRUE; // current playing track (we can't start next track here because startSound calls tokenize_console)
+ cpt = true; // current playing track (we can't start next track here because startSound calls tokenize_console)
else if(cvar("music_playlist_current0") > i)
cvar_set("music_playlist_current0", ftos(cvar("music_playlist_current0") - 1));
}
SUPER(XonoticPlayList).draw(me);
}
-void XonoticPlayList_drawListBoxItem(entity me, float i, vector absSize, float isSelected)
+void XonoticPlayList_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);
+ }
if(i == me.playingTrack)
{