diff --git a/Output/Themes/Ambient/Screens/ScreenSong.xml b/Output/Themes/Ambient/Screens/ScreenSong.xml index 2cca6440..3668479b 100644 --- a/Output/Themes/Ambient/Screens/ScreenSong.xml +++ b/Output/Themes/Ambient/Screens/ScreenSong.xml @@ -991,6 +991,10 @@ 8 10 10 + + RECORDSTYLE_SINGLE 640 40 diff --git a/PitchTracker/bin/Release.x64/PitchTracker.iobj b/PitchTracker/bin/Release.x64/PitchTracker.iobj index 7f72cee9..b84bbdf9 100644 Binary files a/PitchTracker/bin/Release.x64/PitchTracker.iobj and b/PitchTracker/bin/Release.x64/PitchTracker.iobj differ diff --git a/PitchTracker/bin/Release.x64/PitchTracker.ipdb b/PitchTracker/bin/Release.x64/PitchTracker.ipdb index 741f420c..a08a5b9d 100644 Binary files a/PitchTracker/bin/Release.x64/PitchTracker.ipdb and b/PitchTracker/bin/Release.x64/PitchTracker.ipdb differ diff --git a/Vocaluxe.VC.db b/Vocaluxe.VC.db index 5e6e663e..7e429941 100644 Binary files a/Vocaluxe.VC.db and b/Vocaluxe.VC.db differ diff --git a/VocaluxeLib/Enums.cs b/VocaluxeLib/Enums.cs index e9b3b9d8..92c34713 100644 --- a/VocaluxeLib/Enums.cs +++ b/VocaluxeLib/Enums.cs @@ -430,4 +430,11 @@ namespace VocaluxeLib TR_USERROLE_PROFILEEDITOR = 32 // ReSharper restore InconsistentNaming } + + public enum ERecordStyle + { + RECORDSTYLE_SINGLE, + RECORDSTYLE_DIFFICULTY, + RECORDSTYLE_ALL + } } \ No newline at end of file diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs index d5ecc332..a44393a3 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs @@ -93,6 +93,13 @@ namespace VocaluxeLib.Menu.SongMenu /// public float SpaceH; + /* + RECORDSTYLE_ONE = One per Player + RECORDSTYLE_DIFFICULTY = One per Player per Difficulty + RECORDSTYLE_ALL = The best 5 independent from Players + */ + public ERecordStyle RecordStyle; + public SRectF TileRect; public SRectF TileRectSmall; diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuListRecord.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuListRecord.cs index 38467685..f86867bc 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuListRecord.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuListRecord.cs @@ -359,43 +359,98 @@ namespace VocaluxeLib.Menu.SongMenu private void _UpdateRecords(CSong song) { + if (!CBase.Songs.IsInCategory()) + { + _ResetRecords(); + return; + } + if (song == null) return; + ERecordStyle recordStyle = _Theme.SongMenuListRecord.RecordStyle; + List _Scores = CBase.DataBase.LoadScore(song.ID,EGameMode.TR_GAMEMODE_NORMAL, EHighscoreStyle.TR_CONFIG_HIGHSCORE_LIST_ALL); List players = new List(); - int k = 0; - for (int i = 0; i < 5; i++) + + if (recordStyle.Equals(ERecordStyle.RECORDSTYLE_ALL)) { - if (k < _Scores.Count) + for(int i = 0; i < 5; i++) { - SDBScoreEntry score = _Scores[k]; - while (players.Contains(score.Name)) + if (i < _Scores.Count) { - k++; - if (k < _Scores.Count) + SDBScoreEntry score = _Scores[i]; + _Records[i].Text = (i + 1) + ". " + score.Name + " " + score.Score + " (" + CBase.Language.Translate(score.Difficulty.ToString()) + ")"; + }else + { + _Records[i].Text = ""; + } + } + } + else + { + int k = 0; + for (int i = 0; i < 5; i++) + { + if (k < _Scores.Count) + { + SDBScoreEntry score = _Scores[k]; + + String recordName = ""; + + if (recordStyle.Equals(ERecordStyle.RECORDSTYLE_DIFFICULTY)) { - score = _Scores[k]; + recordName = score.Name + score.Difficulty; } else { - break; + recordName = score.Name; + } + + while (players.Contains(recordName)) + { + k++; + if (k < _Scores.Count) + { + score = _Scores[k]; + + if (recordStyle.Equals(ERecordStyle.RECORDSTYLE_DIFFICULTY)) + { + recordName = score.Name + score.Difficulty; + } + else + { + recordName = score.Name; + } + } + else + { + break; + } + } + if (!players.Contains(recordName)) + { + _Records[i].Text = (i + 1) + ". " + score.Name + " " + score.Score + " (" + CBase.Language.Translate(score.Difficulty.ToString()) + ")"; //+ score.Date; + players.Add(recordName); + } + else + { + _Records[i].Text = ""; } - } - if (!players.Contains(score.Name)) - { - _Records[i].Text = (i + 1) + ". " + score.Name + " " + score.Score + " (" + CBase.Language.Translate(score.Difficulty.ToString()) + ")"; //+ score.Date; - players.Add(score.Name); } else { _Records[i].Text = ""; } } - else - { - _Records[i].Text = ""; - } + } + } + + private void _ResetRecords() + { + for (int i = 0; i < 5; i++) + { + _Records[i].Text = ""; } } @@ -693,6 +748,7 @@ namespace VocaluxeLib.Menu.SongMenu SetSelectedCategory(0); _UpdateListIfRequired(); + _ResetRecords(); } private void _NextCategory() @@ -767,6 +823,7 @@ namespace VocaluxeLib.Menu.SongMenu int num = currentCat.GetNumSongsNotSung(); String songOrSongs = (num == 1) ? "TR_SCREENSONG_NUMSONG" : "TR_SCREENSONG_NUMSONGS"; _Texts[i * 2].Text = currentCat.Name + " " + CBase.Language.Translate(songOrSongs).Replace("%v", num.ToString()); + _Texts[i * 2 + 1].Text = ""; } } else