mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 04:32:57 +08:00
d66fa09320
There were absolutely no gains from having it be a reference type / class, only complications, especially when coming from the serialisation angle.
46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
// 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 System.ComponentModel;
|
|
using osu.Framework.Localisation;
|
|
using osuTK.Graphics;
|
|
using osu.Game.Graphics;
|
|
using osu.Game.Resources.Localisation.Web;
|
|
|
|
namespace osu.Game.Users
|
|
{
|
|
public enum UserStatus
|
|
{
|
|
[LocalisableDescription(typeof(UsersStrings), nameof(UsersStrings.StatusOffline))]
|
|
Offline,
|
|
|
|
[Description("Do not disturb")]
|
|
DoNotDisturb,
|
|
|
|
[LocalisableDescription(typeof(UsersStrings), nameof(UsersStrings.StatusOnline))]
|
|
Online,
|
|
}
|
|
|
|
public static class UserStatusExtensions
|
|
{
|
|
public static Color4 GetAppropriateColour(this UserStatus userStatus, OsuColour colours)
|
|
{
|
|
switch (userStatus)
|
|
{
|
|
case UserStatus.Offline:
|
|
return Color4.Black;
|
|
|
|
case UserStatus.DoNotDisturb:
|
|
return colours.RedDark;
|
|
|
|
case UserStatus.Online:
|
|
return colours.GreenDark;
|
|
|
|
default:
|
|
throw new ArgumentOutOfRangeException(nameof(userStatus), userStatus, "Unsupported user status");
|
|
}
|
|
}
|
|
}
|
|
}
|