diff --git a/osu.Game.Rulesets.Osu/UI/DrawableOsuRuleset.cs b/osu.Game.Rulesets.Osu/UI/DrawableOsuRuleset.cs index 33fe151c34..bc6749c8b2 100644 --- a/osu.Game.Rulesets.Osu/UI/DrawableOsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/UI/DrawableOsuRuleset.cs @@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Osu.UI [BackgroundDependencyLoader] private void load(Player? player) { - if (player is ReplayPlayer || player is SpectatorPlayer) + if (player != null && player.ShowAnalysisSettings) { ReplayAnalysisOverlay analysisOverlay; PlayfieldAdjustmentContainer.Add(analysisOverlay = new ReplayAnalysisOverlay(player.Score.Replay)); diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 216a079085..a4caa34598 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -104,6 +104,8 @@ namespace osu.Game.Screens.Play /// public IBindable ShowingOverlayComponents = new Bindable(); + public virtual bool ShowAnalysisSettings => false; + // Should match PlayerLoader for consistency. Cached here for the rare case we push a Player // without the loading screen (one such usage is the skin editor's scene library). [Cached] @@ -329,6 +331,9 @@ namespace osu.Game.Screens.Play // we may want to limit this in the future to disallow rulesets from outright replacing elements the user expects to be there. failAnimationContainer.Add(createOverlayComponents(Beatmap.Value)); + if (ShowAnalysisSettings) + addReplayAnalysisSettings(); + if (!DrawableRuleset.AllowGameplayOverlays) { HUDOverlay.ShowHud.Value = false; @@ -1298,12 +1303,13 @@ namespace osu.Game.Screens.Play } /// - /// Create and add to settings overlay. + /// Create and add to player settings overlay. /// - protected void AddReplayAnalysisSettings() + private void addReplayAnalysisSettings() { var replayAnalysisSettings = DrawableRuleset.Ruleset.CreateReplayAnalysisSettings(); - if (replayAnalysisSettings is not null) + + if (replayAnalysisSettings != null) HUDOverlay.PlayerSettingsOverlay.Add(replayAnalysisSettings); } diff --git a/osu.Game/Screens/Play/ReplayPlayer.cs b/osu.Game/Screens/Play/ReplayPlayer.cs index 366c3d6d20..05f13949a9 100644 --- a/osu.Game/Screens/Play/ReplayPlayer.cs +++ b/osu.Game/Screens/Play/ReplayPlayer.cs @@ -28,6 +28,8 @@ namespace osu.Game.Screens.Play { public const double BASE_SEEK_AMOUNT = 1000; + public override bool ShowAnalysisSettings => true; + private readonly Func, Score> createScore; private readonly bool replayIsFailedScore; @@ -71,8 +73,6 @@ namespace osu.Game.Screens.Play playbackSettings.UserPlaybackRate.BindTo(master.UserPlaybackRate); HUDOverlay.PlayerSettingsOverlay.AddAtStart(playbackSettings); - - AddReplayAnalysisSettings(); } protected override void PrepareReplay() diff --git a/osu.Game/Screens/Play/SpectatorPlayer.cs b/osu.Game/Screens/Play/SpectatorPlayer.cs index c87b7fbab1..8d7d7a0105 100644 --- a/osu.Game/Screens/Play/SpectatorPlayer.cs +++ b/osu.Game/Screens/Play/SpectatorPlayer.cs @@ -18,6 +18,8 @@ namespace osu.Game.Screens.Play { public abstract partial class SpectatorPlayer : Player { + public override bool ShowAnalysisSettings => true; + [Resolved] protected SpectatorClient SpectatorClient { get; private set; } = null!; @@ -50,8 +52,6 @@ namespace osu.Game.Screens.Play Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, }); - - AddReplayAnalysisSettings(); } protected override void LoadComplete()