1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 06:42:56 +08:00

Disable overlay activation when in gameplay.

This commit is contained in:
Lucas A 2020-08-02 21:34:35 +02:00
parent 4522564668
commit f1ba576438

View File

@ -63,6 +63,8 @@ namespace osu.Game.Screens.Play
private Bindable<bool> mouseWheelDisabled;
private Bindable<bool> gameplayOverlaysDisabled;
private readonly Bindable<bool> storyboardReplacesBackground = new Bindable<bool>();
public int RestartCount;
@ -77,6 +79,9 @@ namespace osu.Game.Screens.Play
[Resolved]
private IAPIProvider api { get; set; }
[Resolved]
private OsuGame game { get; set; }
private SampleChannel sampleRestart;
public BreakOverlay BreakOverlay;
@ -165,6 +170,7 @@ namespace osu.Game.Screens.Play
sampleRestart = audio.Samples.Get(@"Gameplay/restart");
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
gameplayOverlaysDisabled = config.GetBindable<bool>(OsuSetting.GameplayDisableOverlayActivation);
DrawableRuleset = ruleset.CreateDrawableRulesetWith(playableBeatmap, Mods.Value);
@ -197,6 +203,13 @@ namespace osu.Game.Screens.Play
skipOverlay.Hide();
}
gameplayOverlaysDisabled.ValueChanged += disabled =>
{
game.OverlayActivationMode.Value = disabled.NewValue && !DrawableRuleset.IsPaused.Value ? OverlayActivation.Disabled : OverlayActivation.All;
};
DrawableRuleset.IsPaused.BindValueChanged(_ => gameplayOverlaysDisabled.TriggerChange());
DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updatePauseOnFocusLostState(), true);
// bind clock into components that require it
@ -627,6 +640,8 @@ namespace osu.Game.Screens.Play
foreach (var mod in Mods.Value.OfType<IApplicableToHUD>())
mod.ApplyToHUD(HUDOverlay);
gameplayOverlaysDisabled.TriggerChange();
}
public override void OnSuspending(IScreen next)