Display only one Record per Player

This commit is contained in:
Pr3di committed 2016-11-05 15:40:30 +01:00
1 parent a2c1790195
commit 490afaec32
3 files changed
+31 -8

No files matched your search

+2 -2
View File
@@ -1007,9 +1007,9 @@
</TileRectSmall> </TileRectSmall>
<TileRectRecord> <TileRectRecord>
<X>400</X> <X>400</X>
<Y>420</Y> <Y>415</Y>
<W>280</W> <W>280</W>
<H>210</H> <H>170</H>
<Z>-1</Z> <Z>-1</Z>
</TileRectRecord> </TileRectRecord>
<TextArtist Name="TextArtist"> <TextArtist Name="TextArtist">
BIN
View File
Binary file not shown.
@@ -247,12 +247,13 @@ namespace VocaluxeLib.Menu.SongMenu
{ {
//Create text for Record //Create text for Record
var textRect = new SRectF(rect.X, rect.Y + i * (rect.H / 5 - _SpaceH), rect.W - _SpaceW, rect.H / 5 - _SpaceH, rect.Z); var textRect = new SRectF(rect.X, rect.Y + i * (rect.H / 5), rect.W, rect.H / 5, rect.Z);
CText text = new CText(textRect.X, textRect.Y, textRect.Z, CText text = new CText(textRect.X, textRect.Y, textRect.Z,
textRect.H, textRect.W, EAlignment.Left, EStyle.Normal, textRect.H, textRect.W, EAlignment.Left, EStyle.Normal,
"Normal", _Artist.Color, ""); "Normal", _Artist.Color, "");
text.MaxRect = new SRectF(text.MaxRect.X, text.MaxRect.Y, text.MaxRect.W + text.MaxRect.X - text.Rect.X - 5f, text.MaxRect.H, text.MaxRect.Z); text.MaxRect = new SRectF(text.MaxRect.X, text.MaxRect.Y, text.MaxRect.W + text.MaxRect.X - text.Rect.X - 5f, text.MaxRect.H, text.MaxRect.Z);
text.ResizeAlign = EHAlignment.Center; text.ResizeAlign = EHAlignment.Center;
text.Font.Style = EStyle.Bold;
_Records.Add(text); _Records.Add(text);
} }
@@ -362,14 +363,36 @@ namespace VocaluxeLib.Menu.SongMenu
return; return;
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>();
int k = 0;
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
if (i < _Scores.Count) if (k < _Scores.Count)
{ {
SDBScoreEntry score = _Scores[i]; SDBScoreEntry score = _Scores[k];
_Records[i].Text = (i+1) +". "+ score.Name + " " + score.Score + " ("+ CBase.Language.Translate(score.Difficulty.ToString()) + ") " + score.Date; while (players.Contains(score.Name))
}else {
k++;
if (k < _Scores.Count)
{
score = _Scores[k];
}
else
{
break;
}
}
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 = ""; _Records[i].Text = "";
} }