1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:57:36 +08:00

Make game bindable immutable.

This commit is contained in:
Lucas A 2020-08-27 20:07:24 +02:00
parent 5949a281fc
commit ad223bc460
5 changed files with 9 additions and 7 deletions

View File

@ -91,7 +91,12 @@ namespace osu.Game.Tests.Visual.Menus
public class TestToolbar : Toolbar public class TestToolbar : Toolbar
{ {
public new Bindable<OverlayActivation> OverlayActivationMode => base.OverlayActivationMode; public TestToolbar()
{
base.OverlayActivationMode.BindTo(OverlayActivationMode);
}
public new Bindable<OverlayActivation> OverlayActivationMode { get; } = new Bindable<OverlayActivation>(OverlayActivation.All);
} }
} }
} }

View File

@ -35,7 +35,7 @@ namespace osu.Game.Graphics.Containers
[Resolved] [Resolved]
private PreviewTrackManager previewTrackManager { get; set; } private PreviewTrackManager previewTrackManager { get; set; }
protected readonly Bindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All); protected readonly IBindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
private void load(AudioManager audio) private void load(AudioManager audio)

View File

@ -88,7 +88,7 @@ namespace osu.Game
private IdleTracker idleTracker; private IdleTracker idleTracker;
public readonly Bindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(); public readonly IBindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>();
protected OsuScreenStack ScreenStack; protected OsuScreenStack ScreenStack;

View File

@ -28,7 +28,7 @@ namespace osu.Game.Overlays.Toolbar
private const double transition_time = 500; private const double transition_time = 500;
protected readonly Bindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All); protected readonly IBindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);
// Toolbar components like RulesetSelector should receive keyboard input events even when the toolbar is hidden. // Toolbar components like RulesetSelector should receive keyboard input events even when the toolbar is hidden.
public override bool PropagateNonPositionalInputSubTree => true; public override bool PropagateNonPositionalInputSubTree => true;

View File

@ -270,9 +270,6 @@ namespace osu.Game.Screens.Menu
ButtonSystemState lastState = state; ButtonSystemState lastState = state;
state = value; state = value;
if (game != null)
game.OverlayActivationMode.Value = state == ButtonSystemState.Exit ? OverlayActivation.Disabled : OverlayActivation.All;
updateLogoState(lastState); updateLogoState(lastState);
Logger.Log($"{nameof(ButtonSystem)}'s state changed from {lastState} to {state}"); Logger.Log($"{nameof(ButtonSystem)}'s state changed from {lastState} to {state}");