2020-03-03 22:37:01 +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.
|
|
|
|
|
|
2020-03-04 05:28:47 +08:00
|
|
|
|
using System;
|
|
|
|
|
using osu.Game.Graphics;
|
2020-03-03 22:37:01 +08:00
|
|
|
|
using osuTK.Graphics;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Home.Friends
|
|
|
|
|
{
|
|
|
|
|
public class FriendsOnlineStatusItem : OverlayUpdateStreamItem<FriendsBundle>
|
|
|
|
|
{
|
|
|
|
|
public FriendsOnlineStatusItem(FriendsBundle value)
|
|
|
|
|
: base(value)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-04 05:39:12 +08:00
|
|
|
|
protected override string GetMainText => Value.Status.ToString();
|
2020-03-03 22:37:01 +08:00
|
|
|
|
|
2020-03-04 05:39:12 +08:00
|
|
|
|
protected override string GetAdditionalText => Value.Count.ToString();
|
2020-03-03 22:37:01 +08:00
|
|
|
|
|
2020-03-04 05:28:47 +08:00
|
|
|
|
protected override Color4 GetBarColour(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
switch (Value.Status)
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
throw new ArgumentException($@"{Value.Status} status does not provide a colour in {nameof(GetBarColour)}.");
|
|
|
|
|
|
|
|
|
|
case FriendsOnlineStatus.All:
|
|
|
|
|
return Color4.White;
|
|
|
|
|
|
|
|
|
|
case FriendsOnlineStatus.Online:
|
|
|
|
|
return colours.GreenLight;
|
|
|
|
|
|
|
|
|
|
case FriendsOnlineStatus.Offline:
|
|
|
|
|
return Color4.Black;
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-03-03 22:37:01 +08:00
|
|
|
|
}
|
|
|
|
|
}
|