Merge pull request #3030 from peppy/focused-overlay-blocks-select

Make focused overlays block "select" and keys
This commit is contained in:
Dan Balasescu 2018-07-13 21:20:43 +09:00 committed by GitHub
commit d08c44a726
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,8 +22,11 @@ namespace osu.Game.Graphics.Containers
protected virtual bool PlaySamplesOnStateChange => true; protected virtual bool PlaySamplesOnStateChange => true;
protected override bool BlockPassThroughKeyboard => true;
private PreviewTrackManager previewTrackManager; private PreviewTrackManager previewTrackManager;
protected readonly Bindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All); protected readonly Bindable<OverlayActivation> OverlayActivationMode = new Bindable<OverlayActivation>(OverlayActivation.All);
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
@ -69,10 +72,13 @@ namespace osu.Game.Graphics.Containers
public virtual bool OnPressed(GlobalAction action) public virtual bool OnPressed(GlobalAction action)
{ {
if (action == GlobalAction.Back) switch (action)
{ {
State = Visibility.Hidden; case GlobalAction.Back:
return true; State = Visibility.Hidden;
return true;
case GlobalAction.Select:
return true;
} }
return false; return false;