From 7e3cc7cc33fce4c76e70f8f1edbe76baf98cab6c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 12 May 2026 17:54:48 +0900 Subject: [PATCH] Allow spectator and replay gameplay to load even when window is inactive (#37633) This used to be the case, but recently changed with the introduction of [pausing when inactive](https://github.com/ppy/osu/pull/37100). The change was intended to work for local gameplay modes, but it makes less sense for spectator/replay where you may want to be watching in the background while doing something else. Raised via email. --- osu.Game/Screens/Play/PlayerLoader.cs | 8 +++++++- osu.Game/Screens/Play/ReplayPlayerLoader.cs | 1 + osu.Game/Screens/Play/SpectatorPlayerLoader.cs | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) 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)