mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Index -> Rank + some formatting.
This commit is contained in:
@ -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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user