From a553942a7ff141ecf4aee4a75bcbc5e58f80816e Mon Sep 17 00:00:00 2001 From: Nathan Alo Date: Sat, 14 Aug 2021 13:20:36 +0800 Subject: [PATCH] update `InitialActivity` on multiplayer `Player` and `SongSelect` --- .../OnlinePlay/Multiplayer/MultiplayerMatchSongSelect.cs | 6 ++++++ .../Screens/OnlinePlay/Multiplayer/MultiplayerPlayer.cs | 3 +++ osu.Game/Users/UserActivity.cs | 9 +++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSongSelect.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSongSelect.cs index 3733b85a5e..7efcec50db 100644 --- a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSongSelect.cs +++ b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSongSelect.cs @@ -11,6 +11,7 @@ using osu.Game.Online.Rooms; using osu.Game.Rulesets; using osu.Game.Rulesets.Mods; using osu.Game.Screens.Select; +using osu.Game.Users; namespace osu.Game.Screens.OnlinePlay.Multiplayer { @@ -19,8 +20,13 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer [Resolved] private MultiplayerClient client { get; set; } + [Resolved] + private Room room { get; set; } + private LoadingLayer loadingLayer; + protected override UserActivity InitialActivity => new UserActivity.InLobby(room); + /// /// Construct a new instance of multiplayer song select. /// diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerPlayer.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerPlayer.cs index ca1a3710ab..7e9d0a423f 100644 --- a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerPlayer.cs +++ b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerPlayer.cs @@ -17,6 +17,7 @@ using osu.Game.Scoring; using osu.Game.Screens.Play; using osu.Game.Screens.Play.HUD; using osu.Game.Screens.Ranking; +using osu.Game.Users; using osuTK; namespace osu.Game.Screens.OnlinePlay.Multiplayer @@ -25,6 +26,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer { protected override bool PauseOnFocusLost => false; + protected override UserActivity InitialActivity => new UserActivity.MultiplayerGame(Beatmap.Value.BeatmapInfo, Ruleset.Value); + // Disallow fails in multiplayer for now. protected override bool CheckModsAllowFailure() => false; diff --git a/osu.Game/Users/UserActivity.cs b/osu.Game/Users/UserActivity.cs index f633773d11..17c028af7d 100644 --- a/osu.Game/Users/UserActivity.cs +++ b/osu.Game/Users/UserActivity.cs @@ -25,9 +25,14 @@ namespace osu.Game.Users public override string Status => "Choosing a beatmap"; } - public class MultiplayerGame : UserActivity + public class MultiplayerGame : SoloGame { - public override string Status => "Playing with others"; + public MultiplayerGame(BeatmapInfo beatmap, RulesetInfo ruleset) + : base(beatmap, ruleset) + { + } + + public override string Status => $@"{base.Status} with others"; } public class Editing : UserActivity