From 361c0ec9f26d9c066cb4830e16343bc3d5b6e02b Mon Sep 17 00:00:00 2001 From: Lucas A Date: Sat, 13 Apr 2019 13:18:44 +0200 Subject: [PATCH] Allow UserStatusSoloGame to provide metadata such as the ruleset the current beatmap is played in --- osu.Game.Tests/Visual/Online/TestCaseUserPanel.cs | 2 +- osu.Game/Screens/Play/Player.cs | 2 +- osu.Game/Screens/Play/PlayerLoader.cs | 3 +++ osu.Game/Users/UserStatus.cs | 5 ++++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Visual/Online/TestCaseUserPanel.cs b/osu.Game.Tests/Visual/Online/TestCaseUserPanel.cs index 182ea6da01..90cdd48a1e 100644 --- a/osu.Game.Tests/Visual/Online/TestCaseUserPanel.cs +++ b/osu.Game.Tests/Visual/Online/TestCaseUserPanel.cs @@ -43,7 +43,7 @@ namespace osu.Game.Tests.Visual.Online }); flyte.Status.Value = new UserStatusOnline(); - peppy.Status.Value = new UserStatusSoloGame(new Game.Beatmaps.BeatmapInfo()); + peppy.Status.Value = new UserStatusSoloGame(null, null); AddStep(@"spectating", () => { flyte.Status.Value = new UserStatusSpectating(); }); AddStep(@"multiplaying", () => { flyte.Status.Value = new UserStatusMultiplayerGame(); }); diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index edb6f9f865..97133773fa 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -34,7 +34,7 @@ namespace osu.Game.Screens.Play { protected override bool AllowBackButton => false; // handled by HoldForMenuButton - protected override UserStatus ScreenStatus => new UserStatusSoloGame(Beatmap.Value.BeatmapInfo); + protected override UserStatus ScreenStatus => new UserStatusSoloGame(Beatmap.Value.BeatmapInfo, Ruleset.Value); public override float BackgroundParallaxAmount => 0.1f; diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index e9ee5d3fa8..4d2e3a8cca 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -19,6 +19,7 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Menu; using osu.Game.Screens.Play.HUD; using osu.Game.Screens.Play.PlayerSettings; +using osu.Game.Users; using osuTK; using osuTK.Graphics; @@ -39,6 +40,8 @@ namespace osu.Game.Screens.Play private bool hideOverlays; public override bool HideOverlaysOnEnter => hideOverlays; + protected override UserStatus ScreenStatus => null; //shows the previous screen status + public override bool DisallowExternalBeatmapRulesetChanges => true; private Task loadTask; diff --git a/osu.Game/Users/UserStatus.cs b/osu.Game/Users/UserStatus.cs index 60e637d7e4..39f295f445 100644 --- a/osu.Game/Users/UserStatus.cs +++ b/osu.Game/Users/UserStatus.cs @@ -42,14 +42,17 @@ namespace osu.Game.Users public class UserStatusSoloGame : UserStatusBusy { - public UserStatusSoloGame(BeatmapInfo info) + 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