- Bugfix: Records and Songtitles were shown wrong in TabsView

- Added the Option to change the displayed Records:
1. open the ScreenSong.xml which is found here: <VocaluxeDir>\Themes\Ambient\Screens\ScreenSong.xml
2. Search for RecordStyle
3. Change the Value to one of the following:
RECORDSTYLE_SINGLE = One per Player
    RECORDSTYLE_DIFFICULTY = One per Player per Difficulty
    RECORDSTYLE_ALL = The best 5 Records independent from Players
This commit is contained in:
Pr3di committed 2016-11-09 20:02:45 +01:00
1 parent 2b8f7a8e83
commit 641854a927
7 files changed
+93 -18

No files matched your search

@@ -991,6 +991,10 @@
<ListLength>8</ListLength> <ListLength>8</ListLength>
<SpaceW>10</SpaceW> <SpaceW>10</SpaceW>
<SpaceH>10</SpaceH> <SpaceH>10</SpaceH>
<!-- RECORDSTYLE_SINGLE = One per Player
RECORDSTYLE_DIFFICULTY = One per Player per Difficulty
RECORDSTYLE_ALL = The best 5 Records independent from Players -->
<RecordStyle>RECORDSTYLE_SINGLE</RecordStyle>
<TileRect> <TileRect>
<X>640</X> <X>640</X>
<Y>40</Y> <Y>40</Y>
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+7
View File
@@ -430,4 +430,11 @@ namespace VocaluxeLib
TR_USERROLE_PROFILEEDITOR = 32 TR_USERROLE_PROFILEEDITOR = 32
// ReSharper restore InconsistentNaming // ReSharper restore InconsistentNaming
} }
public enum ERecordStyle
{
RECORDSTYLE_SINGLE,
RECORDSTYLE_DIFFICULTY,
RECORDSTYLE_ALL
}
} }
@@ -93,6 +93,13 @@ namespace VocaluxeLib.Menu.SongMenu
/// </summary> /// </summary>
public float SpaceH; public float SpaceH;
/*<summary>
RECORDSTYLE_ONE = One per Player
RECORDSTYLE_DIFFICULTY = One per Player per Difficulty
RECORDSTYLE_ALL = The best 5 independent from Players
</summary>*/
public ERecordStyle RecordStyle;
public SRectF TileRect; public SRectF TileRect;
public SRectF TileRectSmall; public SRectF TileRectSmall;
@@ -359,43 +359,98 @@ namespace VocaluxeLib.Menu.SongMenu
private void _UpdateRecords(CSong song) private void _UpdateRecords(CSong song)
{ {
if (!CBase.Songs.IsInCategory())
{
_ResetRecords();
return;
}
if (song == null) if (song == null)
return; return;
ERecordStyle recordStyle = _Theme.SongMenuListRecord.RecordStyle;
List<SDBScoreEntry> _Scores = CBase.DataBase.LoadScore(song.ID,EGameMode.TR_GAMEMODE_NORMAL, EHighscoreStyle.TR_CONFIG_HIGHSCORE_LIST_ALL); List<SDBScoreEntry> _Scores = CBase.DataBase.LoadScore(song.ID,EGameMode.TR_GAMEMODE_NORMAL, EHighscoreStyle.TR_CONFIG_HIGHSCORE_LIST_ALL);
List<String> players = new List<string>(); List<String> players = new List<string>();
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]; if (i < _Scores.Count)
while (players.Contains(score.Name))
{ {
k++; SDBScoreEntry score = _Scores[i];
if (k < _Scores.Count) _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 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 else
{ {
_Records[i].Text = ""; _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); SetSelectedCategory(0);
_UpdateListIfRequired(); _UpdateListIfRequired();
_ResetRecords();
} }
private void _NextCategory() private void _NextCategory()
@@ -767,6 +823,7 @@ namespace VocaluxeLib.Menu.SongMenu
int num = currentCat.GetNumSongsNotSung(); int num = currentCat.GetNumSongsNotSung();
String songOrSongs = (num == 1) ? "TR_SCREENSONG_NUMSONG" : "TR_SCREENSONG_NUMSONGS"; 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].Text = currentCat.Name + " " + CBase.Language.Translate(songOrSongs).Replace("%v", num.ToString());
_Texts[i * 2 + 1].Text = "";
} }
} }
else else