1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 03:25:11 +08:00

Use ReceiveMouseInputAt whenever possible

This commit is contained in:
Thomas Müller 2017-06-30 09:54:03 +03:00
parent 5c02f1812f
commit bb15bc0467
14 changed files with 14 additions and 14 deletions

View File

@ -118,7 +118,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
base.Update();
if (Time.Current < slider.EndTime)
Tracking = canCurrentlyTrack && lastState != null && Contains(lastState.Mouse.NativeState.Position) && lastState.Mouse.HasMainButtonPressed;
Tracking = canCurrentlyTrack && lastState != null && ReceiveMouseInputAt(lastState.Mouse.NativeState.Position) && lastState.Mouse.HasMainButtonPressed;
}
public void UpdateProgress(double progress, int repeat)

View File

@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
};
}
public override bool Contains(Vector2 screenSpacePos) => true;
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true;
private bool tracking;
public bool Tracking

View File

@ -74,7 +74,7 @@ namespace osu.Game.Graphics.Cursor
}
}
public override bool Contains(Vector2 screenSpacePos) => true;
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true;
[BackgroundDependencyLoader]
private void load(ShaderManager shaders, TextureStore textures)

View File

@ -38,7 +38,7 @@ namespace osu.Game.Graphics.UserInterface
public readonly TextAwesome Chevron;
//don't allow clicking between transitions and don't make the chevron clickable
public override bool Contains(Vector2 screenSpacePos) => Alpha == 1f && Text.Contains(screenSpacePos);
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => Alpha == 1f && Text.ReceiveMouseInputAt(screenSpacePos);
public override bool HandleInput => State == Visibility.Visible;
private Visibility state;

View File

@ -93,7 +93,7 @@ namespace osu.Game.Graphics.UserInterface
private bool didClick; // Used for making sure that the OnMouseDown animation can call instead of OnHoverLost's when clicking
public override bool Contains(Vector2 screenSpacePos) => backgroundContainer.Contains(screenSpacePos);
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => backgroundContainer.ReceiveMouseInputAt(screenSpacePos);
protected override bool OnClick(Framework.Input.InputState state)
{

View File

@ -171,7 +171,7 @@ namespace osu.Game.Graphics.UserInterface
}
}
public override bool Contains(Vector2 screenSpacePos) => IconLayer.Contains(screenSpacePos) || TextLayer.Contains(screenSpacePos);
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => IconLayer.ReceiveMouseInputAt(screenSpacePos) || TextLayer.ReceiveMouseInputAt(screenSpacePos);
protected override bool OnHover(InputState state)
{

View File

@ -59,7 +59,7 @@ namespace osu.Game.Overlays
private readonly Container channelSelectionContainer;
private readonly ChannelSelectionOverlay channelSelection;
public override bool Contains(Vector2 screenSpacePos) => chatContainer.Contains(screenSpacePos) || channelSelection.State == Visibility.Visible && channelSelection.Contains(screenSpacePos);
public override bool Contains(Vector2 screenSpacePos) => chatContainer.ReceiveMouseInputAt(screenSpacePos) || channelSelection.State == Visibility.Visible && channelSelection.ReceiveMouseInputAt(screenSpacePos);
public ChatOverlay()
{

View File

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

View File

@ -57,7 +57,7 @@ namespace osu.Game.Screens.Menu
set { colourAndTriangles.Alpha = value ? 1 : 0; }
}
public override bool Contains(Vector2 screenSpacePos) => logoContainer.Contains(screenSpacePos);
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => logoContainer.ReceiveMouseInputAt(screenSpacePos);
public bool Ripple
{

View File

@ -127,7 +127,7 @@ namespace osu.Game.Screens.Play
this.target = target;
}
public override bool Contains(Vector2 screenSpacePos) => true;
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true;
public override bool HandleInput => true;

View File

@ -16,7 +16,7 @@ namespace osu.Game.Screens.Play
Button = button;
}
public override bool Contains(Vector2 screenSpacePos) => true;
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true;
private static string getStringRepresentation(MouseButton button)
{

View File

@ -67,7 +67,7 @@ namespace osu.Game.Screens.Select
private readonly SearchTextBox searchTextBox;
public override bool Contains(Vector2 screenSpacePos) => base.Contains(screenSpacePos) || groupTabs.Contains(screenSpacePos) || sortTabs.Contains(screenSpacePos);
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => base.ReceiveMouseInputAt(screenSpacePos) || groupTabs.ReceiveMouseInputAt(screenSpacePos) || sortTabs.ReceiveMouseInputAt(screenSpacePos);
public FilterControl()
{

View File

@ -124,7 +124,7 @@ namespace osu.Game.Screens.Select
updateModeLight();
}
public override bool Contains(Vector2 screenSpacePos) => base.Contains(screenSpacePos) || StartButton.Contains(screenSpacePos);
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => base.ReceiveMouseInputAt(screenSpacePos) || StartButton.ReceiveMouseInputAt(screenSpacePos);
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;

View File

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