2019-01-24 08:43:03 +00: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.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2023-12-06 17:21:44 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.ComponentModel;
|
2022-01-28 04:53:48 +00:00
|
|
|
|
using osu.Framework.Localisation;
|
2018-11-20 07:51:59 +00:00
|
|
|
|
using osuTK.Graphics;
|
2017-05-22 06:11:42 +00:00
|
|
|
|
using osu.Game.Graphics;
|
2022-01-28 04:53:48 +00:00
|
|
|
|
using osu.Game.Resources.Localisation.Web;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-05-22 06:11:42 +00:00
|
|
|
|
namespace osu.Game.Users
|
|
|
|
|
{
|
2023-12-06 17:21:44 +00:00
|
|
|
|
public enum UserStatus
|
2017-05-22 06:11:42 +00:00
|
|
|
|
{
|
2023-12-06 17:21:44 +00:00
|
|
|
|
[LocalisableDescription(typeof(UsersStrings), nameof(UsersStrings.StatusOffline))]
|
|
|
|
|
Offline,
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2023-12-06 17:21:44 +00:00
|
|
|
|
[Description("Do not disturb")]
|
|
|
|
|
DoNotDisturb,
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2023-12-06 17:21:44 +00:00
|
|
|
|
[LocalisableDescription(typeof(UsersStrings), nameof(UsersStrings.StatusOnline))]
|
|
|
|
|
Online,
|
2017-05-22 06:11:42 +00:00
|
|
|
|
}
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2023-12-06 17:21:44 +00:00
|
|
|
|
public static class UserStatusExtensions
|
2017-05-22 15:37:19 +00:00
|
|
|
|
{
|
2023-12-06 17:21:44 +00:00
|
|
|
|
public static Color4 GetAppropriateColour(this UserStatus userStatus, OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
switch (userStatus)
|
|
|
|
|
{
|
|
|
|
|
case UserStatus.Offline:
|
|
|
|
|
return Color4.Black;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2023-12-06 17:21:44 +00:00
|
|
|
|
case UserStatus.DoNotDisturb:
|
|
|
|
|
return colours.RedDark;
|
|
|
|
|
|
|
|
|
|
case UserStatus.Online:
|
|
|
|
|
return colours.GreenDark;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
throw new ArgumentOutOfRangeException(nameof(userStatus), userStatus, "Unsupported user status");
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-05-25 00:09:18 +00:00
|
|
|
|
}
|
2017-05-22 06:11:42 +00:00
|
|
|
|
}
|