1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 21:47:25 +08:00

retries and fails hide if they're not present

This commit is contained in:
Jorolf 2017-04-07 20:19:03 +02:00
parent 899e559b5c
commit 6a87fd6112

View File

@ -37,6 +37,7 @@ namespace osu.Game.Screens.Select
private readonly OsuSpriteText positiveRatings;
private readonly BarGraph ratingsGraph;
private readonly FillFlowContainer retryAndFailContainer;
private readonly BarGraph retryGraph;
private readonly BarGraph failGraph;
@ -119,8 +120,14 @@ namespace osu.Game.Screens.Select
private void calcRetryAndFailGraph()
{
if ((fails?.Count ?? 0) == 0 || (retries?.Count ?? 0) == 0)
retryAndFailContainer.FadeOut(250);
else
{
retryAndFailContainer.FadeIn(250);
failGraph.Values = fails.Select(fail => (float)fail);
retryGraph.Values = retries?.Select((retry, index) => (float)retry + fails?[index] ?? 0) ?? new List<float>();
retryGraph.Values = retries?.Select((retry, index) => (float)retry + fails[index]) ?? new List<float>();
}
}
public BeatmapDetails()
@ -304,6 +311,13 @@ namespace osu.Game.Screens.Select
},
},
},
retryAndFailContainer = new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Alpha = 0,
Children = new Drawable[]
{
new OsuSpriteText
{
Text = "Points of Failure",
@ -325,6 +339,8 @@ namespace osu.Game.Screens.Select
},
},
},
}
},
},
},
};