mirror of
https://github.com/ppy/osu
synced 2025-01-10 08:09:40 +00:00
Fade out inactive player rows on user ranking table
This commit is contained in:
parent
82d6639a3b
commit
12c8243a9b
@ -54,13 +54,15 @@ namespace osu.Game.Overlays.Rankings.Tables
|
||||
Spacing = new Vector2(0, row_spacing),
|
||||
});
|
||||
|
||||
rankings.ForEach(_ => backgroundFlow.Add(new TableRowBackground { Height = row_height }));
|
||||
rankings.ForEach(s => backgroundFlow.Add(CreateRowBackground(s)));
|
||||
|
||||
Columns = mainHeaders.Concat(CreateAdditionalHeaders()).Cast<TableColumn>().ToArray();
|
||||
Content = rankings.Select((s, i) => createContent((page - 1) * items_per_page + i, s)).ToArray().ToRectangular();
|
||||
Content = rankings.Select((s, i) => CreateRowContent((page - 1) * items_per_page + i, s)).ToArray().ToRectangular();
|
||||
}
|
||||
|
||||
private Drawable[] createContent(int index, TModel item) => new Drawable[] { createIndexDrawable(index), createMainContent(item) }.Concat(CreateAdditionalContent(item)).ToArray();
|
||||
protected virtual Drawable CreateRowBackground(TModel item) => new TableRowBackground { Height = row_height };
|
||||
|
||||
protected virtual Drawable[] CreateRowContent(int index, TModel item) => new Drawable[] { createIndexDrawable(index), createMainContent(item) }.Concat(CreateAdditionalContent(item)).ToArray();
|
||||
|
||||
private static RankingsTableColumn[] mainHeaders => new[]
|
||||
{
|
||||
|
@ -24,6 +24,29 @@ namespace osu.Game.Overlays.Rankings.Tables
|
||||
|
||||
protected virtual IEnumerable<LocalisableString> GradeColumns => new List<LocalisableString> { RankingsStrings.Statss, RankingsStrings.Stats, RankingsStrings.Stata };
|
||||
|
||||
protected override Drawable CreateRowBackground(UserStatistics item)
|
||||
{
|
||||
var background = base.CreateRowBackground(item);
|
||||
|
||||
if (!item.User.Active)
|
||||
background.Alpha = 0.5f;
|
||||
|
||||
return background;
|
||||
}
|
||||
|
||||
protected override Drawable[] CreateRowContent(int index, UserStatistics item)
|
||||
{
|
||||
var content = base.CreateRowContent(index, item);
|
||||
|
||||
if (!item.User.Active)
|
||||
{
|
||||
foreach (var d in content)
|
||||
d.Alpha = 0.5f;
|
||||
}
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
protected override RankingsTableColumn[] CreateAdditionalHeaders() => new[]
|
||||
{
|
||||
new RankingsTableColumn(RankingsStrings.StatAccuracy, Anchor.Centre, new Dimension(GridSizeMode.AutoSize)),
|
||||
|
Loading…
Reference in New Issue
Block a user