From b216635488b934bc1a6c114750184879d6fdcac8 Mon Sep 17 00:00:00 2001 From: Lucas A Date: Sun, 5 May 2019 20:07:55 +0200 Subject: [PATCH] Added UserActivity class holding information about the current activity for the local user --- osu.Game/Users/User.cs | 2 + osu.Game/Users/UserActivity.cs | 70 ++++++++++++++++++++++++++++++++++ osu.Game/Users/UserStatus.cs | 56 --------------------------- 3 files changed, 72 insertions(+), 56 deletions(-) create mode 100644 osu.Game/Users/UserActivity.cs diff --git a/osu.Game/Users/User.cs b/osu.Game/Users/User.cs index 314684069a..cf67af7bb8 100644 --- a/osu.Game/Users/User.cs +++ b/osu.Game/Users/User.cs @@ -25,6 +25,8 @@ namespace osu.Game.Users public Bindable Status = new Bindable(); + public Bindable Activity = new Bindable(); + //public Team Team; [JsonProperty(@"profile_colour")] diff --git a/osu.Game/Users/UserActivity.cs b/osu.Game/Users/UserActivity.cs new file mode 100644 index 0000000000..1e69cc3e8e --- /dev/null +++ b/osu.Game/Users/UserActivity.cs @@ -0,0 +1,70 @@ +// Copyright (c) ppy Pty Ltd . 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"; + } + + +} diff --git a/osu.Game/Users/UserStatus.cs b/osu.Game/Users/UserStatus.cs index 0ee12ed63f..cf372560af 100644 --- a/osu.Game/Users/UserStatus.cs +++ b/osu.Game/Users/UserStatus.cs @@ -3,7 +3,6 @@ using osuTK.Graphics; using osu.Game.Graphics; -using osu.Game.Beatmaps; namespace osu.Game.Users { @@ -30,61 +29,6 @@ namespace osu.Game.Users 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 override string Message => @"Do not disturb";