Index -> Rank + some formatting.

This commit is contained in:
Dean Herbert
2017-03-16 13:15:06 +09:00
parent 8e5d83b857
commit ff37d2da03
2 changed files with 28 additions and 26 deletions

View File

@ -37,16 +37,16 @@ namespace osu.Game.Screens.Select.Leaderboards
scrollFlow.Clear();
i = 0;
foreach(var s in scores)
foreach (var s in scores)
{
var ls = new LeaderboardScore(s, 1 + i++)
var ls = new LeaderboardScore(s, 1 + i)
{
AlwaysPresent = true,
State = Visibility.Hidden,
};
scrollFlow.Add(ls);
ls.Delay((i - 1) * 50, true);
ls.Delay(i++ * 50, true);
ls.Show();
}
@ -54,23 +54,6 @@ namespace osu.Game.Screens.Select.Leaderboards
}
}
protected override void Update()
{
base.Update();
var fadeStart = scrollContainer.DrawHeight - 10;
fadeStart += scrollContainer.IsScrolledToEnd() ? 70 : 0;
foreach (var s in scrollFlow.Children)
{
var topY = scrollContainer.ScrollContent.DrawPosition.Y + s.DrawPosition.Y;
var bottomY = topY + 70;
s.ColourInfo = ColourInfo.GradientVertical(Color4.White.Opacity(System.Math.Min((fadeStart - topY) / 70, 1)),
Color4.White.Opacity(System.Math.Min((fadeStart - bottomY) / 70, 1)));
}
}
public Leaderboard()
{
Children = new Drawable[]
@ -92,5 +75,22 @@ namespace osu.Game.Screens.Select.Leaderboards
},
};
}
protected override void Update()
{
base.Update();
var fadeStart = scrollContainer.DrawHeight - 10;
fadeStart += scrollContainer.IsScrolledToEnd() ? 70 : 0;
foreach (var s in scrollFlow.Children)
{
var topY = scrollContainer.ScrollContent.DrawPosition.Y + s.DrawPosition.Y;
var bottomY = topY + 70;
s.ColourInfo = ColourInfo.GradientVertical(Color4.White.Opacity(System.Math.Min((fadeStart - topY) / 70, 1)),
Color4.White.Opacity(System.Math.Min((fadeStart - bottomY) / 70, 1)));
}
}
}
}