mirror of
https://github.com/ppy/osu.git
synced 2025-02-07 02:23:08 +08:00
Remove turboweird function and update displayed bpm text
This commit is contained in:
parent
9ea7afb38e
commit
0641d2b510
@ -226,7 +226,7 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
Clock = new FramedClock(metronomeClock = new StopwatchClock(true));
|
Clock = new FramedClock(metronomeClock = new StopwatchClock(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
private double beatLength;
|
private double effectiveBeatLength;
|
||||||
|
|
||||||
private TimingControlPoint timingPoint = null!;
|
private TimingControlPoint timingPoint = null!;
|
||||||
|
|
||||||
@ -238,27 +238,24 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
|
|
||||||
private bool spedUp;
|
private bool spedUp;
|
||||||
|
|
||||||
private bool updateDivisor()
|
private int computeSpedUpDivisor()
|
||||||
{
|
{
|
||||||
int divisor = 1;
|
if (!spedUp)
|
||||||
|
return 1;
|
||||||
|
|
||||||
if (spedUp)
|
if (beatDivisor.Value % 3 == 0)
|
||||||
divisor = beatDivisor.Value % 3 == 0 ? 3 : 2;
|
return 3;
|
||||||
|
if (beatDivisor.Value % 2 == 0)
|
||||||
|
return 2;
|
||||||
|
|
||||||
if (divisor == Divisor)
|
return 1;
|
||||||
return false;
|
|
||||||
|
|
||||||
Divisor = divisor;
|
|
||||||
metronomeTick.Divisor = divisor;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
interpolatedBpm.BindValueChanged(bpm => bpmText.Text = bpm.NewValue.ToLocalisableString());
|
interpolatedBpm.BindValueChanged(_ => bpmText.Text = interpolatedBpm.Value.ToLocalisableString());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
@ -272,16 +269,20 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
|
|
||||||
timingPoint = BeatSyncSource.ControlPoints.TimingPointAt(BeatSyncSource.Clock.CurrentTime);
|
timingPoint = BeatSyncSource.ControlPoints.TimingPointAt(BeatSyncSource.Clock.CurrentTime);
|
||||||
|
|
||||||
if (updateDivisor() || beatLength != timingPoint.BeatLength)
|
Divisor = metronomeTick.Divisor = computeSpedUpDivisor();
|
||||||
|
|
||||||
|
if (effectiveBeatLength != timingPoint.BeatLength / Divisor)
|
||||||
{
|
{
|
||||||
beatLength = timingPoint.BeatLength;
|
effectiveBeatLength = timingPoint.BeatLength / Divisor;
|
||||||
|
|
||||||
EarlyActivationMilliseconds = timingPoint.BeatLength / 2;
|
EarlyActivationMilliseconds = timingPoint.BeatLength / 2;
|
||||||
|
|
||||||
float bpmRatio = (float)Interpolation.ApplyEasing(Easing.OutQuad, Math.Clamp((timingPoint.BPM - 30) / 480 * Divisor, 0, 1));
|
double effectiveBpm = 60000 / effectiveBeatLength;
|
||||||
|
|
||||||
|
float bpmRatio = (float)Interpolation.ApplyEasing(Easing.OutQuad, Math.Clamp((effectiveBpm - 30) / 480, 0, 1));
|
||||||
|
|
||||||
weight.MoveToY((float)Interpolation.Lerp(0.1f, 0.83f, bpmRatio), 600, Easing.OutQuint);
|
weight.MoveToY((float)Interpolation.Lerp(0.1f, 0.83f, bpmRatio), 600, Easing.OutQuint);
|
||||||
this.TransformBindableTo(interpolatedBpm, (int)Math.Round(timingPoint.BPM), 600, Easing.OutQuint);
|
this.TransformBindableTo(interpolatedBpm, (int)Math.Round(effectiveBpm), 600, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!BeatSyncSource.Clock.IsRunning && isSwinging)
|
if (!BeatSyncSource.Clock.IsRunning && isSwinging)
|
||||||
@ -327,7 +328,7 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
float currentAngle = swing.Rotation;
|
float currentAngle = swing.Rotation;
|
||||||
float targetAngle = currentAngle > 0 ? -angle : angle;
|
float targetAngle = currentAngle > 0 ? -angle : angle;
|
||||||
|
|
||||||
swing.RotateTo(targetAngle, beatLength, Easing.InOutQuad);
|
swing.RotateTo(targetAngle, effectiveBeatLength, Easing.InOutQuad);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onTickPlayed()
|
private void onTickPlayed()
|
||||||
@ -335,7 +336,7 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
// Originally, this flash only occurred when the pendulum correctly passess the centre.
|
// Originally, this flash only occurred when the pendulum correctly passess the centre.
|
||||||
// Mappers weren't happy with the metronome tick not playing immediately after starting playback
|
// Mappers weren't happy with the metronome tick not playing immediately after starting playback
|
||||||
// so now this matches the actual tick sample.
|
// so now this matches the actual tick sample.
|
||||||
stick.FlashColour(overlayColourProvider.Content1, beatLength, Easing.OutQuint);
|
stick.FlashColour(overlayColourProvider.Content1, effectiveBeatLength, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnKeyDown(KeyDownEvent e)
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
|
Loading…
Reference in New Issue
Block a user