1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 21:42:55 +08:00
osu-lazer/osu.Game/Overlays/Profile/Sections/BeatmapMetadataContainer.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
1.3 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2018-04-13 17:19:50 +08:00
2022-06-17 15:37:17 +08:00
#nullable disable
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Beatmaps;
using osu.Game.Graphics.Containers;
namespace osu.Game.Overlays.Profile.Sections
{
/// <summary>
/// Display artist/title/mapper information, commonly used as the left portion of a profile or score display row.
/// </summary>
public abstract class BeatmapMetadataContainer : OsuHoverContainer
{
private readonly IBeatmapInfo beatmapInfo;
2018-04-13 17:19:50 +08:00
protected BeatmapMetadataContainer(IBeatmapInfo beatmapInfo)
{
2021-10-02 23:55:29 +08:00
this.beatmapInfo = beatmapInfo;
2019-07-18 19:17:19 +08:00
AutoSizeAxes = Axes.Both;
}
2018-04-13 17:19:50 +08:00
[BackgroundDependencyLoader(true)]
private void load(BeatmapSetOverlay beatmapSetOverlay)
{
Action = () =>
{
beatmapSetOverlay?.FetchAndShowBeatmap(beatmapInfo.OnlineID);
};
2018-04-13 17:19:50 +08:00
Child = new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
2021-10-02 23:55:29 +08:00
Children = CreateText(beatmapInfo),
};
}
protected abstract Drawable[] CreateText(IBeatmapInfo beatmapInfo);
}
}