Fix timing adjustment repeat buttons firing one change per repeat invocation

This commit is contained in:
Dean Herbert
2022-06-14 19:21:02 +09:00
parent 0771265caf
commit c30644328c
2 changed files with 13 additions and 1 deletions

View File

@ -23,6 +23,9 @@ namespace osu.Game.Screens.Edit.Timing
private Sample sample;
public Action RepeatBegan;
public Action RepeatEnded;
/// <summary>
/// An additive modifier for the frequency of the sample played on next actuation.
/// This can be adjusted during the button's <see cref="Drawable.OnClick"/> event to affect the repeat sample playback of that click.
@ -44,6 +47,7 @@ namespace osu.Game.Screens.Edit.Timing
protected override bool OnMouseDown(MouseDownEvent e)
{
RepeatBegan?.Invoke();
beginRepeat();
return true;
}
@ -51,6 +55,7 @@ namespace osu.Game.Screens.Edit.Timing
protected override void OnMouseUp(MouseUpEvent e)
{
adjustDelegate?.Cancel();
RepeatEnded?.Invoke();
base.OnMouseUp(e);
}