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:
1 parent
193116f669
commit
ec39b72f80
2 files changed
+38
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user