diff --git a/osu.Game/Overlays/Settings/SettingsSlider.cs b/osu.Game/Overlays/Settings/SettingsSlider.cs index 49d73f77ec..db6e5e3f2e 100644 --- a/osu.Game/Overlays/Settings/SettingsSlider.cs +++ b/osu.Game/Overlays/Settings/SettingsSlider.cs @@ -2,9 +2,9 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; +using System.Globalization; using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Settings @@ -16,7 +16,7 @@ namespace osu.Game.Overlays.Settings public class SettingsSlider : SettingsItem where T : struct, IEquatable - where U : SliderBar, new() + where U : OsuSliderBar, new() { protected override Drawable CreateControl() => new U { @@ -24,6 +24,15 @@ namespace osu.Game.Overlays.Settings RelativeSizeAxes = Axes.X }; + /// + /// The format that will be used for the tooltip when the sliderbar is hovered. + /// + public NumberFormatInfo Format + { + get => ((U)Control).Format; + set => ((U)Control).Format = value; + } + public float KeyboardStep; [BackgroundDependencyLoader] diff --git a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs index 3109552532..a7b03c3742 100644 --- a/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs +++ b/osu.Game/Screens/Play/ReplaySettings/PlaybackSettings.cs @@ -59,6 +59,7 @@ namespace osu.Game.Screens.Play.ReplaySettings } }; + sliderbar.Format.NumberDecimalDigits = 2; sliderbar.Bindable.ValueChanged += rateMultiplier => multiplierText.Text = $"{rateMultiplier}x"; }