1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

Add reverse handler button to selection box

This commit is contained in:
Dean Herbert 2020-10-09 06:32:23 +09:00
parent eacc7dca9a
commit 825e10ec8c
2 changed files with 20 additions and 0 deletions

View File

@ -17,10 +17,28 @@ namespace osu.Game.Screens.Edit.Compose.Components
public Action<float> OnRotation;
public Action<Vector2, Anchor> OnScale;
public Action<Direction> OnFlip;
public Action OnReverse;
public Action OperationStarted;
public Action OperationEnded;
private bool canReverse;
/// <summary>
/// Whether pattern reversing support should be enabled.
/// </summary>
public bool CanReverse
{
get => canReverse;
set
{
if (canReverse == value) return;
canReverse = value;
recreate();
}
}
private bool canRotate;
/// <summary>
@ -125,6 +143,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
if (CanScaleX && CanScaleY) addFullScaleComponents();
if (CanScaleY) addYScaleComponents();
if (CanRotate) addRotationComponents();
if (CanReverse) addButton(FontAwesome.Solid.Backward, "Reverse pattern", () => OnReverse?.Invoke());
}
private void addRotationComponents()

View File

@ -103,6 +103,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
OnRotation = angle => HandleRotation(angle),
OnScale = (amount, anchor) => HandleScale(amount, anchor),
OnFlip = direction => HandleFlip(direction),
OnReverse = () => HandleReverse(),
};
/// <summary>