1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 14:17:26 +08:00
osu-lazer/osu.Game/Users/UserStatus.cs
Nobbele ad8ba37ee3
Updated UserStatus.cs to make more sense(UNTESTED)
Untested code, on my ipad in school so i can’t compile the code or check for refrences to stuff

Modding, playing multiplayer/singleplayer, Busy, etc are all done when user is online so they may just be a class of type UserStatusOnline(used to be UserStatusAvailable but since available and online are basically the same i just made available be online). I don’t know how PM’s are handled but i assume that the client recieves the PM and then decides what to do based on your status. By doing this you can interupt the user with the message if typeof(status) != typeof(UserStatusBusy), making multiplaying, solo game, etc not interupt the user, but when typeof(status) == typeof(UserStatusBusy) show a less intrusive message box to not interupt the user
2018-04-26 12:57:24 +02:00

64 lines
1.9 KiB
C#

// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Graphics;
using osu.Game.Graphics;
namespace osu.Game.Users
{
public abstract class UserStatus
{
public abstract string Message { get; }
public abstract Color4 GetAppropriateColour(OsuColour colours);
}
public class UserStatusOnline : UserStatus
{
public override string Message => @"Online";
public override Color4 GetAppropriateColour(OsuColour colours) => colours.BlueDarker;
}
public abstract class UserStatusBusy : UserStatusOnline
{
public override Color4 GetAppropriateColour(OsuColour colours) => colours.YellowDark;
}
public class UserStatusOffline : UserStatus
{
public override string Message => @"Offline";
public override Color4 GetAppropriateColour(OsuColour colours) => colours.Gray7;
}
public class UserStatusSpectating : UserStatusOnline
{
public override string Message => @"Spectating a game";
}
public class UserStatusInLobby : UserStatusOnline
{
public override string Message => @"in Multiplayer Lobby";
}
public class UserStatusSoloGame : UserStatusBusy
{
public override string Message => @"Solo Game";
}
public class UserStatusMultiplayerGame : UserStatusBusy
{
public override string Message => @"Multiplaying";
}
public class UserStatusModding : UserStatusOnline
{
public override string Message => @"Modding a map";
public override Color4 GetAppropriateColour(OsuColour colours) => colours.PurpleDark;
}
public class UserStatusDoNotDisturb : UserStatusBusy
{
public override string Message => @"Do not disturb";
public override Color4 GetAppropriateColour(OsuColour colours) => colours.RedDark;
}
}