Bind to local bindable and combine dual bindings

This commit is contained in:
Dean Herbert
2020-10-11 21:51:48 +09:00
parent 5fcdee6fd8
commit de6fe34361

View File

@ -231,7 +231,6 @@ namespace osu.Game.Screens.Play
DrawableRuleset.IsPaused.BindValueChanged(_ => updateGameplayState()); DrawableRuleset.IsPaused.BindValueChanged(_ => updateGameplayState());
DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updateGameplayState()); DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updateGameplayState());
breakTracker.IsBreakTime.BindValueChanged(_ => updateGameplayState());
DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updatePauseOnFocusLostState(), true); DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updatePauseOnFocusLostState(), true);
@ -262,7 +261,7 @@ namespace osu.Game.Screens.Play
mod.ApplyToHealthProcessor(HealthProcessor); mod.ApplyToHealthProcessor(HealthProcessor);
IsBreakTime.BindTo(breakTracker.IsBreakTime); IsBreakTime.BindTo(breakTracker.IsBreakTime);
breakTracker.IsBreakTime.BindValueChanged(onBreakTimeChanged, true); IsBreakTime.BindValueChanged(onBreakTimeChanged, true);
} }
private Drawable createUnderlayComponents() => private Drawable createUnderlayComponents() =>
@ -360,6 +359,7 @@ namespace osu.Game.Screens.Play
private void onBreakTimeChanged(ValueChangedEvent<bool> isBreakTime) private void onBreakTimeChanged(ValueChangedEvent<bool> isBreakTime)
{ {
updateGameplayState();
updatePauseOnFocusLostState(); updatePauseOnFocusLostState();
HUDOverlay.KeyCounter.IsCounting = !isBreakTime.NewValue; HUDOverlay.KeyCounter.IsCounting = !isBreakTime.NewValue;
} }