2018-04-13 17:19:50 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
|
|
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
|
using OpenTK.Graphics;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Beatmaps.Drawables
|
|
|
|
|
{
|
|
|
|
|
public class BeatmapSetOnlineStatusPill : CircularContainer
|
|
|
|
|
{
|
|
|
|
|
private readonly OsuSpriteText statusText;
|
|
|
|
|
|
2018-09-13 14:54:58 +08:00
|
|
|
|
private BeatmapSetOnlineStatus status;
|
2018-09-20 11:35:07 +08:00
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
public BeatmapSetOnlineStatus Status
|
|
|
|
|
{
|
2018-09-13 14:54:58 +08:00
|
|
|
|
get => status;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
set
|
|
|
|
|
{
|
2018-09-20 11:35:07 +08:00
|
|
|
|
if (status == value)
|
|
|
|
|
return;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
status = value;
|
|
|
|
|
|
2018-07-24 20:42:06 +08:00
|
|
|
|
statusText.Text = Enum.GetName(typeof(BeatmapSetOnlineStatus), Status)?.ToUpperInvariant();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-20 11:35:07 +08:00
|
|
|
|
public float TextSize
|
|
|
|
|
{
|
|
|
|
|
get => statusText.TextSize;
|
|
|
|
|
set => statusText.TextSize = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public MarginPadding TextPadding
|
|
|
|
|
{
|
|
|
|
|
get => statusText.Padding;
|
|
|
|
|
set => statusText.Padding = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public BeatmapSetOnlineStatusPill()
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both;
|
|
|
|
|
Masking = true;
|
|
|
|
|
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Colour = Color4.Black,
|
|
|
|
|
Alpha = 0.5f,
|
|
|
|
|
},
|
|
|
|
|
statusText = new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Font = @"Exo2.0-Bold",
|
|
|
|
|
},
|
|
|
|
|
};
|
2018-09-13 14:54:58 +08:00
|
|
|
|
|
|
|
|
|
Status = BeatmapSetOnlineStatus.None;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|