From 67db5391729cb62a3461eb3eb448152dc9bc1580 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Fri, 18 May 2018 07:57:12 +0200 Subject: [PATCH 1/4] prevent Overlays from showing in intro/outro sequences --- .../Graphics/Containers/OsuFocusedOverlayContainer.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs index f657c0cae5..c26adc8a3d 100644 --- a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs +++ b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs @@ -7,6 +7,7 @@ using osu.Framework.Audio.Sample; using osu.Framework.Graphics.Containers; using osu.Framework.Input; using OpenTK; +using osu.Framework.Configuration; namespace osu.Game.Graphics.Containers { @@ -15,13 +16,17 @@ namespace osu.Game.Graphics.Containers private SampleChannel samplePopIn; private SampleChannel samplePopOut; + protected BindableBool ShowOverlays = new BindableBool(); + [BackgroundDependencyLoader] - private void load(AudioManager audio) + private void load(OsuGame osuGame, AudioManager audio) { samplePopIn = audio.Sample.Get(@"UI/overlay-pop-in"); samplePopOut = audio.Sample.Get(@"UI/overlay-pop-out"); StateChanged += onStateChanged; + + ShowOverlays.BindTo(osuGame.ShowOverlays); } /// @@ -46,6 +51,9 @@ namespace osu.Game.Graphics.Containers private void onStateChanged(Visibility visibility) { + if (!ShowOverlays) + State = Visibility.Hidden; + switch (visibility) { case Visibility.Visible: From 4d528c4e6703da6e93418e59f3d11db2b13e8031 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Sun, 20 May 2018 10:57:15 +0200 Subject: [PATCH 2/4] fix VisualTests and Samples still playing --- .../Graphics/Containers/OsuFocusedOverlayContainer.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs index c26adc8a3d..1005794742 100644 --- a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs +++ b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs @@ -16,9 +16,9 @@ namespace osu.Game.Graphics.Containers private SampleChannel samplePopIn; private SampleChannel samplePopOut; - protected BindableBool ShowOverlays = new BindableBool(); + protected BindableBool ShowOverlays = new BindableBool(true); - [BackgroundDependencyLoader] + [BackgroundDependencyLoader(true)] private void load(OsuGame osuGame, AudioManager audio) { samplePopIn = audio.Sample.Get(@"UI/overlay-pop-in"); @@ -26,7 +26,8 @@ namespace osu.Game.Graphics.Containers StateChanged += onStateChanged; - ShowOverlays.BindTo(osuGame.ShowOverlays); + if (osuGame != null) + ShowOverlays.BindTo(osuGame.ShowOverlays); } /// @@ -52,7 +53,10 @@ namespace osu.Game.Graphics.Containers private void onStateChanged(Visibility visibility) { if (!ShowOverlays) + { State = Visibility.Hidden; + return; + } switch (visibility) { From 1482bca147a7e152bd109eaf8094ac16d39ffb51 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Mon, 21 May 2018 09:42:29 +0200 Subject: [PATCH 3/4] Rename for better understanding ShowOverlays -> AllowOverlays ShowOverlaysOnEnter -> HideOverlaysOnEnter --- .../Containers/OsuFocusedOverlayContainer.cs | 33 +++++++++---------- osu.Game/OsuGame.cs | 6 ++-- osu.Game/Screens/Edit/Editor.cs | 2 +- osu.Game/Screens/Loader.cs | 2 +- osu.Game/Screens/Menu/ButtonSystem.cs | 10 +++--- osu.Game/Screens/Menu/Disclaimer.cs | 2 +- osu.Game/Screens/Menu/Intro.cs | 2 +- osu.Game/Screens/Menu/MainMenu.cs | 2 +- osu.Game/Screens/OsuScreen.cs | 10 +++--- osu.Game/Screens/Play/Player.cs | 2 +- osu.Game/Screens/Play/PlayerLoader.cs | 6 ++-- osu.Game/Screens/Tournament/Drawings.cs | 2 +- 12 files changed, 40 insertions(+), 39 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs index 1005794742..9c36eb8c18 100644 --- a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs +++ b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs @@ -16,18 +16,18 @@ namespace osu.Game.Graphics.Containers private SampleChannel samplePopIn; private SampleChannel samplePopOut; - protected BindableBool ShowOverlays = new BindableBool(true); + protected BindableBool AllowOverlays = new BindableBool(true); [BackgroundDependencyLoader(true)] private void load(OsuGame osuGame, AudioManager audio) { + if (osuGame != null) + AllowOverlays.BindTo(osuGame.AllowOverlays); + samplePopIn = audio.Sample.Get(@"UI/overlay-pop-in"); samplePopOut = audio.Sample.Get(@"UI/overlay-pop-out"); StateChanged += onStateChanged; - - if (osuGame != null) - ShowOverlays.BindTo(osuGame.ShowOverlays); } /// @@ -52,21 +52,20 @@ namespace osu.Game.Graphics.Containers private void onStateChanged(Visibility visibility) { - if (!ShowOverlays) + if (AllowOverlays) { + switch (visibility) + { + case Visibility.Visible: + samplePopIn?.Play(); + break; + case Visibility.Hidden: + samplePopOut?.Play(); + break; + } + } + else State = Visibility.Hidden; - return; - } - - switch (visibility) - { - case Visibility.Visible: - samplePopIn?.Play(); - break; - case Visibility.Hidden: - samplePopOut?.Play(); - break; - } } } } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index fe5ca4f278..b3da2831cd 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -77,7 +77,7 @@ namespace osu.Game public float ToolbarOffset => Toolbar.Position.Y + Toolbar.DrawHeight; - public readonly BindableBool ShowOverlays = new BindableBool(); + public readonly BindableBool AllowOverlays = new BindableBool(); private OsuScreen screenStack; @@ -367,9 +367,9 @@ namespace osu.Game settings.StateChanged += _ => updateScreenOffset(); notifications.StateChanged += _ => updateScreenOffset(); - notifications.Enabled.BindTo(ShowOverlays); + notifications.Enabled.BindTo(AllowOverlays); - ShowOverlays.ValueChanged += show => + AllowOverlays.ValueChanged += show => { //central game screen change logic. if (!show) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index e4eaee76fc..8049ea2738 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -26,7 +26,7 @@ namespace osu.Game.Screens.Edit { protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4"); - public override bool ShowOverlaysOnEnter => false; + public override bool HideOverlaysOnEnter => true; public override bool AllowBeatmapRulesetChange => false; private Box bottomBackground; diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index 555c497d92..e49fb08087 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -17,7 +17,7 @@ namespace osu.Game.Screens { private bool showDisclaimer; - public override bool ShowOverlaysOnEnter => false; + public override bool HideOverlaysOnEnter => true; protected override bool AllowBackButton => false; diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 997002327a..9ca1a1ce19 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -27,7 +27,7 @@ namespace osu.Game.Screens.Menu { public event Action StateChanged; - private readonly BindableBool showOverlays = new BindableBool(); + private readonly BindableBool allowOverlays = new BindableBool(); public Action OnEdit; public Action OnExit; @@ -135,7 +135,9 @@ namespace osu.Game.Screens.Menu [BackgroundDependencyLoader(true)] private void load(AudioManager audio, OsuGame game) { - if (game != null) showOverlays.BindTo(game.ShowOverlays); + if (game != null) + allowOverlays.BindTo(game.AllowOverlays); + sampleBack = audio.Sample.Get(@"Menu/button-back-select"); } @@ -322,7 +324,7 @@ namespace osu.Game.Screens.Menu logoDelayedAction = Scheduler.AddDelayed(() => { - showOverlays.Value = false; + allowOverlays.Value = false; logo.ClearTransforms(targetMember: nameof(Position)); logo.RelativePositionAxes = Axes.Both; @@ -351,7 +353,7 @@ namespace osu.Game.Screens.Menu logoTracking = true; logo.Impact(); - showOverlays.Value = true; + allowOverlays.Value = true; }, 200); break; default: diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index 5af634b02d..bd32792f3f 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -18,7 +18,7 @@ namespace osu.Game.Screens.Menu private readonly SpriteIcon icon; private Color4 iconColour; - public override bool ShowOverlaysOnEnter => false; + public override bool HideOverlaysOnEnter => true; public override bool CursorVisible => false; public Disclaimer() diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 4de76e530a..019f0432f6 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -31,7 +31,7 @@ namespace osu.Game.Screens.Menu private SampleChannel welcome; private SampleChannel seeya; - public override bool ShowOverlaysOnEnter => false; + public override bool HideOverlaysOnEnter => true; public override bool CursorVisible => false; protected override BackgroundScreen CreateBackground() => new BackgroundScreenEmpty(); diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 3b519c5259..0dd05fa0ad 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -24,7 +24,7 @@ namespace osu.Game.Screens.Menu { private readonly ButtonSystem buttons; - public override bool ShowOverlaysOnEnter => buttons.State != MenuState.Initial; + public override bool HideOverlaysOnEnter => buttons.State == MenuState.Initial; protected override bool AllowBackButton => buttons.State != MenuState.Initial; diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index 24945ea347..f94087869a 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -32,12 +32,12 @@ namespace osu.Game.Screens /// protected virtual BackgroundScreen CreateBackground() => null; - protected BindableBool ShowOverlays = new BindableBool(); + protected BindableBool AllowOverlays = new BindableBool(); /// - /// Whether overlays should be shown when this screen is entered or resumed. + /// Whether overlays should be hidden when this screen is entered or resumed. /// - public virtual bool ShowOverlaysOnEnter => true; + public virtual bool HideOverlaysOnEnter => false; /// /// Whether this allows the cursor to be displayed. @@ -88,7 +88,7 @@ namespace osu.Game.Screens if (osuGame != null) { Ruleset.BindTo(osuGame.Ruleset); - ShowOverlays.BindTo(osuGame.ShowOverlays); + AllowOverlays.BindTo(osuGame.AllowOverlays); } sampleExit = audio.Sample.Get(@"UI/screen-back"); @@ -220,7 +220,7 @@ namespace osu.Game.Screens if (backgroundParallaxContainer != null) backgroundParallaxContainer.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * BackgroundParallaxAmount; - ShowOverlays.Value = ShowOverlaysOnEnter; + AllowOverlays.Value = !HideOverlaysOnEnter; } private void onExitingLogo() diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 46919e25e1..44112609f8 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -35,7 +35,7 @@ namespace osu.Game.Screens.Play { protected override float BackgroundParallaxAmount => 0.1f; - public override bool ShowOverlaysOnEnter => false; + public override bool HideOverlaysOnEnter => true; public Action RestartRequested; diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index 56fbd7b6e7..fcb2a19c58 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -25,8 +25,8 @@ namespace osu.Game.Screens.Play private BeatmapMetadataDisplay info; - private bool showOverlays = true; - public override bool ShowOverlaysOnEnter => showOverlays; + private bool allowOverlays = true; + public override bool HideOverlaysOnEnter => !allowOverlays; private Task loadTask; @@ -36,7 +36,7 @@ namespace osu.Game.Screens.Play player.RestartRequested = () => { - showOverlays = false; + allowOverlays = false; ValidForResume = true; }; } diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index 1ef0b6cca0..ca806ce73e 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -29,7 +29,7 @@ namespace osu.Game.Screens.Tournament { private const string results_filename = "drawings_results.txt"; - public override bool ShowOverlaysOnEnter => false; + public override bool HideOverlaysOnEnter => true; protected override BackgroundScreen CreateBackground() => new BackgroundScreenDefault(); From b7e3ea348b15e8cdae2e3963f9b8ee4a405e7ea1 Mon Sep 17 00:00:00 2001 From: Aergwyn Date: Mon, 21 May 2018 15:53:50 +0200 Subject: [PATCH 4/4] expose two Bindables with split logic instead of one with mixed logic --- .../Containers/OsuFocusedOverlayContainer.cs | 6 +++--- osu.Game/OsuGame.cs | 9 +++++---- osu.Game/Screens/Edit/Editor.cs | 2 +- osu.Game/Screens/Loader.cs | 2 +- osu.Game/Screens/Menu/ButtonSystem.cs | 13 ++++++++----- osu.Game/Screens/Menu/Disclaimer.cs | 3 ++- osu.Game/Screens/Menu/Intro.cs | 4 +++- osu.Game/Screens/Menu/MainMenu.cs | 3 ++- osu.Game/Screens/OsuScreen.cs | 17 +++++++++++++---- osu.Game/Screens/Play/Player.cs | 2 +- osu.Game/Screens/Play/PlayerLoader.cs | 6 +++--- osu.Game/Screens/Tournament/Drawings.cs | 2 +- 12 files changed, 43 insertions(+), 26 deletions(-) diff --git a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs index 9c36eb8c18..11a2034a8f 100644 --- a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs +++ b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs @@ -16,13 +16,13 @@ namespace osu.Game.Graphics.Containers private SampleChannel samplePopIn; private SampleChannel samplePopOut; - protected BindableBool AllowOverlays = new BindableBool(true); + private readonly BindableBool allowOpeningOverlays = new BindableBool(true); [BackgroundDependencyLoader(true)] private void load(OsuGame osuGame, AudioManager audio) { if (osuGame != null) - AllowOverlays.BindTo(osuGame.AllowOverlays); + allowOpeningOverlays.BindTo(osuGame.AllowOpeningOverlays); samplePopIn = audio.Sample.Get(@"UI/overlay-pop-in"); samplePopOut = audio.Sample.Get(@"UI/overlay-pop-out"); @@ -52,7 +52,7 @@ namespace osu.Game.Graphics.Containers private void onStateChanged(Visibility visibility) { - if (AllowOverlays) + if (allowOpeningOverlays) { switch (visibility) { diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index b3da2831cd..ec93b1ae46 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -77,7 +77,8 @@ namespace osu.Game public float ToolbarOffset => Toolbar.Position.Y + Toolbar.DrawHeight; - public readonly BindableBool AllowOverlays = new BindableBool(); + public readonly BindableBool HideOverlaysOnEnter = new BindableBool(); + public readonly BindableBool AllowOpeningOverlays = new BindableBool(true); private OsuScreen screenStack; @@ -367,12 +368,12 @@ namespace osu.Game settings.StateChanged += _ => updateScreenOffset(); notifications.StateChanged += _ => updateScreenOffset(); - notifications.Enabled.BindTo(AllowOverlays); + notifications.Enabled.BindTo(AllowOpeningOverlays); - AllowOverlays.ValueChanged += show => + HideOverlaysOnEnter.ValueChanged += hide => { //central game screen change logic. - if (!show) + if (hide) { hideAllOverlays(); musicController.State = Visibility.Hidden; diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 8049ea2738..b657fe5597 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -26,7 +26,7 @@ namespace osu.Game.Screens.Edit { protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4"); - public override bool HideOverlaysOnEnter => true; + protected override bool HideOverlaysOnEnter => true; public override bool AllowBeatmapRulesetChange => false; private Box bottomBackground; diff --git a/osu.Game/Screens/Loader.cs b/osu.Game/Screens/Loader.cs index e49fb08087..fb5c5ca84b 100644 --- a/osu.Game/Screens/Loader.cs +++ b/osu.Game/Screens/Loader.cs @@ -17,7 +17,7 @@ namespace osu.Game.Screens { private bool showDisclaimer; - public override bool HideOverlaysOnEnter => true; + protected override bool HideOverlaysOnEnter => true; protected override bool AllowBackButton => false; diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index 9ca1a1ce19..d1d388ae1f 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -27,7 +27,8 @@ namespace osu.Game.Screens.Menu { public event Action StateChanged; - private readonly BindableBool allowOverlays = new BindableBool(); + private readonly BindableBool hideOverlaysOnEnter = new BindableBool(); + private readonly BindableBool allowOpeningOverlays = new BindableBool(); public Action OnEdit; public Action OnExit; @@ -136,7 +137,10 @@ namespace osu.Game.Screens.Menu private void load(AudioManager audio, OsuGame game) { if (game != null) - allowOverlays.BindTo(game.AllowOverlays); + { + hideOverlaysOnEnter.BindTo(game.HideOverlaysOnEnter); + allowOpeningOverlays.BindTo(game.AllowOpeningOverlays); + } sampleBack = audio.Sample.Get(@"Menu/button-back-select"); } @@ -324,8 +328,6 @@ namespace osu.Game.Screens.Menu logoDelayedAction = Scheduler.AddDelayed(() => { - allowOverlays.Value = false; - logo.ClearTransforms(targetMember: nameof(Position)); logo.RelativePositionAxes = Axes.Both; @@ -353,7 +355,8 @@ namespace osu.Game.Screens.Menu logoTracking = true; logo.Impact(); - allowOverlays.Value = true; + hideOverlaysOnEnter.Value = false; + allowOpeningOverlays.Value = true; }, 200); break; default: diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index bd32792f3f..9a671cf780 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -18,7 +18,8 @@ namespace osu.Game.Screens.Menu private readonly SpriteIcon icon; private Color4 iconColour; - public override bool HideOverlaysOnEnter => true; + protected override bool HideOverlaysOnEnter => true; + public override bool CursorVisible => false; public Disclaimer() diff --git a/osu.Game/Screens/Menu/Intro.cs b/osu.Game/Screens/Menu/Intro.cs index 019f0432f6..c174e2d470 100644 --- a/osu.Game/Screens/Menu/Intro.cs +++ b/osu.Game/Screens/Menu/Intro.cs @@ -31,7 +31,9 @@ namespace osu.Game.Screens.Menu private SampleChannel welcome; private SampleChannel seeya; - public override bool HideOverlaysOnEnter => true; + protected override bool HideOverlaysOnEnter => true; + protected override bool AllowOpeningOverlays => false; + public override bool CursorVisible => false; protected override BackgroundScreen CreateBackground() => new BackgroundScreenEmpty(); diff --git a/osu.Game/Screens/Menu/MainMenu.cs b/osu.Game/Screens/Menu/MainMenu.cs index 0dd05fa0ad..d5f3b11467 100644 --- a/osu.Game/Screens/Menu/MainMenu.cs +++ b/osu.Game/Screens/Menu/MainMenu.cs @@ -24,7 +24,8 @@ namespace osu.Game.Screens.Menu { private readonly ButtonSystem buttons; - public override bool HideOverlaysOnEnter => buttons.State == MenuState.Initial; + protected override bool HideOverlaysOnEnter => buttons.State == MenuState.Initial; + protected override bool AllowOpeningOverlays => buttons.State != MenuState.Initial; protected override bool AllowBackButton => buttons.State != MenuState.Initial; diff --git a/osu.Game/Screens/OsuScreen.cs b/osu.Game/Screens/OsuScreen.cs index f94087869a..4b1562291b 100644 --- a/osu.Game/Screens/OsuScreen.cs +++ b/osu.Game/Screens/OsuScreen.cs @@ -32,12 +32,19 @@ namespace osu.Game.Screens /// protected virtual BackgroundScreen CreateBackground() => null; - protected BindableBool AllowOverlays = new BindableBool(); + private readonly BindableBool hideOverlaysOnEnter = new BindableBool(); /// /// Whether overlays should be hidden when this screen is entered or resumed. /// - public virtual bool HideOverlaysOnEnter => false; + protected virtual bool HideOverlaysOnEnter => hideOverlaysOnEnter; + + private readonly BindableBool allowOpeningOverlays = new BindableBool(); + + /// + /// Whether overlays should be able to be opened while this screen is active. + /// + protected virtual bool AllowOpeningOverlays => allowOpeningOverlays; /// /// Whether this allows the cursor to be displayed. @@ -88,7 +95,8 @@ namespace osu.Game.Screens if (osuGame != null) { Ruleset.BindTo(osuGame.Ruleset); - AllowOverlays.BindTo(osuGame.AllowOverlays); + hideOverlaysOnEnter.BindTo(osuGame.HideOverlaysOnEnter); + allowOpeningOverlays.BindTo(osuGame.AllowOpeningOverlays); } sampleExit = audio.Sample.Get(@"UI/screen-back"); @@ -220,7 +228,8 @@ namespace osu.Game.Screens if (backgroundParallaxContainer != null) backgroundParallaxContainer.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * BackgroundParallaxAmount; - AllowOverlays.Value = !HideOverlaysOnEnter; + hideOverlaysOnEnter.Value = HideOverlaysOnEnter; + allowOpeningOverlays.Value = AllowOpeningOverlays; } private void onExitingLogo() diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 44112609f8..ec7a99145e 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -35,7 +35,7 @@ namespace osu.Game.Screens.Play { protected override float BackgroundParallaxAmount => 0.1f; - public override bool HideOverlaysOnEnter => true; + protected override bool HideOverlaysOnEnter => true; public Action RestartRequested; diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index fcb2a19c58..734837a4f1 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -25,8 +25,8 @@ namespace osu.Game.Screens.Play private BeatmapMetadataDisplay info; - private bool allowOverlays = true; - public override bool HideOverlaysOnEnter => !allowOverlays; + private bool hideOverlays; + protected override bool HideOverlaysOnEnter => hideOverlays; private Task loadTask; @@ -36,7 +36,7 @@ namespace osu.Game.Screens.Play player.RestartRequested = () => { - allowOverlays = false; + hideOverlays = true; ValidForResume = true; }; } diff --git a/osu.Game/Screens/Tournament/Drawings.cs b/osu.Game/Screens/Tournament/Drawings.cs index ca806ce73e..29301899d5 100644 --- a/osu.Game/Screens/Tournament/Drawings.cs +++ b/osu.Game/Screens/Tournament/Drawings.cs @@ -29,7 +29,7 @@ namespace osu.Game.Screens.Tournament { private const string results_filename = "drawings_results.txt"; - public override bool HideOverlaysOnEnter => true; + protected override bool HideOverlaysOnEnter => true; protected override BackgroundScreen CreateBackground() => new BackgroundScreenDefault();