2019-10-28 12:42:17 +09:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
2019-10-27 15:19:36 +09:00
|
|
|
using osu.Framework.Allocation;
|
2019-11-06 14:36:43 +09:00
|
|
|
using osu.Framework.Bindables;
|
2019-10-27 15:19:36 +09:00
|
|
|
using osu.Game.Beatmaps.ControlPoints;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Edit.Timing
|
|
|
|
{
|
|
|
|
internal class DifficultySection : Section<DifficultyControlPoint>
|
|
|
|
{
|
2020-09-30 17:52:12 +09:00
|
|
|
private SliderWithTextBoxInput<double> multiplierSlider;
|
2019-10-27 15:19:36 +09:00
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load()
|
|
|
|
{
|
|
|
|
Flow.AddRange(new[]
|
|
|
|
{
|
2020-09-30 17:52:12 +09:00
|
|
|
multiplierSlider = new SliderWithTextBoxInput<double>("Speed Multiplier")
|
2019-10-28 16:21:31 +09:00
|
|
|
{
|
2020-09-30 17:52:12 +09:00
|
|
|
Current = new DifficultyControlPoint().SpeedMultiplierBindable
|
2019-10-28 16:21:31 +09:00
|
|
|
}
|
2019-10-27 15:19:36 +09:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-11-06 14:36:43 +09:00
|
|
|
protected override void OnControlPointChanged(ValueChangedEvent<DifficultyControlPoint> point)
|
2019-10-27 15:19:36 +09:00
|
|
|
{
|
2019-11-06 16:22:55 +09:00
|
|
|
if (point.NewValue != null)
|
2019-10-28 16:21:31 +09:00
|
|
|
{
|
2020-09-30 17:52:12 +09:00
|
|
|
multiplierSlider.Current = point.NewValue.SpeedMultiplierBindable;
|
2020-10-02 17:58:22 +09:00
|
|
|
multiplierSlider.Current.BindValueChanged(_ => ChangeHandler?.SaveState());
|
2019-11-06 16:22:55 +09:00
|
|
|
}
|
2019-10-27 15:19:36 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
protected override DifficultyControlPoint CreatePoint()
|
|
|
|
{
|
|
|
|
var reference = Beatmap.Value.Beatmap.ControlPointInfo.DifficultyPointAt(SelectedGroup.Value.Time);
|
|
|
|
|
|
|
|
return new DifficultyControlPoint
|
|
|
|
{
|
|
|
|
SpeedMultiplier = reference.SpeedMultiplier,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|