mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Add beatmap set online status and display it in direct panels and the beatmap set overlay.
This commit is contained in:
@ -26,6 +26,11 @@ namespace osu.Game.Beatmaps
|
||||
/// </summary>
|
||||
public DateTimeOffset? LastUpdated { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The status of this beatmap set.
|
||||
/// </summary>
|
||||
public BeatmapSetOnlineStatus Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Whether or not this beatmap set has a background video.
|
||||
/// </summary>
|
||||
|
17
osu.Game/Beatmaps/BeatmapSetOnlineStatus.cs
Normal file
17
osu.Game/Beatmaps/BeatmapSetOnlineStatus.cs
Normal file
@ -0,0 +1,17 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.Beatmaps
|
||||
{
|
||||
public enum BeatmapSetOnlineStatus
|
||||
{
|
||||
None,
|
||||
Graveyard = -2,
|
||||
WIP = -1,
|
||||
Pending = 0,
|
||||
Ranked = 1,
|
||||
Approved = 2,
|
||||
Qualified = 3,
|
||||
Loved = 4,
|
||||
}
|
||||
}
|
53
osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs
Normal file
53
osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs
Normal file
@ -0,0 +1,53 @@
|
||||
// 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;
|
||||
|
||||
private BeatmapSetOnlineStatus status = BeatmapSetOnlineStatus.None;
|
||||
public BeatmapSetOnlineStatus Status
|
||||
{
|
||||
get { return status; }
|
||||
set
|
||||
{
|
||||
status = value;
|
||||
|
||||
statusText.Text = Enum.GetName(typeof(BeatmapSetOnlineStatus), Status)?.ToUpper();
|
||||
}
|
||||
}
|
||||
|
||||
public BeatmapSetOnlineStatusPill(float textSize, MarginPadding textPadding)
|
||||
{
|
||||
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",
|
||||
TextSize = textSize,
|
||||
Padding = textPadding,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user