mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 21:07:33 +08:00
Merge pull request #1920 from peppy/input-queue-code-quality
Simplify some mouse/keyboard handling overrides
This commit is contained in:
commit
0ee9bcd70c
@ -42,9 +42,9 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
//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 HandleKeyboardInput => handleInput;
|
||||
public override bool HandleMouseInput => handleInput;
|
||||
private bool handleInput => State == Visibility.Visible;
|
||||
|
||||
public override bool HandleKeyboardInput => State == Visibility.Visible;
|
||||
public override bool HandleMouseInput => State == Visibility.Visible;
|
||||
|
||||
private Visibility state;
|
||||
|
||||
|
@ -489,9 +489,8 @@ namespace osu.Game.Overlays.Profile
|
||||
{
|
||||
private readonly OsuHoverContainer content;
|
||||
|
||||
public override bool HandleKeyboardInput => handleInput;
|
||||
public override bool HandleMouseInput => handleInput;
|
||||
private bool handleInput => content.Action != null;
|
||||
public override bool HandleKeyboardInput => content.Action != null;
|
||||
public override bool HandleMouseInput => content.Action != null;
|
||||
|
||||
protected override Container<Drawable> Content => content ?? (Container<Drawable>)this;
|
||||
|
||||
|
@ -87,9 +87,8 @@ namespace osu.Game.Overlays.Toolbar
|
||||
ruleset.Value = rulesets.AvailableRulesets.FirstOrDefault();
|
||||
}
|
||||
|
||||
public override bool HandleKeyboardInput => handleInput;
|
||||
public override bool HandleMouseInput => handleInput;
|
||||
private bool handleInput => !ruleset.Disabled;
|
||||
public override bool HandleKeyboardInput => !ruleset.Disabled;
|
||||
public override bool HandleMouseInput => !ruleset.Disabled;
|
||||
|
||||
private void disabledChanged(bool isDisabled) => this.FadeColour(isDisabled ? Color4.Gray : Color4.White, 300);
|
||||
|
||||
|
@ -222,9 +222,8 @@ namespace osu.Game.Screens.Menu
|
||||
boxHoverLayer.FadeOut(800, Easing.OutExpo);
|
||||
}
|
||||
|
||||
public override bool HandleKeyboardInput => handleInput;
|
||||
public override bool HandleMouseInput => handleInput;
|
||||
private bool handleInput => state != ButtonState.Exploded && box.Scale.X >= 0.8f;
|
||||
public override bool HandleKeyboardInput => state != ButtonState.Exploded;
|
||||
public override bool HandleMouseInput => state != ButtonState.Exploded && box.Scale.X >= 0.8f;
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
|
@ -199,9 +199,8 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
private MenuState state;
|
||||
|
||||
public override bool HandleKeyboardInput => handleInput;
|
||||
public override bool HandleMouseInput => handleInput;
|
||||
private bool handleInput=> state != MenuState.Exit;
|
||||
public override bool HandleKeyboardInput => state != MenuState.Exit;
|
||||
public override bool HandleMouseInput => state != MenuState.Exit;
|
||||
|
||||
public MenuState State
|
||||
{
|
||||
|
@ -142,10 +142,6 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
}
|
||||
|
||||
public override bool HandleKeyboardInput => handleInput;
|
||||
public override bool HandleMouseInput => handleInput;
|
||||
private bool handleInput => State == Visibility.Visible;
|
||||
|
||||
protected override void PopIn() => this.FadeIn(transition_duration, Easing.In);
|
||||
protected override void PopOut() => this.FadeOut(transition_duration, Easing.In);
|
||||
|
||||
|
@ -111,9 +111,8 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
}
|
||||
|
||||
public override bool HandleKeyboardInput => handleInput;
|
||||
public override bool HandleMouseInput => handleInput;
|
||||
private bool handleInput => receptor == null;
|
||||
public override bool HandleKeyboardInput => receptor == null;
|
||||
public override bool HandleMouseInput => receptor == null;
|
||||
|
||||
private Receptor receptor;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user