mirror of
https://github.com/ppy/osu.git
synced 2024-09-22 16:47:24 +08:00
Fix reset happening on mouse down instead of mouse up
Also some reorganisation of file content for legibility
This commit is contained in:
parent
0c493dd359
commit
943e904c71
@ -60,6 +60,10 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
|
|
||||||
private const int light_count = 6;
|
private const int light_count = 6;
|
||||||
|
|
||||||
|
private const int initial_taps_to_ignore = 4;
|
||||||
|
|
||||||
|
private const int max_taps_to_consider = 8;
|
||||||
|
|
||||||
private readonly List<double> tapTimings = new List<double>();
|
private readonly List<double> tapTimings = new List<double>();
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -223,10 +227,9 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
grabbedMouseDown = true;
|
grabbedMouseDown = true;
|
||||||
IsHandlingTapping.Value = true;
|
IsHandlingTapping.Value = true;
|
||||||
|
|
||||||
handleTap();
|
|
||||||
|
|
||||||
resetDelegate?.Cancel();
|
resetDelegate?.Cancel();
|
||||||
resetDelegate = Scheduler.AddDelayed(reset, 1000);
|
|
||||||
|
handleTap();
|
||||||
|
|
||||||
textContainer.FadeColour(textColour, in_duration, Easing.OutQuint);
|
textContainer.FadeColour(textColour, in_duration, Easing.OutQuint);
|
||||||
|
|
||||||
@ -259,6 +262,9 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
scaleContainer.ScaleTo(1, out_duration, Easing.OutQuint);
|
scaleContainer.ScaleTo(1, out_duration, Easing.OutQuint);
|
||||||
innerCircle.ScaleTo(1, out_duration, Easing.OutQuint);
|
innerCircle.ScaleTo(1, out_duration, Easing.OutQuint);
|
||||||
innerCircleHighlight.FadeOut(out_duration, Easing.OutQuint);
|
innerCircleHighlight.FadeOut(out_duration, Easing.OutQuint);
|
||||||
|
|
||||||
|
resetDelegate = Scheduler.AddDelayed(reset, 1000);
|
||||||
|
|
||||||
base.OnMouseUp(e);
|
base.OnMouseUp(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -280,26 +286,6 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
OnMouseUp(new MouseUpEvent(e.CurrentState, MouseButton.Left));
|
OnMouseUp(new MouseUpEvent(e.CurrentState, MouseButton.Left));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reset()
|
|
||||||
{
|
|
||||||
bpmText.FadeOut(500, Easing.OutQuint);
|
|
||||||
|
|
||||||
using (BeginDelayedSequence(tapTimings.Count > 0 ? 500 : 0))
|
|
||||||
{
|
|
||||||
Schedule(() => bpmText.Text = "the beat!");
|
|
||||||
bpmText.FadeIn(800, Easing.OutQuint);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var light in lights)
|
|
||||||
light.Hide();
|
|
||||||
|
|
||||||
tapTimings.Clear();
|
|
||||||
IsHandlingTapping.Value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private const int initial_taps_to_ignore = 4;
|
|
||||||
private const int max_taps_to_consider = 8;
|
|
||||||
|
|
||||||
private void handleTap()
|
private void handleTap()
|
||||||
{
|
{
|
||||||
tapTimings.Add(Clock.CurrentTime);
|
tapTimings.Add(Clock.CurrentTime);
|
||||||
@ -326,6 +312,23 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void reset()
|
||||||
|
{
|
||||||
|
bpmText.FadeOut(500, Easing.OutQuint);
|
||||||
|
|
||||||
|
using (BeginDelayedSequence(tapTimings.Count > 0 ? 500 : 0))
|
||||||
|
{
|
||||||
|
Schedule(() => bpmText.Text = "the beat!");
|
||||||
|
bpmText.FadeIn(800, Easing.OutQuint);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var light in lights)
|
||||||
|
light.Hide();
|
||||||
|
|
||||||
|
tapTimings.Clear();
|
||||||
|
IsHandlingTapping.Value = false;
|
||||||
|
}
|
||||||
|
|
||||||
private class Light : CompositeDrawable
|
private class Light : CompositeDrawable
|
||||||
{
|
{
|
||||||
public Drawable Glow { get; private set; } = null!;
|
public Drawable Glow { get; private set; } = null!;
|
||||||
|
Loading…
Reference in New Issue
Block a user