mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 17:37:23 +09: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
|
//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;
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
@ -222,9 +222,8 @@ namespace osu.Game.Screens.Menu
|
|||||||
boxHoverLayer.FadeOut(800, Easing.OutExpo);
|
boxHoverLayer.FadeOut(800, Easing.OutExpo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandleKeyboardInput => handleInput;
|
public override bool HandleKeyboardInput => state != ButtonState.Exploded;
|
||||||
public override bool HandleMouseInput => handleInput;
|
public override bool HandleMouseInput => state != ButtonState.Exploded && box.Scale.X >= 0.8f;
|
||||||
private bool handleInput => state != ButtonState.Exploded && box.Scale.X >= 0.8f;
|
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -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 PopIn() => this.FadeIn(transition_duration, Easing.In);
|
||||||
protected override void PopOut() => this.FadeOut(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 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;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user