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:
parent
5949a281fc
commit
ad223bc460
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
@ -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}");
|
||||||
|
Loading…
Reference in New Issue
Block a user