1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 20:22:55 +08:00

Added UserActivity class holding information about the current activity for the local user

This commit is contained in:
Lucas A 2019-05-05 20:07:55 +02:00
parent a4a2ce5ec0
commit b216635488
3 changed files with 72 additions and 56 deletions

View File

@ -25,6 +25,8 @@ namespace osu.Game.Users
public Bindable<UserStatus> Status = new Bindable<UserStatus>(); public Bindable<UserStatus> Status = new Bindable<UserStatus>();
public Bindable<UserActivity> Activity = new Bindable<UserActivity>();
//public Team Team; //public Team Team;
[JsonProperty(@"profile_colour")] [JsonProperty(@"profile_colour")]

View File

@ -0,0 +1,70 @@
// 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 osu.Game.Beatmaps;
using osu.Game.Graphics;
using osuTK.Graphics;
namespace osu.Game.Users
{
public abstract class UserActivity
{
public abstract string Status { get; }
public virtual Color4 GetAppropriateColour(OsuColour colours) => colours.GreenDarker;
}
public class UserActivityModding : UserActivity
{
public override string Status => "Modding a map";
public override Color4 GetAppropriateColour(OsuColour colours) => colours.PurpleDark;
}
public class UserActivityChoosingBeatmap : UserActivity
{
public override string Status => "Choosing a beatmap";
}
public class UserActivityMultiplayerGame : UserActivity
{
public override string Status => "Multiplaying";
}
public class UserActivityEditing : UserActivity
{
public UserActivityEditing(BeatmapInfo info)
{
Beatmap = info;
}
public override string Status => @"Editing a beatmap";
public BeatmapInfo Beatmap { get; }
}
public class UserActivitySoloGame : UserActivity
{
public UserActivitySoloGame(BeatmapInfo info, Rulesets.RulesetInfo ruleset)
{
Beatmap = info;
Ruleset = ruleset;
}
public override string Status => @"Solo Game";
public BeatmapInfo Beatmap { get; }
public Rulesets.RulesetInfo Ruleset { get; }
}
public class UserActivitySpectating : UserActivity
{
public override string Status => @"Spectating a game";
}
public class UserActivityInLobby : UserActivity
{
public override string Status => @"in Multiplayer Lobby";
}
}

View File

@ -3,7 +3,6 @@
using osuTK.Graphics; using osuTK.Graphics;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Beatmaps;
namespace osu.Game.Users namespace osu.Game.Users
{ {
@ -30,61 +29,6 @@ namespace osu.Game.Users
public override Color4 GetAppropriateColour(OsuColour colours) => colours.Gray7; 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 UserStatusSoloGame(BeatmapInfo info, Rulesets.RulesetInfo ruleset)
{
Beatmap = info;
Ruleset = ruleset;
}
public override string Message => @"Solo Game";
public BeatmapInfo Beatmap { get; }
public Rulesets.RulesetInfo Ruleset { get; }
}
public class UserStatusEditing : UserStatusBusy
{
public UserStatusEditing(BeatmapInfo info)
{
Beatmap = info;
}
public override string Message => @"Editing a beatmap";
public override Color4 GetAppropriateColour(OsuColour colours) => colours.GreenDarker;
public BeatmapInfo Beatmap { get; }
}
public class UserStatusChoosingBeatmap : UserStatusOnline
{
public override string Message => @"Choosing a beatmap";
}
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 : UserStatus public class UserStatusDoNotDisturb : UserStatus
{ {
public override string Message => @"Do not disturb"; public override string Message => @"Do not disturb";