mirror of https://github.com/ppy/osu
Merge pull request #10472 from LeNitrous/expose-player-isbreaktime
Expose BreakTracker.IsBreakTime in Player
This commit is contained in:
commit
a246991c50
|
@ -89,6 +89,11 @@ public class Player : ScreenWithBeatmapBackground
|
|||
|
||||
public BreakOverlay BreakOverlay;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the gameplay is currently in a break.
|
||||
/// </summary>
|
||||
public readonly IBindable<bool> IsBreakTime = new BindableBool();
|
||||
|
||||
private BreakTracker breakTracker;
|
||||
|
||||
private SkipOverlay skipOverlay;
|
||||
|
@ -226,7 +231,6 @@ private void load(AudioManager audio, OsuConfigManager config, OsuGame game)
|
|||
|
||||
DrawableRuleset.IsPaused.BindValueChanged(_ => updateGameplayState());
|
||||
DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updateGameplayState());
|
||||
breakTracker.IsBreakTime.BindValueChanged(_ => updateGameplayState());
|
||||
|
||||
DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updatePauseOnFocusLostState(), true);
|
||||
|
||||
|
@ -256,7 +260,8 @@ private void load(AudioManager audio, OsuConfigManager config, OsuGame game)
|
|||
foreach (var mod in Mods.Value.OfType<IApplicableToHealthProcessor>())
|
||||
mod.ApplyToHealthProcessor(HealthProcessor);
|
||||
|
||||
breakTracker.IsBreakTime.BindValueChanged(onBreakTimeChanged, true);
|
||||
IsBreakTime.BindTo(breakTracker.IsBreakTime);
|
||||
IsBreakTime.BindValueChanged(onBreakTimeChanged, true);
|
||||
}
|
||||
|
||||
private Drawable createUnderlayComponents() =>
|
||||
|
@ -354,6 +359,7 @@ private Drawable createUnderlayComponents() =>
|
|||
|
||||
private void onBreakTimeChanged(ValueChangedEvent<bool> isBreakTime)
|
||||
{
|
||||
updateGameplayState();
|
||||
updatePauseOnFocusLostState();
|
||||
HUDOverlay.KeyCounter.IsCounting = !isBreakTime.NewValue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue