added possibility to drop the playlist elements on first and last position even if the mouse is out of range of the other playlist elements

This commit is contained in:
Alexander Eckart committed 2012-12-02 19:38:18 +01:00
1 parent 193116f669
commit ec39b72f80
2 files changed
+38

No files matched your search

+9
View File
@@ -265,5 +265,14 @@ namespace Vocaluxe.Lib.Playlist
Songs.RemoveAt(SourceNr);
Songs.Insert(DestNr, ps);
}
public void SongInsert(int DestNr, int SongID, EGameMode gm)
{
if (DestNr < 0 || DestNr > Songs.Count - 1)
return;
CPlaylistSong ps = new CPlaylistSong(SongID, gm);
Songs.Insert(DestNr, ps);
}
}
}
+29
View File
@@ -974,6 +974,35 @@ namespace Vocaluxe.Menu
CPlaylists.Playlists[ActivePlaylistID].SongMove(ChangeOrderSource, CurrentPlaylistElement + Offset);
UpdatePlaylist();
}
else if (CurrentPlaylistElement == -1)
{
if (MouseEvent.Y < PlaylistElements[0].Background.Rect.Y && Offset == 0)
{
CPlaylists.Playlists[ActivePlaylistID].SongMove(ChangeOrderSource, 0);
}
else
{
if (PlaylistElements.Count + Offset >= PlaylistElementContents.Count)
{
float min = 0f;
for (int i = PlaylistElements.Count - 1; i >= 0; i--)
{
if (PlaylistElements[i].SelectSlide.Visible)
{
min = PlaylistElements[i].SelectSlide.Rect.Y + PlaylistElements[i].SelectSlide.Rect.H;
break;
}
}
if (MouseEvent.Y > min)
{
CPlaylists.Playlists[ActivePlaylistID].SongMove(ChangeOrderSource, PlaylistElementContents.Count - 1);
}
}
}
UpdatePlaylist();
}
_EditMode = EEditMode.None;
}
break;