From 8dce129331a9ce057abd617a8eb8ca1f27fd3a82 Mon Sep 17 00:00:00 2001 From: Florian Kuepper Date: Mon, 24 Dec 2012 11:24:47 +0100 Subject: [PATCH] Sing song from playlist with double-click or enter. --- VocaluxeLib/Menu/CPlaylist.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/VocaluxeLib/Menu/CPlaylist.cs b/VocaluxeLib/Menu/CPlaylist.cs index 734a2112..27d529cb 100644 --- a/VocaluxeLib/Menu/CPlaylist.cs +++ b/VocaluxeLib/Menu/CPlaylist.cs @@ -631,7 +631,7 @@ namespace Vocaluxe.Menu break; case Keys.Enter: - StartPlaylistSongs(); + StartPlaylistSong(CurrentPlaylistElement); break; case Keys.Add: //move the selected song up @@ -958,6 +958,12 @@ namespace Vocaluxe.Menu } } + //Start selected song with double click + if (MouseEvent.LD && CurrentPlaylistElement != -1) + { + StartPlaylistSong(CurrentPlaylistElement); + } + //Change order with holding LB if (MouseEvent.LBH && CurrentPlaylistElement != -1 && PlaylistElementContents.Count > 0 && DragAndDropSongID == -1) { @@ -1203,6 +1209,17 @@ namespace Vocaluxe.Menu } } + private void StartPlaylistSong(int selected) + { + _Base.Game.Reset(); + _Base.Game.ClearSongs(); + + _Base.Game.AddSong(_Base.Playlist.GetPlaylistSong(ActivePlaylistID, selected).SongID, _Base.Playlist.GetPlaylistSong(ActivePlaylistID, selected).GameMode); + + if (_Base.Game.GetNumSongs() > 0) + _Base.Graphics.FadeTo(EScreens.ScreenNames); + } + private void ClosePlaylist() { Visible = false;