1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 19:53:23 +08:00

apply feedback

-don't directly set AllowOverlay Bindable
this should be done specifically where needed
-remove AllowOverlay Bindable from ButtonSystem
-remove unnecessary xmldoc
This commit is contained in:
Aergwyn 2018-06-03 11:30:58 +02:00
parent 6000a90721
commit 707af02097
7 changed files with 10 additions and 29 deletions

View File

@ -17,9 +17,6 @@ namespace osu.Game.Graphics.Containers
private SampleChannel samplePopIn; private SampleChannel samplePopIn;
private SampleChannel samplePopOut; private SampleChannel samplePopOut;
/// <summary>
/// Defaults to <see cref="OverlayActivation.All"/> so that the overlay works even if BDL couldn't pass an <see cref="OsuGame"/>.
/// </summary>
private readonly Bindable<OverlayActivation> allowOverlays = new Bindable<OverlayActivation>(OverlayActivation.All); private readonly Bindable<OverlayActivation> allowOverlays = new Bindable<OverlayActivation>(OverlayActivation.All);
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]

View File

@ -31,9 +31,6 @@ namespace osu.Game.Overlays.Toolbar
private const float alpha_hovering = 0.8f; private const float alpha_hovering = 0.8f;
private const float alpha_normal = 0.6f; private const float alpha_normal = 0.6f;
/// <summary>
/// Defaults to <see cref="OverlayActivation.All"/> so that the overlay works even if BDL couldn't pass an <see cref="OsuGame"/>.
/// </summary>
private readonly Bindable<OverlayActivation> allowOverlays = new Bindable<OverlayActivation>(OverlayActivation.All); private readonly Bindable<OverlayActivation> allowOverlays = new Bindable<OverlayActivation>(OverlayActivation.All);
public Toolbar() public Toolbar()

View File

@ -8,7 +8,6 @@ using osu.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
using osu.Framework.Audio.Sample; using osu.Framework.Audio.Sample;
using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
@ -20,7 +19,6 @@ using osu.Game.Input.Bindings;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
using OpenTK.Input; using OpenTK.Input;
using osu.Game.Overlays;
namespace osu.Game.Screens.Menu namespace osu.Game.Screens.Menu
{ {
@ -28,8 +26,6 @@ namespace osu.Game.Screens.Menu
{ {
public event Action<MenuState> StateChanged; public event Action<MenuState> StateChanged;
private readonly Bindable<OverlayActivation> allowOverlays = new Bindable<OverlayActivation>();
public Action OnEdit; public Action OnEdit;
public Action OnExit; public Action OnExit;
public Action OnDirect; public Action OnDirect;
@ -134,11 +130,8 @@ namespace osu.Game.Screens.Menu
} }
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
private void load(AudioManager audio, OsuGame game) private void load(AudioManager audio)
{ {
if (game != null)
allowOverlays.BindTo(game.AllowOverlays);
sampleBack = audio.Sample.Get(@"Menu/button-back-select"); sampleBack = audio.Sample.Get(@"Menu/button-back-select");
} }
@ -329,7 +322,6 @@ namespace osu.Game.Screens.Menu
case MenuState.Exit: case MenuState.Exit:
case MenuState.Initial: case MenuState.Initial:
logoTracking = false; logoTracking = false;
allowOverlays.Value = OverlayActivation.Disabled;
logoDelayedAction = Scheduler.AddDelayed(() => logoDelayedAction = Scheduler.AddDelayed(() =>
{ {
@ -338,9 +330,6 @@ namespace osu.Game.Screens.Menu
logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo); logo.MoveTo(new Vector2(0.5f), 800, Easing.OutExpo);
logo.ScaleTo(1, 800, Easing.OutExpo); logo.ScaleTo(1, 800, Easing.OutExpo);
if(state != MenuState.Exit)
allowOverlays.Value = OverlayActivation.All;
}, 150); }, 150);
break; break;
case MenuState.TopLevel: case MenuState.TopLevel:

View File

@ -20,6 +20,7 @@ namespace osu.Game.Screens.Menu
private Color4 iconColour; private Color4 iconColour;
protected override bool HideOverlaysOnEnter => true; protected override bool HideOverlaysOnEnter => true;
protected override OverlayActivation OverlayActivationLevel => OverlayActivation.Disabled;
public override bool CursorVisible => false; public override bool CursorVisible => false;
@ -93,8 +94,6 @@ namespace osu.Game.Screens.Menu
LoadComponentAsync(intro = new Intro()); LoadComponentAsync(intro = new Intro());
iconColour = colours.Yellow; iconColour = colours.Yellow;
AllowOverlays.Value = OverlayActivation.Disabled;
} }
protected override void OnEntering(Screen last) protected override void OnEntering(Screen last)

