1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 11:42:56 +08:00

Make last binding game activity more sensible

This commit is contained in:
Salman Ahmed 2021-02-05 20:39:57 +03:00
parent 8d18c7e929
commit f29938e15d

View File

@ -80,6 +80,9 @@ namespace osu.Game.Screens.Play
public int RestartCount;
[Resolved]
private OsuGameBase gameBase { get; set; }
[Resolved]
private ScoreManager scoreManager { get; set; }
@ -157,7 +160,8 @@ namespace osu.Game.Screens.Play
if (!Mods.Value.Any(m => m is ModAutoplay))
PrepareReplay();
// needs to be bound here as the last binding, otherwise starting a replay while not focused causes player to exit.
// needs to be bound here as the last binding, otherwise cases like starting a replay while not focused causes player to exit, if activity is bound before checks.
gameActive.BindTo(gameBase.IsActive);
gameActive.BindValueChanged(_ => updatePauseOnFocusLostState(), true);
}
@ -191,8 +195,6 @@ namespace osu.Game.Screens.Play
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
gameActive.BindTo(gameBase.IsActive);
if (game != null)
LocalUserPlaying.BindTo(game.LocalUserPlaying);
@ -429,7 +431,7 @@ namespace osu.Game.Screens.Play
private void updatePauseOnFocusLostState()
{
if (!IsLoaded || !PauseOnFocusLost || DrawableRuleset.HasReplayLoaded.Value || breakTracker.IsBreakTime.Value)
if (!PauseOnFocusLost || DrawableRuleset.HasReplayLoaded.Value || breakTracker.IsBreakTime.Value)
return;
if (gameActive.Value == false)