mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 19:42:55 +08:00
Make game bindable immutable.
This commit is contained in:
parent
5949a281fc
commit
ad223bc460
@ -91,7 +91,12 @@ namespace osu.Game.Tests.Visual.Menus
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Graphics.Containers
|
||||
[Resolved]
|
||||
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)]
|
||||
private void load(AudioManager audio)
|
||||
|
@ -88,7 +88,7 @@ namespace osu.Game
|
||||
|
||||
private IdleTracker idleTracker;
|
||||
|
||||
public readonly Bindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>();
|
||||
public readonly IBindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>();
|
||||
|
||||
protected OsuScreenStack ScreenStack;
|
||||
|
||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
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.
|
||||
public override bool PropagateNonPositionalInputSubTree => true;
|
||||
|
@ -270,9 +270,6 @@ namespace osu.Game.Screens.Menu
|
||||
ButtonSystemState lastState = state;
|
||||
state = value;
|
||||
|
||||
if (game != null)
|
||||
game.OverlayActivationMode.Value = state == ButtonSystemState.Exit ? OverlayActivation.Disabled : OverlayActivation.All;
|
||||
|
||||
updateLogoState(lastState);
|
||||
|
||||
Logger.Log($"{nameof(ButtonSystem)}'s state changed from {lastState} to {state}");
|
||||
|
Loading…
Reference in New Issue
Block a user