public static bool Select() { if (selectedFolderIndex == -1) { selectedFolderIndex = currentFolderIndex; switch (FolderParams[selectedFolderIndex].Type) { case SortType.Title: Songlist = Songlist.OrderBy(x => x.Title).ToList(); UpdateMetaLabels(); break; case SortType.Artist: Songlist = Songlist.OrderBy(x => x.Artist).ToList(); UpdateMetaLabels(); break; case SortType.Level: selectedLevelIndex = -1; break; case SortType.Genre: break; default: break; } } else if (FolderParams[selectedFolderIndex].Type == SortType.Level && selectedLevelIndex == -1) { selectedLevelIndex = currentLevelIndex; Songlist = Songlist.OrderBy(x => x.GetLevel(currentSongLevelIndex)).ToList(); currentSongIndex = Songlist.FindLastIndex(x => x.GetLevel(currentSongLevelIndex) < (selectedLevelIndex + 1)) + 1; UpdateMetaLabels(); if (currentSongIndex >= Songlist.Count) { currentSongIndex--; } } else { if (!IsSongReady()) { return(false); } return(true); } return(false); }
public static void CycleDifficulty() { if (selectedFolderIndex < 0) { return; } currentSongLevelIndex++; if (currentSongLevelIndex > 2) { currentSongLevelIndex = 0; } if (FolderParams[selectedFolderIndex].Type == SortType.Level) { // Find out which song that's currently selected before reorganization var title = Songlist[currentSongIndex].Title; var artist = Songlist[currentSongIndex].Artist; // Reorganize list here Songlist = Songlist.OrderBy(x => x.GetLevel(currentSongLevelIndex)).ToList(); currentSongIndex = Songlist.IndexOf(Songlist.First(x => x.Title == title && x.Artist == artist)); } }