mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 04:02:57 +08: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);
|
addGameplayComponents(GameplayClockContainer, working);
|
||||||
addOverlayComponents(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
|
// bind clock into components that require it
|
||||||
DrawableRuleset.IsPaused.BindTo(GameplayClockContainer.IsPaused);
|
DrawableRuleset.IsPaused.BindTo(GameplayClockContainer.IsPaused);
|
||||||
@ -146,6 +146,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
foreach (var mod in Mods.Value.OfType<IApplicableToScoreProcessor>())
|
foreach (var mod in Mods.Value.OfType<IApplicableToScoreProcessor>())
|
||||||
mod.ApplyToScoreProcessor(ScoreProcessor);
|
mod.ApplyToScoreProcessor(ScoreProcessor);
|
||||||
|
breakOverlay.IsBreakTime.ValueChanged += _ => updatePauseOnFocusLostState();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addUnderlayComponents(Container target)
|
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()
|
private WorkingBeatmap loadBeatmap()
|
||||||
{
|
{
|
||||||
WorkingBeatmap working = Beatmap.Value;
|
WorkingBeatmap working = Beatmap.Value;
|
||||||
|
Loading…
Reference in New Issue
Block a user