Fix up replay settings sliderbar formatting

This commit is contained in:
smoogipoo 2018-01-05 14:37:32 +09:00
parent b84da31174
commit 1571c10c42
2 changed files with 12 additions and 2 deletions

View File

@ -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<T, U> : SettingsItem<T>
where T : struct, IEquatable<T>
where U : SliderBar<T>, new()
where U : OsuSliderBar<T>, new()
{
protected override Drawable CreateControl() => new U
{
@ -24,6 +24,15 @@ namespace osu.Game.Overlays.Settings
RelativeSizeAxes = Axes.X
};
/// <summary>
/// The format that will be used for the tooltip when the sliderbar is hovered.
/// </summary>
public NumberFormatInfo Format
{
get => ((U)Control).Format;
set => ((U)Control).Format = value;
}
public float KeyboardStep;
[BackgroundDependencyLoader]

View File

@ -59,6 +59,7 @@ namespace osu.Game.Screens.Play.ReplaySettings
}
};
sliderbar.Format.NumberDecimalDigits = 2;
sliderbar.Bindable.ValueChanged += rateMultiplier => multiplierText.Text = $"{rateMultiplier}x";
}