create instance of BeatmapInfo for use in ScoreBeatmapMetadataContainer

This commit is contained in:
tsunyoku 2022-07-17 14:47:04 +01:00
parent c73eff7c89
commit 486fbd2531

View File

@ -50,6 +50,24 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
[BackgroundDependencyLoader]
private void load(RulesetStore rulesets)
{
var beatmapSet = Score.BeatmapSet ?? Score.Beatmap?.BeatmapSet;
var beatmapInfo = new BeatmapInfo();
if (beatmapSet != null)
{
var beatmapMetadata = new BeatmapMetadata
{
Artist = beatmapSet.Artist,
ArtistUnicode = beatmapSet.ArtistUnicode,
Title = beatmapSet.Title,
TitleUnicode = beatmapSet.TitleUnicode,
};
beatmapInfo.Metadata = beatmapMetadata;
if (Score.Beatmap?.DifficultyName != null)
beatmapInfo.DifficultyName = Score.Beatmap.DifficultyName;
}
AddInternal(new ProfileItemContainer
{
Children = new Drawable[]
@ -84,7 +102,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
Spacing = new Vector2(0, 2),
Children = new Drawable[]
{
new ScoreBeatmapMetadataContainer(Score.Beatmap),
new ScoreBeatmapMetadataContainer(beatmapInfo),
new FillFlowContainer
{
AutoSizeAxes = Axes.Both,