7 me.configureXonoticPlayList(me);
14 me.configureXonoticListBox(me);
19 me.itemAbsSize =
'0 0 0';
22 me.itemAbsSize.y = absSize.y * me.itemHeight;
23 me.itemAbsSize.x = absSize.x * (1 - me.controlWidth);
24 me.realFontSize.y = me.fontSize / me.itemAbsSize.y;
25 me.realFontSize.x = me.fontSize / me.itemAbsSize.x;
26 me.realUpperMargin = 0.5 * (1 - me.realFontSize.y);
28 me.columnNumberOrigin = 0;
29 me.columnNumberSize = 3 * me.realFontSize.x;
31 me.columnNameOrigin = me.columnNumberSize + me.realFontSize.x;
32 me.columnNameSize = 1 - me.columnNameOrigin - me.realFontSize.x;
40 cvar_set(
"music_playlist_list0", track);
44 for(i = 0; i < me.nItems; ++i)
59 for(i = 0; i < me.nItems; ++i)
61 if(i == me.selectedItem)
63 if(i == me.nItems - 1)
64 me.setSelected(me, me.selectedItem - 1);
65 if(
cvar(
"music_playlist_index") == 0 ||
cvar(
"music_playlist_index") == 999)
67 if(
cvar(
"music_playlist_current0") == i)
69 else if(
cvar(
"music_playlist_current0") > i)
70 cvar_set(
"music_playlist_current0",
ftos(
cvar(
"music_playlist_current0") - 1));
80 cvar_set(
"music_playlist_list0",
"");
94 me.removeSelectedFromPlayList(me);
99 cvar_set(
"music_playlist_list0",
"");
112 if(me.selectedItem != i)
115 float c =
cvar(
"music_playlist_current0");
117 cvar_set(
"music_playlist_current0",
ftos(me.selectedItem));
118 else if(c == me.selectedItem)
129 if(
cvar(
"music_playlist_index") == 0 ||
cvar(
"music_playlist_index") == 999)
130 me.playingTrack =
cvar(
"music_playlist_current0");
132 me.playingTrack = -1;
140 draw_Fill(
'0 0 0',
'1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
143 me.focusedItemAlpha =
getFadedAlpha(me.focusedItemAlpha, SKINALPHA_LISTBOX_FOCUSED, SKINFADEALPHA_LISTBOX_FOCUSED);
144 draw_Fill(
'0 0 0',
'1 1 0', SKINCOLOR_LISTBOX_FOCUSED, me.focusedItemAlpha);
147 if(i == me.playingTrack)
149 float f =
cvar(
"music_playlist_sampleposition0");
151 if(f <= 0 || (((
time * 2) & 1) && f > 0))
152 draw_Text(me.realUpperMargin *
eY + (me.columnNumberOrigin + me.columnNumberSize) *
eX,
"\xE2\x96\xB6", me.realFontSize,
'1 1 1', SKINALPHA_TEXT, 0);
156 draw_CenterText(me.realUpperMargin *
eY + (me.columnNumberOrigin + 0.5 * me.columnNumberSize) *
eX, s, me.realFontSize,
'1 1 1', SKINALPHA_TEXT, 0);
159 draw_Text(me.realUpperMargin *
eY + me.columnNameOrigin *
eX, s, me.realFontSize,
'1 1 1', SKINALPHA_TEXT, 0);
166 if(
cvar(
"music_playlist_index") == 0 ||
cvar(
"music_playlist_index") == 999)
168 cvar_set(
"music_playlist_index",
"-1");
169 localcmd(
"\nwait; music_playlist_sampleposition0 0\n");
170 localcmd(
"\ndefer 3 \"cd play $menu_cdtrack\"\n");
185 if(
cvar(
"music_playlist_index") == -1)
187 f =
bound(0,
cvar(
"music_playlist_current0") + offset, me.nItems - 1);
188 if(f ==
cvar(
"music_playlist_current0"))
195 if(f ==
cvar(
"music_playlist_current0"))
196 if(
cvar(
"music_playlist_index") == 999)
207 cvar_set(
"music_playlist_index",
"999");
209 localcmd(
"\nwait; music_playlist_sampleposition0 0; wait; music_playlist_index 0\n");
214 me.startSound(me, 0);
219 me.startSound(me, -1);
224 me.startSound(me, +1);
231 if(
cvar(
"music_playlist_index") == 999)
232 localcmd(
"\nmusic_playlist_index 0; wait; music_playlist_sampleposition0 0\n");
238 if(
cvar(
"music_playlist_index") == 0)
239 localcmd(
"\nmusic_playlist_index 999\n");
240 else me.resumeSound(me);
250 me.startSound(me, 0);
256 me.startSound(me, 0);
264 me.removeSelectedFromPlayList(me);
entity makeXonoticPlayList()
void XonoticPlayList_configureXonoticPlayList(entity me)
void XonoticPlayList_draw(entity me)
void XonoticPlayList_startSound(entity me, float offset)
void XonoticPlayList_pauseSound(entity me)
void PlayList_Remove_All(entity btn, entity me)
void PlayList_Remove(entity btn, entity me)
void XonoticPlayList_doubleClickListBoxItem(entity me, float i, vector where)
void StopSound_Click(entity btn, entity me)
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
void PrevSound_Click(entity btn, entity me)
string swapInPriorityList(string order, float i, float j)
void XonoticPlayList_removeSelectedFromPlayList(entity me)
void XonoticPlayList_resumeSound(entity me)
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float XonoticPlayList_mouseDrag(entity me, vector pos)
void XonoticPlayList_addToPlayList(entity me, string track)
void XonoticPlayList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
void XonoticPlayList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected, bool isFocused)
void XonoticPlayList_stopSound(entity me)
void StartSound_Click(entity btn, entity me)
void NextSound_Click(entity btn, entity me)
void PauseSound_Click(entity btn, entity me)
float XonoticPlayList_keyDown(entity me, float scan, float ascii, float shift)