1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-24 06:33:21 +08:00
osu-lazer/osu.Game/Overlays/BeatmapSet/ExplicitContentBeatmapPill.cs

48 lines
1.6 KiB
C#
Raw Normal View History

2021-01-12 23:15:00 +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.
using osu.Framework.Allocation;
using osu.Framework.Extensions.LocalisationExtensions;
2021-01-12 23:15:00 +08:00
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Resources.Localisation.Web;
2021-01-12 23:15:00 +08:00
namespace osu.Game.Overlays.BeatmapSet
{
2021-01-17 21:40:24 +08:00
public class ExplicitContentBeatmapPill : CompositeDrawable
2021-01-12 23:15:00 +08:00
{
2021-01-17 21:40:24 +08:00
public ExplicitContentBeatmapPill()
2021-01-12 23:15:00 +08:00
{
AutoSizeAxes = Axes.Both;
}
[BackgroundDependencyLoader(true)]
private void load(OsuColour colours, OverlayColourProvider colourProvider)
{
InternalChild = new CircularContainer
{
Masking = true,
AutoSizeAxes = Axes.Both,
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = colourProvider?.Background5 ?? colours.Gray2,
},
new OsuSpriteText
{
Margin = new MarginPadding { Horizontal = 10f, Vertical = 2f },
Text = BeatmapsetsStrings.NsfwBadgeLabel.ToUpper(),
2021-01-14 10:40:43 +08:00
Font = OsuFont.GetFont(size: 10, weight: FontWeight.SemiBold),
Colour = OverlayColourProvider.Orange.Colour2,
2021-01-12 23:15:00 +08:00
}
}
};
}
}
}