Apply conditionals directly rather than using an in-between property

This commit is contained in:
Dean Herbert
2018-01-16 20:34:14 +09:00
parent e7a0a02466
commit 5e1cd8ddc4
5 changed files with 11 additions and 15 deletions

View File

@ -42,9 +42,9 @@ namespace osu.Game.Graphics.UserInterface
//don't allow clicking between transitions and don't make the chevron clickable //don't allow clicking between transitions and don't make the chevron clickable
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => Alpha == 1f && Text.ReceiveMouseInputAt(screenSpacePos); public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => Alpha == 1f && Text.ReceiveMouseInputAt(screenSpacePos);
public override bool HandleKeyboardInput => handleInput;
public override bool HandleMouseInput => handleInput; public override bool HandleKeyboardInput => State == Visibility.Visible;
private bool handleInput => State == Visibility.Visible; public override bool HandleMouseInput => State == Visibility.Visible;
private Visibility state; private Visibility state;

View File

@ -489,9 +489,8 @@ namespace osu.Game.Overlays.Profile
{ {
private readonly OsuHoverContainer content; private readonly OsuHoverContainer content;
public override bool HandleKeyboardInput => handleInput; public override bool HandleKeyboardInput => content.Action != null;
public override bool HandleMouseInput => handleInput; public override bool HandleMouseInput => content.Action != null;
private bool handleInput => content.Action != null;
protected override Container<Drawable> Content => content ?? (Container<Drawable>)this; protected override Container<Drawable> Content => content ?? (Container<Drawable>)this;

View File

@ -87,9 +87,8 @@ namespace osu.Game.Overlays.Toolbar
ruleset.Value = rulesets.AvailableRulesets.FirstOrDefault(); ruleset.Value = rulesets.AvailableRulesets.FirstOrDefault();
} }
public override bool HandleKeyboardInput => handleInput; public override bool HandleKeyboardInput => !ruleset.Disabled;
public override bool HandleMouseInput => handleInput; public override bool HandleMouseInput => !ruleset.Disabled;
private bool handleInput => !ruleset.Disabled;
private void disabledChanged(bool isDisabled) => this.FadeColour(isDisabled ? Color4.Gray : Color4.White, 300); private void disabledChanged(bool isDisabled) => this.FadeColour(isDisabled ? Color4.Gray : Color4.White, 300);

View File

@ -199,9 +199,8 @@ namespace osu.Game.Screens.Menu
private MenuState state; private MenuState state;
public override bool HandleKeyboardInput => handleInput; public override bool HandleKeyboardInput => state != MenuState.Exit;
public override bool HandleMouseInput => handleInput; public override bool HandleMouseInput => state != MenuState.Exit;
private bool handleInput=> state != MenuState.Exit;
public MenuState State public MenuState State
{ {

View File

@ -111,9 +111,8 @@ namespace osu.Game.Screens.Play
} }
} }
public override bool HandleKeyboardInput => handleInput; public override bool HandleKeyboardInput => receptor == null;
public override bool HandleMouseInput => handleInput; public override bool HandleMouseInput => receptor == null;
private bool handleInput => receptor == null;
private Receptor receptor; private Receptor receptor;