diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index b57205952d..c31f21f147 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -85,6 +85,12 @@ namespace osu.Game.Screens.Play protected Task? DisposalTask { get; private set; } + /// + /// By default, the loader screen will block until the window is focused. + /// Can be overridden by setting this to false. + /// + protected bool WindowShouldBeActiveForGameplayStart { get; init; } = true; + private FillFlowContainer disclaimers = null!; private GridContainer sideContent = null!; @@ -125,7 +131,7 @@ namespace osu.Game.Screens.Play } protected virtual bool ReadyForGameplay => - host.IsActive.Value && + (!WindowShouldBeActiveForGameplayStart || host.IsActive.Value) && // not ready if the user is hovering one of the panes (logo is excluded), unless they are idle. (IsHovered || osuLogo?.IsHovered == true || idleTracker.IsIdle.Value) // not ready if the user is dragging a slider or otherwise. diff --git a/osu.Game/Screens/Play/ReplayPlayerLoader.cs b/osu.Game/Screens/Play/ReplayPlayerLoader.cs index 7da06fe506..fd3a07889d 100644 --- a/osu.Game/Screens/Play/ReplayPlayerLoader.cs +++ b/osu.Game/Screens/Play/ReplayPlayerLoader.cs @@ -18,6 +18,7 @@ namespace osu.Game.Screens.Play throw new ArgumentException($"{nameof(score)} must have a non-null {nameof(score.Replay)}.", nameof(score)); Score = score.ScoreInfo; + WindowShouldBeActiveForGameplayStart = false; } public override void OnEntering(ScreenTransitionEvent e) diff --git a/osu.Game/Screens/Play/SpectatorPlayerLoader.cs b/osu.Game/Screens/Play/SpectatorPlayerLoader.cs index 8f2bcfe046..a9c90e6364 100644 --- a/osu.Game/Screens/Play/SpectatorPlayerLoader.cs +++ b/osu.Game/Screens/Play/SpectatorPlayerLoader.cs @@ -18,6 +18,7 @@ namespace osu.Game.Screens.Play throw new ArgumentException($"{nameof(score)} must have a non-null {nameof(score.Replay)}.", nameof(score)); Score = score.ScoreInfo; + WindowShouldBeActiveForGameplayStart = false; } public override void OnEntering(ScreenTransitionEvent e)