1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-27 03:33:05 +08:00
osu-lazer/osu.Game/Overlays/Changelog/ChangelogUpdateStreamItem.cs

29 lines
956 B
C#
Raw Normal View History

// 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 Humanizer;
using osu.Game.Graphics;
using osu.Game.Online.API.Requests.Responses;
using osuTK.Graphics;
namespace osu.Game.Overlays.Changelog
{
2020-03-05 04:08:58 +08:00
public class ChangelogUpdateStreamItem : OverlayStreamItem<APIUpdateStream>
{
public ChangelogUpdateStreamItem(APIUpdateStream stream)
: base(stream)
{
2020-03-04 05:35:32 +08:00
if (stream.IsFeatured)
2020-03-04 05:40:10 +08:00
Width *= 2;
2020-03-03 22:10:25 +08:00
}
2020-03-05 04:06:16 +08:00
protected override string MainText => Value.DisplayName;
2020-03-05 04:06:16 +08:00
protected override string AdditionalText => Value.LatestBuild.DisplayVersion;
2020-03-05 04:06:16 +08:00
protected override string InfoText => Value.LatestBuild.Users > 0 ? $"{"user".ToQuantity(Value.LatestBuild.Users, "N0")} online" : null;
protected override Color4 GetBarColour(OsuColour colours) => Value.Colour;
}
}