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 @@ public IEnumerable<float> Values
Length = bar.Value / (MaxValue ?? value.Max()),
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());
}
}

View File

@ -28,7 +28,7 @@ public WorkingBeatmap Beatmap
{
beatmap = value;
Leaderboard.Beatmap = beatmap?.BeatmapInfo;
Details.Beatmap = beatmap.Beatmap.BeatmapInfo;
Details.Beatmap = beatmap?.Beatmap.BeatmapInfo;
}
}

View File

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