1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 12:47:25 +08:00
osu-lazer/osu.Game/Overlays/Dashboard/Friends/FriendsOnlineStatusItem.cs

40 lines
1.1 KiB
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 System;
using osu.Game.Graphics;
using osuTK.Graphics;
2020-03-16 14:42:21 +08:00
namespace osu.Game.Overlays.Dashboard.Friends
{
2020-03-23 09:47:27 +08:00
public class FriendsOnlineStatusItem : OverlayStreamItem<FriendStream>
{
2020-03-23 09:47:27 +08:00
public FriendsOnlineStatusItem(FriendStream value)
: base(value)
{
}
2020-03-05 04:06:16 +08:00
protected override string MainText => Value.Status.ToString();
2020-03-05 04:06:16 +08:00
protected override string AdditionalText => Value.Count.ToString();
protected override Color4 GetBarColour(OsuColour colours)
{
switch (Value.Status)
{
2020-03-23 09:47:27 +08:00
case OnlineStatus.All:
return Color4.White;
2020-03-23 09:47:27 +08:00
case OnlineStatus.Online:
return colours.GreenLight;
2020-03-23 09:47:27 +08:00
case OnlineStatus.Offline:
return Color4.Black;
default:
throw new ArgumentException($@"{Value.Status} status does not provide a colour in {nameof(GetBarColour)}.");
}
}
}
}