AlwaysReceiveInput and InternalContains.

This commit is contained in:
Dean Herbert
2017-03-16 17:38:36 +09:00
parent e17f728282
commit ab8a5afdb9
19 changed files with 43 additions and 50 deletions

View File

@ -35,10 +35,7 @@ namespace osu.Game.Screens.Menu
private Key triggerKey;
private SampleChannel sampleClick;
public override bool Contains(Vector2 screenSpacePos)
{
return box.Contains(screenSpacePos);
}
protected override bool InternalContains(Vector2 screenSpacePos) => box.Contains(screenSpacePos);
public Button(string text, string internalName, FontAwesome symbol, Color4 colour, Action clickAction = null, float extraWidth = 0, Key triggerKey = Key.Unknown)
{

View File

@ -50,10 +50,7 @@ namespace osu.Game.Screens.Menu
}
}
public override bool Contains(Vector2 screenSpacePos)
{
return logoContainer.Contains(screenSpacePos);
}
protected override bool InternalContains(Vector2 screenSpacePos) => logoContainer.Contains(screenSpacePos);
public bool Ripple
{

View File

@ -14,6 +14,8 @@ namespace osu.Game.Screens.Play
{
public KeyCounterCollection()
{
AlwaysReceiveInput = true;
Direction = FillDirection.Horizontal;
AutoSizeAxes = Axes.Both;
}
@ -33,8 +35,6 @@ namespace osu.Game.Screens.Play
counter.ResetCount();
}
public override bool Contains(Vector2 screenSpacePos) => true;
//further: change default values here and in KeyCounter if needed, instead of passing them in every constructor
private bool isCounting;
public bool IsCounting
@ -111,12 +111,11 @@ namespace osu.Game.Screens.Play
public Receptor(KeyCounterCollection target)
{
AlwaysReceiveInput = true;
RelativeSizeAxes = Axes.Both;
this.target = target;
}
public override bool Contains(Vector2 screenSpacePos) => true;
public override bool HandleInput => true;
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args) => target.Children.Any(c => c.TriggerKeyDown(state, args));

View File

@ -13,6 +13,7 @@ namespace osu.Game.Screens.Play
public KeyCounterMouse(MouseButton button) : base(getStringRepresentation(button))
{
AlwaysReceiveInput = true;
Button = button;
}
@ -29,8 +30,6 @@ namespace osu.Game.Screens.Play
}
}
public override bool Contains(Vector2 screenSpacePos) => true;
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{
if (args.Button == Button) IsLit = true;

View File

@ -70,7 +70,6 @@ namespace osu.Game.Screens.Play
private FillFlowContainer retryCounterContainer;
public override bool Contains(Vector2 screenSpacePos) => true;
public override bool HandleInput => State == Visibility.Visible;
protected override void PopIn() => FadeIn(transition_duration, EasingTypes.In);
@ -217,6 +216,7 @@ namespace osu.Game.Screens.Play
public PauseOverlay()
{
AlwaysReceiveInput = true;
RelativeSizeAxes = Axes.Both;
}
}

View File

@ -60,7 +60,7 @@ namespace osu.Game.Screens.Select
private SearchTextBox searchTextBox;
public override bool Contains(Vector2 screenSpacePos) => base.Contains(screenSpacePos) || groupTabs.Contains(screenSpacePos) || sortTabs.Contains(screenSpacePos);
protected override bool InternalContains(Vector2 screenSpacePos) => base.InternalContains(screenSpacePos) || groupTabs.Contains(screenSpacePos) || sortTabs.Contains(screenSpacePos);
public FilterControl()
{
@ -75,7 +75,7 @@ namespace osu.Game.Screens.Select
new Container
{
Padding = new MarginPadding(20),
BypassContainsCheck = true,
AlwaysReceiveInput = true,
RelativeSizeAxes = Axes.Both,
Width = 0.5f,
Anchor = Anchor.TopRight,
@ -107,7 +107,7 @@ namespace osu.Game.Screens.Select
Direction = FillDirection.Horizontal,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
BypassContainsCheck = true,
AlwaysReceiveInput = true,
Children = new Drawable[]
{
groupTabs = new OsuTabControl<GroupMode>

View File

@ -26,8 +26,6 @@ namespace osu.Game.Screens.Select
private const float padding = 80;
public override bool Contains(Vector2 screenSpacePos) => true;
public Action OnBack;
public Action OnStart;
@ -69,6 +67,8 @@ namespace osu.Game.Screens.Select
public Footer()
{
AlwaysReceiveInput = true;
const float bottom_tool_height = 50;
RelativeSizeAxes = Axes.X;

View File

@ -83,7 +83,7 @@ namespace osu.Game.Screens.Select.Options
return false;
}
public override bool Contains(Vector2 screenSpacePos) => box.Contains(screenSpacePos);
protected override bool InternalContains(Vector2 screenSpacePos) => box.Contains(screenSpacePos);
public BeatmapOptionsButton()
{