mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 06:03:08 +08:00
Add reverse handler button to selection box
This commit is contained in:
parent
eacc7dca9a
commit
825e10ec8c
@ -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()
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user