Rename default value field and make private

This commit is contained in:
Dean Herbert 2022-09-08 15:53:08 +09:00
parent 9ead5e59d3
commit d523a2ac33

View File

@ -65,7 +65,10 @@ namespace osu.Game.Screens.Select
private class MinimumStarsSlider : StarsSlider
{
public MinimumStarsSlider() : base("0") { }
public MinimumStarsSlider()
: base("0")
{
}
public override LocalisableString TooltipText => Current.Value.ToString(@"0.## stars");
@ -86,7 +89,10 @@ namespace osu.Game.Screens.Select
private class MaximumStarsSlider : StarsSlider
{
public MaximumStarsSlider() : base("∞") { }
public MaximumStarsSlider()
: base("∞")
{
}
protected override void LoadComplete()
{
@ -102,15 +108,15 @@ namespace osu.Game.Screens.Select
private class StarsSlider : OsuSliderBar<double>
{
private readonly string defaultString;
public override LocalisableString TooltipText => Current.IsDefault
? UserInterfaceStrings.NoLimit
: Current.Value.ToString(@"0.## stars");
protected readonly string DefaultValue;
public StarsSlider(string defaultValue)
protected StarsSlider(string defaultString)
{
DefaultValue = defaultValue;
this.defaultString = defaultString;
}
protected override bool OnHover(HoverEvent e)
@ -138,7 +144,7 @@ namespace osu.Game.Screens.Select
Current.BindValueChanged(current =>
{
currentDisplay.Text = current.NewValue != Current.Default ? current.NewValue.ToString("N1") : DefaultValue;
currentDisplay.Text = current.NewValue != Current.Default ? current.NewValue.ToString("N1") : defaultString;
}, true);
}
}