Refactor MetadataSection to use generics and inheritance

This commit is contained in:
Joseph Madamba
2022-12-21 10:18:47 -08:00
parent 01f09529a8
commit 1d39e8d0ce
8 changed files with 180 additions and 71 deletions

View File

@ -141,9 +141,9 @@ namespace osu.Game.Screens.Select
LayoutEasing = Easing.OutQuad,
Children = new[]
{
description = new MetadataSection(MetadataType.Description, searchOnSongSelect),
source = new MetadataSection(MetadataType.Source, searchOnSongSelect),
tags = new MetadataSection(MetadataType.Tags, searchOnSongSelect),
description = new MetadataSectionDescription(searchOnSongSelect),
source = new MetadataSectionSource(searchOnSongSelect),
tags = new MetadataSectionTags(searchOnSongSelect),
},
},
},
@ -187,9 +187,9 @@ namespace osu.Game.Screens.Select
private void updateStatistics()
{
advanced.BeatmapInfo = BeatmapInfo;
description.Text = BeatmapInfo?.DifficultyName;
source.Text = BeatmapInfo?.Metadata.Source;
tags.Text = BeatmapInfo?.Metadata.Tags;
description.Text = BeatmapInfo?.DifficultyName ?? string.Empty;
source.Text = BeatmapInfo?.Metadata.Source ?? string.Empty;
tags.Text = BeatmapInfo?.Metadata.Tags ?? string.Empty;
// failTimes may have been previously fetched
if (ratings != null && failTimes != null)