1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-30 09:22:54 +08:00
osu-lazer/osu.Game/Users/UserStatus.cs

46 lines
1.3 KiB
C#
Raw Normal View History

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