mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 09:22:54 +08:00
Removed unnecessary private method to update the metadata
This commit is contained in:
parent
d49ee295d9
commit
ac0942df86
@ -188,7 +188,9 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
ratingsContainer.FadeIn(transition_duration);
|
ratingsContainer.FadeIn(transition_duration);
|
||||||
advanced.Beatmap = Beatmap;
|
advanced.Beatmap = Beatmap;
|
||||||
loadDetailsAsync(Beatmap);
|
description.Text = Beatmap.Version;
|
||||||
|
source.Text = Beatmap.Metadata.Source;
|
||||||
|
tags.Text = Beatmap.Metadata.Tags;
|
||||||
|
|
||||||
var requestedBeatmap = Beatmap;
|
var requestedBeatmap = Beatmap;
|
||||||
if (requestedBeatmap.Metrics == null)
|
if (requestedBeatmap.Metrics == null)
|
||||||
@ -212,16 +214,6 @@ namespace osu.Game.Screens.Select
|
|||||||
displayMetrics(requestedBeatmap.Metrics, false);
|
displayMetrics(requestedBeatmap.Metrics, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadDetailsAsync(BeatmapInfo beatmap)
|
|
||||||
{
|
|
||||||
if (description == null || source == null || tags == null)
|
|
||||||
throw new InvalidOperationException($@"Requires all {nameof(MetadataSection)} elements to be non-null.");
|
|
||||||
|
|
||||||
description.Text = beatmap.Version;
|
|
||||||
source.Text = beatmap.Metadata?.Source;
|
|
||||||
tags.Text = beatmap.Metadata?.Tags;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void displayMetrics(BeatmapMetrics metrics, bool failOnMissing = true)
|
private void displayMetrics(BeatmapMetrics metrics, bool failOnMissing = true)
|
||||||
{
|
{
|
||||||
var hasRatings = metrics?.Ratings?.Any() ?? false;
|
var hasRatings = metrics?.Ratings?.Any() ?? false;
|
||||||
@ -267,7 +259,10 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
private void clearStats()
|
private void clearStats()
|
||||||
{
|
{
|
||||||
loadDetailsAsync(null);
|
description.Text = null;
|
||||||
|
source.Text = null;
|
||||||
|
tags.Text = null;
|
||||||
|
|
||||||
advanced.Beatmap = new BeatmapInfo
|
advanced.Beatmap = new BeatmapInfo
|
||||||
{
|
{
|
||||||
StarDifficulty = 0,
|
StarDifficulty = 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user