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

Change updateMetrics parameter to be optional

This commit is contained in:
Jamie Taylor 2019-03-14 13:23:31 +09:00
parent dd6fbccb56
commit 69eb4ef983
No known key found for this signature in database
GPG Key ID: 2ACFA8B6370B8C8C

View File

@ -9,7 +9,6 @@ using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
using System.Linq;
using JetBrains.Annotations;
using osu.Game.Online.API;
using osu.Game.Online.API.Requests;
using osu.Framework.Threading;
@ -202,16 +201,16 @@ namespace osu.Game.Screens.Select
requestedBeatmap.Metrics = res;
Schedule(() => updateMetrics(res));
};
lookup.Failure += e => Schedule(() => updateMetrics(null));
lookup.Failure += e => Schedule(() => updateMetrics());
api.Queue(lookup);
loading.Show();
return;
}
updateMetrics(null);
updateMetrics();
}
private void updateMetrics([CanBeNull] BeatmapMetrics metrics)
private void updateMetrics(BeatmapMetrics metrics = null)
{
var hasRatings = metrics?.Ratings?.Any() ?? false;
var hasRetriesFails = (metrics?.Retries?.Any() ?? false) && (metrics.Fails?.Any() ?? false);