From c9945b41c1007ab2ff18900d1d70686598e57b9d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 18 Jan 2024 18:36:25 +0900 Subject: [PATCH 1/2] Remove rounding of slider velocity (when applied as scroll speed) This affects both osu!taiko and osu!mania. Closes https://github.com/ppy/osu/issues/25862. --- osu.Game/Beatmaps/ControlPoints/EffectControlPoint.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Beatmaps/ControlPoints/EffectControlPoint.cs b/osu.Game/Beatmaps/ControlPoints/EffectControlPoint.cs index 7edf892f3504..0138ac75693a 100644 --- a/osu.Game/Beatmaps/ControlPoints/EffectControlPoint.cs +++ b/osu.Game/Beatmaps/ControlPoints/EffectControlPoint.cs @@ -21,7 +21,6 @@ public class EffectControlPoint : ControlPoint, IEquatable /// public readonly BindableDouble ScrollSpeedBindable = new BindableDouble(1) { - Precision = 0.01, MinValue = 0.01, MaxValue = 10 }; From 8a11ff122712a15a2f466f01434af76e00ac98f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 29 Jan 2024 11:46:45 +0100 Subject: [PATCH 2/2] Apply local precision workaround to editor effect section --- osu.Game/Screens/Edit/Timing/EffectSection.cs | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Edit/Timing/EffectSection.cs b/osu.Game/Screens/Edit/Timing/EffectSection.cs index 7e484433f733..f321f7eeb0a3 100644 --- a/osu.Game/Screens/Edit/Timing/EffectSection.cs +++ b/osu.Game/Screens/Edit/Timing/EffectSection.cs @@ -52,17 +52,38 @@ void saveChanges() protected override void OnControlPointChanged(ValueChangedEvent point) { - if (point.NewValue != null) + scrollSpeedSlider.Current.ValueChanged -= updateControlPointFromSlider; + + if (point.NewValue is EffectControlPoint newEffectPoint) { isRebinding = true; - kiai.Current = point.NewValue.KiaiModeBindable; - scrollSpeedSlider.Current = point.NewValue.ScrollSpeedBindable; + kiai.Current = newEffectPoint.KiaiModeBindable; + scrollSpeedSlider.Current = new BindableDouble + { + MinValue = 0.01, + MaxValue = 10, + Precision = 0.01, + Value = newEffectPoint.ScrollSpeedBindable.Value + }; + scrollSpeedSlider.Current.ValueChanged += updateControlPointFromSlider; + // at this point in time the above is enough to keep the slider control in sync with reality, + // since undo/redo causes `OnControlPointChanged()` to fire. + // whenever that stops being the case, or there is a possibility that the scroll speed could be changed + // by something else other than this control, this code should probably be revisited to have a binding in the other direction, too. isRebinding = false; } } + private void updateControlPointFromSlider(ValueChangedEvent scrollSpeed) + { + if (ControlPoint.Value is not EffectControlPoint effectPoint || isRebinding) + return; + + effectPoint.ScrollSpeedBindable.Value = scrollSpeed.NewValue; + } + protected override EffectControlPoint CreatePoint() { var reference = Beatmap.ControlPointInfo.EffectPointAt(SelectedGroup.Value.Time);