mirror of
https://github.com/ppy/osu.git
synced 2025-02-12 21:43:25 +08:00
Rename default value field and make private
This commit is contained in:
parent
9ead5e59d3
commit
d523a2ac33
@ -65,7 +65,10 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
private class MinimumStarsSlider : StarsSlider
|
private class MinimumStarsSlider : StarsSlider
|
||||||
{
|
{
|
||||||
public MinimumStarsSlider() : base("0") { }
|
public MinimumStarsSlider()
|
||||||
|
: base("0")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public override LocalisableString TooltipText => Current.Value.ToString(@"0.## stars");
|
public override LocalisableString TooltipText => Current.Value.ToString(@"0.## stars");
|
||||||
|
|
||||||
@ -86,7 +89,10 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
private class MaximumStarsSlider : StarsSlider
|
private class MaximumStarsSlider : StarsSlider
|
||||||
{
|
{
|
||||||
public MaximumStarsSlider() : base("∞") { }
|
public MaximumStarsSlider()
|
||||||
|
: base("∞")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
@ -102,15 +108,15 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
private class StarsSlider : OsuSliderBar<double>
|
private class StarsSlider : OsuSliderBar<double>
|
||||||
{
|
{
|
||||||
|
private readonly string defaultString;
|
||||||
|
|
||||||
public override LocalisableString TooltipText => Current.IsDefault
|
public override LocalisableString TooltipText => Current.IsDefault
|
||||||
? UserInterfaceStrings.NoLimit
|
? UserInterfaceStrings.NoLimit
|
||||||
: Current.Value.ToString(@"0.## stars");
|
: Current.Value.ToString(@"0.## stars");
|
||||||
|
|
||||||
protected readonly string DefaultValue;
|
protected StarsSlider(string defaultString)
|
||||||
|
|
||||||
public StarsSlider(string defaultValue)
|
|
||||||
{
|
{
|
||||||
DefaultValue = defaultValue;
|
this.defaultString = defaultString;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnHover(HoverEvent e)
|
protected override bool OnHover(HoverEvent e)
|
||||||
@ -138,7 +144,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
Current.BindValueChanged(current =>
|
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);
|
}, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user