public int Compare(SelectedSongInfo info1, SelectedSongInfo info2) { var desc = filter.Desc ? -1 : 1; if (info1.SongInfo == null) { if (info2.SongInfo == null) { return(desc * String.Compare(info1.Text, info2.Text)); } else { return(-desc); } } else { if (info2.SongInfo == null) { return(desc); } else { return(filter.Compare(info1.SongInfo, info2.SongInfo)); } } }
/// <summary> /// 譜面変更 /// </summary> /// <param name="songinfo"></param> public void ChangeSongInfo(SelectedSongInfo songinfo) { this.songinfo = songinfo; HideInfo(); if (songinfo.SongInfo == null || !songinfo.SongInfo.IsPPDSong) { return; } exist = new bool[6]; exist[0] = true; exist[1] = (songinfo.Difficulty & SongInformation.AvailableDifficulty.Easy) == SongInformation.AvailableDifficulty.Easy; exist[2] = (songinfo.Difficulty & SongInformation.AvailableDifficulty.Normal) == SongInformation.AvailableDifficulty.Normal; exist[3] = (songinfo.Difficulty & SongInformation.AvailableDifficulty.Hard) == SongInformation.AvailableDifficulty.Hard; exist[4] = (songinfo.Difficulty & SongInformation.AvailableDifficulty.Extreme) == SongInformation.AvailableDifficulty.Extreme; exist[5] = songinfo.SongInfo.IsPPDSong; infos[0].Text = songinfo.SongInfo.GetBPMString(); infos[5].Text = songinfo.SongInfo.AuthorName; for (int i = 1; i <= 4; i++) { infos[i].Text = exist[i] ? songinfo.SongInfo.GetDifficultyString((Difficulty)(i - 1)) : ""; buttons[i - 1].Enabled = exist[i]; buttonAcs[i - 1].Hidden = acs[i - 1].Hidden = !exist[i] || !songinfo.SongInfo.GetIsAC((Difficulty)(i - 1)); buttonFts[i - 1].Hidden = fts[i - 1].Hidden = !exist[i] || !songinfo.SongInfo.GetIsACFT((Difficulty)(i - 1)); } UpdatePerfectTrials(); foreach (TextureString str in infos) { str.AllowScroll = true; } UpdateResult(); }