mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 15:03:13 +08:00
Add property for tracking whether control is during operation
This commit is contained in:
parent
206fc94b8c
commit
62bcc5f76d
@ -25,6 +25,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
private Circle circle;
|
private Circle circle;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether an operation has began from this control.
|
||||||
|
/// </summary>
|
||||||
|
public bool InOperation { get; private set; }
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
protected OsuColour Colours { get; private set; }
|
protected OsuColour Colours { get; private set; }
|
||||||
|
|
||||||
@ -89,8 +94,16 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
this.ScaleTo(HandlingMouse || IsHovered ? 1.5f : 1, 100, Easing.OutQuint);
|
this.ScaleTo(HandlingMouse || IsHovered ? 1.5f : 1, 100, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void OnOperationStarted() => OperationStarted?.Invoke();
|
protected void OnOperationStarted()
|
||||||
|
{
|
||||||
|
InOperation = true;
|
||||||
|
OperationStarted?.Invoke();
|
||||||
|
}
|
||||||
|
|
||||||
protected void OnOperationEnded() => OperationEnded?.Invoke();
|
protected void OnOperationEnded()
|
||||||
|
{
|
||||||
|
InOperation = false;
|
||||||
|
OperationEnded?.Invoke();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user