2021-11-29 03:25:23 +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.
|
|
|
|
|
2021-12-17 18:27:38 +08:00
|
|
|
using osu.Framework.Allocation;
|
2021-11-29 03:25:23 +08:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2021-12-17 18:27:38 +08:00
|
|
|
using osu.Framework.Input.Events;
|
2021-11-29 03:25:23 +08:00
|
|
|
using osu.Game.Online.API.Requests.Responses;
|
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Beatmaps.Drawables.Cards
|
|
|
|
{
|
2021-12-17 18:27:38 +08:00
|
|
|
public class BeatmapCardExtraInfoRow : CompositeDrawable
|
2021-11-29 03:25:23 +08:00
|
|
|
{
|
2021-12-17 18:27:38 +08:00
|
|
|
[Resolved(CanBeNull = true)]
|
|
|
|
private BeatmapCardContent? content { get; set; }
|
|
|
|
|
2021-11-29 03:25:23 +08:00
|
|
|
public BeatmapCardExtraInfoRow(APIBeatmapSet beatmapSet)
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
|
2021-12-17 18:27:38 +08:00
|
|
|
InternalChild = new FillFlowContainer
|
2021-11-29 03:25:23 +08:00
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
Direction = FillDirection.Horizontal,
|
|
|
|
Spacing = new Vector2(4, 0),
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
|
|
|
new BeatmapSetOnlineStatusPill
|
|
|
|
{
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
Status = beatmapSet.Status,
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
Origin = Anchor.CentreLeft
|
|
|
|
},
|
|
|
|
new DifficultySpectrumDisplay(beatmapSet)
|
|
|
|
{
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
Origin = Anchor.CentreLeft,
|
|
|
|
DotSize = new Vector2(6, 12)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2021-12-17 18:27:38 +08:00
|
|
|
|
|
|
|
protected override bool OnHover(HoverEvent e)
|
|
|
|
{
|
|
|
|
content?.ExpandAfterDelay();
|
|
|
|
return base.OnHover(e);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void OnHoverLost(HoverLostEvent e)
|
|
|
|
{
|
|
|
|
if (content?.Expanded.Value == false)
|
|
|
|
content.CancelExpand();
|
|
|
|
|
|
|
|
base.OnHoverLost(e);
|
|
|
|
}
|
2021-11-29 03:25:23 +08:00
|
|
|
}
|
|
|
|
}
|