mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Add flip event flow and stop passing raw input events to handle methods
This commit is contained in:
@ -16,8 +16,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
{
|
||||
public class ComposeSelectionBox : CompositeDrawable
|
||||
{
|
||||
public Action<DragEvent> OnRotation;
|
||||
public Action<DragEvent, Anchor> OnScale;
|
||||
public Action<float> OnRotation;
|
||||
public Action<Vector2, Anchor> OnScale;
|
||||
public Action<Direction> OnFlip;
|
||||
|
||||
public Action OperationStarted;
|
||||
public Action OperationEnded;
|
||||
|
@ -100,8 +100,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
OperationStarted = OnOperationBegan,
|
||||
OperationEnded = OnOperationEnded,
|
||||
|
||||
OnRotation = e => HandleRotation(e.Delta.X),
|
||||
OnScale = (e, anchor) => HandleScale(e.Delta, anchor),
|
||||
OnRotation = angle => HandleRotation(angle),
|
||||
OnScale = (amount, anchor) => HandleScale(amount, anchor),
|
||||
OnFlip = direction => HandleFlip(direction),
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
@ -151,6 +152,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
/// <returns>Whether any <see cref="DrawableHitObject"/>s could be moved.</returns>
|
||||
public virtual bool HandleScale(Vector2 scale, Anchor anchor) => false;
|
||||
|
||||
/// <summary>
|
||||
/// Handled the selected <see cref="DrawableHitObject"/>s being flipped.
|
||||
/// </summary>
|
||||
/// <param name="direction">The direction to flip</param>
|
||||
/// <returns>Whether any <see cref="DrawableHitObject"/>s could be moved.</returns>
|
||||
public virtual bool HandleFlip(Direction direction) => false;
|
||||
|
||||
public bool OnPressed(PlatformAction action)
|
||||
{
|
||||
switch (action.ActionMethod)
|
||||
|
Reference in New Issue
Block a user