mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 16:13:57 +09:00
Slight refactoring of order for readability
This commit is contained in:
@ -9,6 +9,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using JetBrains.Annotations;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.API.Requests;
|
using osu.Game.Online.API.Requests;
|
||||||
using osu.Framework.Threading;
|
using osu.Framework.Threading;
|
||||||
@ -180,15 +181,15 @@ namespace osu.Game.Screens.Select
|
|||||||
source.Text = Beatmap?.Metadata?.Source;
|
source.Text = Beatmap?.Metadata?.Source;
|
||||||
tags.Text = Beatmap?.Metadata?.Tags;
|
tags.Text = Beatmap?.Metadata?.Tags;
|
||||||
|
|
||||||
if (Beatmap == null)
|
// metrics may have been previously fetched
|
||||||
|
if (Beatmap?.Metrics != null)
|
||||||
{
|
{
|
||||||
updateMetrics(null);
|
updateMetrics(Beatmap.Metrics);
|
||||||
ratingsContainer.FadeOut(transition_duration);
|
|
||||||
failRetryContainer.FadeOut(transition_duration);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Beatmap.Metrics == null && Beatmap.OnlineBeatmapID != null)
|
// metrics may not be fetched but can be
|
||||||
|
if (Beatmap?.OnlineBeatmapID != null)
|
||||||
{
|
{
|
||||||
var requestedBeatmap = Beatmap;
|
var requestedBeatmap = Beatmap;
|
||||||
var lookup = new GetBeatmapDetailsRequest(requestedBeatmap);
|
var lookup = new GetBeatmapDetailsRequest(requestedBeatmap);
|
||||||
@ -204,14 +205,13 @@ namespace osu.Game.Screens.Select
|
|||||||
lookup.Failure += e => Schedule(() => updateMetrics(null));
|
lookup.Failure += e => Schedule(() => updateMetrics(null));
|
||||||
api.Queue(lookup);
|
api.Queue(lookup);
|
||||||
loading.Show();
|
loading.Show();
|
||||||
}
|
return;
|
||||||
else
|
|
||||||
{
|
|
||||||
updateMetrics(Beatmap.Metrics);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateMetrics(BeatmapMetrics metrics)
|
updateMetrics(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateMetrics([CanBeNull] BeatmapMetrics metrics)
|
||||||
{
|
{
|
||||||
var hasRatings = metrics?.Ratings?.Any() ?? false;
|
var hasRatings = metrics?.Ratings?.Any() ?? false;
|
||||||
var hasRetriesFails = (metrics?.Retries?.Any() ?? false) && (metrics.Fails?.Any() ?? false);
|
var hasRetriesFails = (metrics?.Retries?.Any() ?? false) && (metrics.Fails?.Any() ?? false);
|
||||||
|
Reference in New Issue
Block a user