condensed some commits because they were small or already reversed

This commit is contained in:
Jorolf 2017-04-11 22:48:53 +02:00
parent 50b6bcd574
commit ed2f5d210e
3 changed files with 9 additions and 8 deletions

View File

@ -57,6 +57,7 @@ namespace osu.Game.Graphics.UserInterface
Length = bar.Value / (MaxValue ?? value.Max()), Length = bar.Value / (MaxValue ?? value.Max()),
Direction = Direction, Direction = Direction,
}); });
//I'm using ToList() here because Where() returns an Enumerable which can change it's elements afterwards
Remove(Children.Where((bar, index) => index >= value.Count()).ToList()); Remove(Children.Where((bar, index) => index >= value.Count()).ToList());
} }
} }

View File

@ -28,7 +28,7 @@ namespace osu.Game.Screens.Select
{ {
beatmap = value; beatmap = value;
Leaderboard.Beatmap = beatmap?.BeatmapInfo; Leaderboard.Beatmap = beatmap?.BeatmapInfo;
Details.Beatmap = beatmap.Beatmap.BeatmapInfo; Details.Beatmap = beatmap?.Beatmap.BeatmapInfo;
} }
} }

View File

@ -12,7 +12,6 @@ using osu.Game.Database;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
@ -50,6 +49,7 @@ namespace osu.Game.Screens.Select
set set
{ {
beatmap = value; beatmap = value;
if (beatmap == null) return;
description.Text = beatmap.Version; description.Text = beatmap.Version;
source.Text = beatmap.Metadata.Source; source.Text = beatmap.Metadata.Source;
@ -61,9 +61,9 @@ namespace osu.Game.Screens.Select
approachRate.Value = beatmap.Difficulty.ApproachRate; approachRate.Value = beatmap.Difficulty.ApproachRate;
stars.Value = (float)beatmap.StarDifficulty; stars.Value = (float)beatmap.StarDifficulty;
if (beatmap.Metric?.Ratings.Count() > 0) if (beatmap.Metric?.Ratings.Count() == 10)
{ {
List<int> ratings = beatmap.Metric.Ratings.ToList(); var ratings = beatmap.Metric.Ratings.ToList();
ratingsContainer.Show(); ratingsContainer.Show();
negativeRatings.Text = ratings.GetRange(0, 5).Sum().ToString(); negativeRatings.Text = ratings.GetRange(0, 5).Sum().ToString();
@ -75,10 +75,10 @@ namespace osu.Game.Screens.Select
else else
ratingsContainer.Hide(); ratingsContainer.Hide();
if (beatmap.Metric?.Retries.Count() > 0 && beatmap.Metric?.Retries.Count() > 0) if (beatmap.Metric?.Retries.Count() == 100 && beatmap.Metric?.Fails.Count() == 100)
{ {
IEnumerable<int> retries = beatmap.Metric.Retries; var retries = beatmap.Metric.Retries;
IEnumerable<int> fails = beatmap.Metric.Fails; var fails = beatmap.Metric.Fails;
retryFailContainer.Show(); retryFailContainer.Show();
float maxValue = fails.Zip(retries, (fail, retry) => fail + retry).Max(); float maxValue = fails.Zip(retries, (fail, retry) => fail + retry).Max();
@ -111,7 +111,7 @@ namespace osu.Game.Screens.Select
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Width = 0.4f, Width = 0.4f,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
LayoutDuration = 1, LayoutDuration = 200,
LayoutEasing = EasingTypes.OutQuint, LayoutEasing = EasingTypes.OutQuint,
Padding = new MarginPadding(10) { Top = 25 }, Padding = new MarginPadding(10) { Top = 25 },
Children = new [] Children = new []