2020-03-03 22:01:58 +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 Humanizer;
|
2020-03-04 05:28:47 +08:00
|
|
|
|
using osu.Game.Graphics;
|
2020-03-03 22:01:58 +08:00
|
|
|
|
using osu.Game.Online.API.Requests.Responses;
|
|
|
|
|
using osuTK.Graphics;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Changelog
|
|
|
|
|
{
|
|
|
|
|
public class ChangelogUpdateStreamItem : OverlayUpdateStreamItem<APIUpdateStream>
|
|
|
|
|
{
|
|
|
|
|
public ChangelogUpdateStreamItem(APIUpdateStream stream)
|
|
|
|
|
: base(stream)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-03 22:10:25 +08:00
|
|
|
|
protected override float GetWidth()
|
|
|
|
|
{
|
|
|
|
|
if (Value.IsFeatured)
|
|
|
|
|
return base.GetWidth() * 2;
|
|
|
|
|
|
|
|
|
|
return base.GetWidth();
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-03 22:01:58 +08:00
|
|
|
|
protected override string GetMainText() => Value.DisplayName;
|
|
|
|
|
|
|
|
|
|
protected override string GetAdditionalText() => Value.LatestBuild.DisplayVersion;
|
|
|
|
|
|
|
|
|
|
protected override string GetInfoText() => Value.LatestBuild.Users > 0 ? $"{"user".ToQuantity(Value.LatestBuild.Users, "N0")} online" : null;
|
|
|
|
|
|
2020-03-04 05:28:47 +08:00
|
|
|
|
protected override Color4 GetBarColour(OsuColour colours) => Value.Colour;
|
2020-03-03 22:01:58 +08:00
|
|
|
|
}
|
|
|
|
|
}
|