View File

@ -33,6 +33,7 @@ namespace osu.Game.Screens.Menu
private SampleChannel seeya; private SampleChannel seeya;
protected override bool HideOverlaysOnEnter => true; protected override bool HideOverlaysOnEnter => true;
protected override OverlayActivation OverlayActivationLevel => OverlayActivation.Disabled;
public override bool CursorVisible => false; public override bool CursorVisible => false;
@ -77,8 +78,6 @@ namespace osu.Game.Screens.Menu
welcome = audio.Sample.Get(@"welcome"); welcome = audio.Sample.Get(@"welcome");
seeya = audio.Sample.Get(@"seeya"); seeya = audio.Sample.Get(@"seeya");
AllowOverlays.Value = OverlayActivation.Disabled;
} }
protected override void OnEntering(Screen last) protected override void OnEntering(Screen last)

View File

@ -10,7 +10,6 @@ using osu.Framework.Input;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Overlays;
using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Backgrounds;
using osu.Game.Screens.Charts; using osu.Game.Screens.Charts;
using osu.Game.Screens.Direct; using osu.Game.Screens.Direct;
@ -80,8 +79,6 @@ namespace osu.Game.Screens.Menu
} }
preloadSongSelect(); preloadSongSelect();
AllowOverlays.Value = OverlayActivation.Disabled;
} }
private void preloadSongSelect() private void preloadSongSelect()

View File

@ -54,11 +54,12 @@ namespace osu.Game.Screens
/// </summary> /// </summary>
protected virtual bool HideOverlaysOnEnter => false; protected virtual bool HideOverlaysOnEnter => false;
private readonly Bindable<OverlayActivation> allowOverlays = new Bindable<OverlayActivation>();
/// <summary> /// <summary>
/// Whether overlays should be able to be opened. /// Whether overlays should be able to be opened once this screen is entered or resumed.
/// It's bound at load which means changes at construction will potentially disappear.
/// </summary> /// </summary>
protected readonly Bindable<OverlayActivation> AllowOverlays = new Bindable<OverlayActivation>(); protected virtual OverlayActivation OverlayActivationLevel => OverlayActivation.All;
/// <summary> /// <summary>
/// Whether this <see cref="OsuScreen"/> allows the cursor to be displayed. /// Whether this <see cref="OsuScreen"/> allows the cursor to be displayed.
@ -109,7 +110,7 @@ namespace osu.Game.Screens
if (osuGame != null) if (osuGame != null)
{ {
Ruleset.BindTo(osuGame.Ruleset); Ruleset.BindTo(osuGame.Ruleset);
AllowOverlays.BindTo(osuGame.AllowOverlays); allowOverlays.BindTo(osuGame.AllowOverlays);
updateOverlayStates = () => updateOverlayStates = () =>
{ {
@ -252,6 +253,8 @@ namespace osu.Game.Screens
if (backgroundParallaxContainer != null) if (backgroundParallaxContainer != null)
backgroundParallaxContainer.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * BackgroundParallaxAmount; backgroundParallaxContainer.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT * BackgroundParallaxAmount;
allowOverlays.Value = OverlayActivationLevel;
updateOverlayStates?.Invoke(); updateOverlayStates?.Invoke();
} }