mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:37:28 +08:00
Apply local precision workaround to editor effect section
This commit is contained in:
parent
cf97cb1e0c
commit
8a11ff1227
@ -52,17 +52,38 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
|
|
||||||
protected override void OnControlPointChanged(ValueChangedEvent<EffectControlPoint?> point)
|
protected override void OnControlPointChanged(ValueChangedEvent<EffectControlPoint?> point)
|
||||||
{
|
{
|
||||||
if (point.NewValue != null)
|
scrollSpeedSlider.Current.ValueChanged -= updateControlPointFromSlider;
|
||||||
|
|
||||||
|
if (point.NewValue is EffectControlPoint newEffectPoint)
|
||||||
{
|
{
|
||||||
isRebinding = true;
|
isRebinding = true;
|
||||||
|
|
||||||
kiai.Current = point.NewValue.KiaiModeBindable;
|
kiai.Current = newEffectPoint.KiaiModeBindable;
|
||||||
scrollSpeedSlider.Current = point.NewValue.ScrollSpeedBindable;
|
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;
|
isRebinding = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateControlPointFromSlider(ValueChangedEvent<double> scrollSpeed)
|
||||||
|
{
|
||||||
|
if (ControlPoint.Value is not EffectControlPoint effectPoint || isRebinding)
|
||||||
|
return;
|
||||||
|
|
||||||
|
effectPoint.ScrollSpeedBindable.Value = scrollSpeed.NewValue;
|
||||||
|
}
|
||||||
|
|
||||||
protected override EffectControlPoint CreatePoint()
|
protected override EffectControlPoint CreatePoint()
|
||||||
{
|
{
|
||||||
var reference = Beatmap.ControlPointInfo.EffectPointAt(SelectedGroup.Value.Time);
|
var reference = Beatmap.ControlPointInfo.EffectPointAt(SelectedGroup.Value.Time);
|
||||||
|
Loading…
Reference in New Issue
Block a user