mirror of
https://github.com/osukey/osukey.git
synced 2025-05-23 14:37:39 +09:00
Disable overlay activation when in gameplay.
This commit is contained in:
parent
4522564668
commit
f1ba576438
@ -63,6 +63,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private Bindable<bool> mouseWheelDisabled;
|
private Bindable<bool> mouseWheelDisabled;
|
||||||
|
|
||||||
|
private Bindable<bool> gameplayOverlaysDisabled;
|
||||||
|
|
||||||
private readonly Bindable<bool> storyboardReplacesBackground = new Bindable<bool>();
|
private readonly Bindable<bool> storyboardReplacesBackground = new Bindable<bool>();
|
||||||
|
|
||||||
public int RestartCount;
|
public int RestartCount;
|
||||||
@ -77,6 +79,9 @@ namespace osu.Game.Screens.Play
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private IAPIProvider api { get; set; }
|
private IAPIProvider api { get; set; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OsuGame game { get; set; }
|
||||||
|
|
||||||
private SampleChannel sampleRestart;
|
private SampleChannel sampleRestart;
|
||||||
|
|
||||||
public BreakOverlay BreakOverlay;
|
public BreakOverlay BreakOverlay;
|
||||||
@ -165,6 +170,7 @@ namespace osu.Game.Screens.Play
|
|||||||
sampleRestart = audio.Samples.Get(@"Gameplay/restart");
|
sampleRestart = audio.Samples.Get(@"Gameplay/restart");
|
||||||
|
|
||||||
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
|
mouseWheelDisabled = config.GetBindable<bool>(OsuSetting.MouseDisableWheel);
|
||||||
|
gameplayOverlaysDisabled = config.GetBindable<bool>(OsuSetting.GameplayDisableOverlayActivation);
|
||||||
|
|
||||||
DrawableRuleset = ruleset.CreateDrawableRulesetWith(playableBeatmap, Mods.Value);
|
DrawableRuleset = ruleset.CreateDrawableRulesetWith(playableBeatmap, Mods.Value);
|
||||||
|
|
||||||
@ -197,6 +203,13 @@ namespace osu.Game.Screens.Play
|
|||||||
skipOverlay.Hide();
|
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);
|
DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updatePauseOnFocusLostState(), true);
|
||||||
|
|
||||||
// bind clock into components that require it
|
// bind clock into components that require it
|
||||||
@ -627,6 +640,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
foreach (var mod in Mods.Value.OfType<IApplicableToHUD>())
|
foreach (var mod in Mods.Value.OfType<IApplicableToHUD>())
|
||||||
mod.ApplyToHUD(HUDOverlay);
|
mod.ApplyToHUD(HUDOverlay);
|
||||||
|
|
||||||
|
gameplayOverlaysDisabled.TriggerChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnSuspending(IScreen next)
|
public override void OnSuspending(IScreen next)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user