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
|
|
|
|
|
{
|
2020-03-05 04:08:58 +08:00
|
|
|
|
public class FriendsOnlineStatusItem : OverlayStreamItem<FriendsBundle>
|
2020-03-03 22:37:01 +08:00
|
|
|
|
{
|
|
|
|
|
public FriendsOnlineStatusItem(FriendsBundle value)
|
|
|
|
|
: base(value)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-05 04:06:16 +08:00
|
|
|
|
protected override string MainText => Value.Status.ToString();
|
2020-03-03 22:37:01 +08:00
|
|
|
|
|
2020-03-05 04:06:16 +08:00
|
|
|
|
protected override string AdditionalText => 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)
|
|
|
|
|
{
|
|
|
|
|
case FriendsOnlineStatus.All:
|
|
|
|
|
return Color4.White;
|
|
|
|
|
|
|
|
|
|
case FriendsOnlineStatus.Online:
|
|
|
|
|
return colours.GreenLight;
|
|
|
|
|
|
|
|
|
|
case FriendsOnlineStatus.Offline:
|
|
|
|
|
return Color4.Black;
|
2020-03-05 04:03:02 +08:00
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
throw new ArgumentException($@"{Value.Status} status does not provide a colour in {nameof(GetBarColour)}.");
|
2020-03-04 05:28:47 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-03-03 22:37:01 +08:00
|
|
|
|
}
|
|
|
|
|
}
|