2019-01-24 16:43:03 +08:00
|
|
|
|
// 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
|
|
|
|
|
2017-11-19 21:17:14 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Graphics.Containers;
|
2021-07-30 20:23:49 +08:00
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
2018-07-05 20:00:23 +08:00
|
|
|
|
|
2017-11-19 21:17:14 +08:00
|
|
|
|
namespace osu.Game.Overlays.Profile.Sections
|
|
|
|
|
{
|
2017-12-11 11:31:35 +08:00
|
|
|
|
/// <summary>
|
2020-01-30 02:01:40 +08:00
|
|
|
|
/// Display artist/title/mapper information, commonly used as the left portion of a profile or score display row.
|
2017-12-11 11:31:35 +08:00
|
|
|
|
/// </summary>
|
2019-07-15 18:09:21 +08:00
|
|
|
|
public abstract class BeatmapMetadataContainer : OsuHoverContainer
|
2017-11-19 21:17:14 +08:00
|
|
|
|
{
|
2021-10-22 20:25:13 +08:00
|
|
|
|
private readonly IBeatmapInfo beatmapInfo;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2021-10-22 20:25:13 +08:00
|
|
|
|
protected BeatmapMetadataContainer(IBeatmapInfo beatmapInfo)
|
2021-07-30 20:23:49 +08:00
|
|
|
|
: base(HoverSampleSet.Submit)
|
2017-11-19 21:17:14 +08:00
|
|
|
|
{
|
2021-10-02 23:55:29 +08:00
|
|
|
|
this.beatmapInfo = beatmapInfo;
|
2019-07-18 19:17:19 +08:00
|
|
|
|
|
2017-11-19 21:17:14 +08:00
|
|
|
|
AutoSizeAxes = Axes.Both;
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-11-19 21:17:14 +08:00
|
|
|
|
[BackgroundDependencyLoader(true)]
|
2018-09-19 13:07:46 +08:00
|
|
|
|
private void load(BeatmapSetOverlay beatmapSetOverlay)
|
2017-11-19 21:17:14 +08:00
|
|
|
|
{
|
|
|
|
|
Action = () =>
|
|
|
|
|
{
|
2021-10-22 20:25:13 +08:00
|
|
|
|
beatmapSetOverlay?.FetchAndShowBeatmap(beatmapInfo.OnlineID);
|
2017-11-19 21:17:14 +08:00
|
|
|
|
};
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-11-19 21:17:14 +08:00
|
|
|
|
Child = new FillFlowContainer
|
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
2021-10-02 23:55:29 +08:00
|
|
|
|
Children = CreateText(beatmapInfo),
|
2017-11-19 21:17:14 +08:00
|
|
|
|
};
|
|
|
|
|
}
|
2019-07-15 18:09:21 +08:00
|
|
|
|
|
2021-10-22 20:25:13 +08:00
|
|
|
|
protected abstract Drawable[] CreateText(IBeatmapInfo beatmapInfo);
|
2017-11-19 21:17:14 +08:00
|
|
|
|
}
|
|
|
|
|
}
|