mirror of
https://github.com/ppy/osu
synced 2024-12-10 17:12:57 +00:00
Apply review suggestions.
This commit is contained in:
parent
25ebb8619d
commit
242a035f7e
@ -14,11 +14,11 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
private OverlayTestPlayer testPlayer;
|
||||
|
||||
[Resolved]
|
||||
private OsuConfigManager mng { get; set; }
|
||||
private OsuConfigManager config { get; set; }
|
||||
|
||||
public override void SetUpSteps()
|
||||
{
|
||||
AddStep("disable overlay activation during gameplay", () => mng.Set(OsuSetting.GameplayDisableOverlayActivation, true));
|
||||
AddStep("disable overlay activation during gameplay", () => config.Set(OsuSetting.GameplayDisableOverlayActivation, true));
|
||||
base.SetUpSteps();
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,10 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private SkipOverlay skipOverlay;
|
||||
|
||||
protected readonly Bindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.Disabled);
|
||||
/// <summary>
|
||||
/// The current activation mode for overlays.
|
||||
/// </summary>
|
||||
protected readonly Bindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.UserTriggered);
|
||||
|
||||
protected ScoreProcessor ScoreProcessor { get; private set; }
|
||||
|
||||
@ -208,15 +211,9 @@ namespace osu.Game.Screens.Play
|
||||
if (game != null)
|
||||
OverlayActivationMode.BindTo(game.OverlayActivationMode);
|
||||
|
||||
gameplayOverlaysDisabled.ValueChanged += disabled =>
|
||||
{
|
||||
if (DrawableRuleset.HasReplayLoaded.Value)
|
||||
OverlayActivationMode.Value = OverlayActivation.UserTriggered;
|
||||
else
|
||||
OverlayActivationMode.Value = disabled.NewValue && !DrawableRuleset.IsPaused.Value ? OverlayActivation.Disabled : OverlayActivation.UserTriggered;
|
||||
};
|
||||
DrawableRuleset.IsPaused.BindValueChanged(_ => gameplayOverlaysDisabled.TriggerChange());
|
||||
DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => gameplayOverlaysDisabled.TriggerChange());
|
||||
gameplayOverlaysDisabled.ValueChanged += disabled => updateOverlayActivationMode();
|
||||
DrawableRuleset.IsPaused.BindValueChanged(_ => updateOverlayActivationMode());
|
||||
DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updateOverlayActivationMode());
|
||||
|
||||
DrawableRuleset.HasReplayLoaded.BindValueChanged(_ => updatePauseOnFocusLostState(), true);
|
||||
|
||||
@ -362,6 +359,14 @@ namespace osu.Game.Screens.Play
|
||||
HUDOverlay.KeyCounter.IsCounting = !isBreakTime.NewValue;
|
||||
}
|
||||
|
||||
private void updateOverlayActivationMode()
|
||||
{
|
||||
if (DrawableRuleset.HasReplayLoaded.Value)
|
||||
OverlayActivationMode.Value = OverlayActivation.UserTriggered;
|
||||
else
|
||||
OverlayActivationMode.Value = gameplayOverlaysDisabled.Value && !DrawableRuleset.IsPaused.Value ? OverlayActivation.Disabled : OverlayActivation.UserTriggered;
|
||||
}
|
||||
|
||||
private void updatePauseOnFocusLostState() =>
|
||||
HUDOverlay.HoldToQuit.PauseOnFocusLost = PauseOnFocusLost
|
||||
&& !DrawableRuleset.HasReplayLoaded.Value
|
||||
|
Loading…
Reference in New Issue
Block a user