mirror of
https://github.com/ppy/osu
synced 2025-01-20 04:50:50 +00:00
Fix up replay settings sliderbar formatting
This commit is contained in:
parent
b84da31174
commit
1571c10c42
@ -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]
|
||||
|
@ -59,6 +59,7 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
||||
}
|
||||
};
|
||||
|
||||
sliderbar.Format.NumberDecimalDigits = 2;
|
||||
sliderbar.Bindable.ValueChanged += rateMultiplier => multiplierText.Text = $"{rateMultiplier}x";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user