// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Beatmaps.ControlPoints; using osu.Game.Overlays.Settings; namespace osu.Game.Screens.Edit.Timing { internal class DifficultySection : Section { private SettingsSlider multiplier; [BackgroundDependencyLoader] private void load() { Flow.AddRange(new[] { multiplier = new SettingsSlider { LabelText = "Speed Multiplier", Bindable = new DifficultyControlPoint().SpeedMultiplierBindable, RelativeSizeAxes = Axes.X, } }); } protected override void LoadComplete() { base.LoadComplete(); ControlPoint.BindValueChanged(point => { if (point.NewValue != null) { multiplier.Bindable = point.NewValue.SpeedMultiplierBindable; } }, true); } protected override DifficultyControlPoint CreatePoint() { var reference = Beatmap.Value.Beatmap.ControlPointInfo.DifficultyPointAt(SelectedGroup.Value.Time); return new DifficultyControlPoint { SpeedMultiplier = reference.SpeedMultiplier, }; } } }