mirror of
https://github.com/ppy/osu
synced 2024-12-14 10:57:41 +00:00
Don't automatically pause when window is inactive if in break time
This commit is contained in:
parent
6c8f325063
commit
75f9250645
@ -135,7 +135,7 @@ namespace osu.Game.Screens.Play
|
||||
addGameplayComponents(GameplayClockContainer, working);
|
||||
addOverlayComponents(GameplayClockContainer, working);
|
||||
|
||||
DrawableRuleset.HasReplayLoaded.BindValueChanged(e => HUDOverlay.HoldToQuit.PauseOnFocusLost = !e.NewValue && PauseOnFocusLost, true);
|
||||
DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updatePauseOnFocusLostState(), true);
|
||||
|
||||
// bind clock into components that require it
|
||||
DrawableRuleset.IsPaused.BindTo(GameplayClockContainer.IsPaused);
|
||||
@ -146,6 +146,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
foreach (var mod in Mods.Value.OfType<IApplicableToScoreProcessor>())
|
||||
mod.ApplyToScoreProcessor(ScoreProcessor);
|
||||
breakOverlay.IsBreakTime.ValueChanged += _ => updatePauseOnFocusLostState();
|
||||
}
|
||||
|
||||
private void addUnderlayComponents(Container target)
|
||||
@ -241,6 +242,11 @@ namespace osu.Game.Screens.Play
|
||||
});
|
||||
}
|
||||
|
||||
private void updatePauseOnFocusLostState() =>
|
||||
HUDOverlay.HoldToQuit.PauseOnFocusLost = PauseOnFocusLost
|
||||
&& !DrawableRuleset.HasReplayLoaded.Value
|
||||
&& !breakOverlay.IsBreakTime.Value;
|
||||
|
||||
private WorkingBeatmap loadBeatmap()
|
||||
{
|
||||
WorkingBeatmap working = Beatmap.Value;
|
||||
|
Loading…
Reference in New Issue
Block a user