mirror of
https://github.com/ppy/osu
synced 2025-01-31 10:22:02 +00:00
Merge pull request #20130 from Exanc/master
Display 0 stars instead of infinity for the minimum star slider
This commit is contained in:
commit
d463bd2f3f
@ -65,6 +65,13 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private class MinimumStarsSlider : StarsSlider
|
||||
{
|
||||
public MinimumStarsSlider()
|
||||
: base("0")
|
||||
{
|
||||
}
|
||||
|
||||
public override LocalisableString TooltipText => Current.Value.ToString(@"0.## stars");
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
@ -82,6 +89,11 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private class MaximumStarsSlider : StarsSlider
|
||||
{
|
||||
public MaximumStarsSlider()
|
||||
: base("∞")
|
||||
{
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
@ -96,10 +108,17 @@ 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 StarsSlider(string defaultString)
|
||||
{
|
||||
this.defaultString = defaultString;
|
||||
}
|
||||
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
{
|
||||
base.OnHover(e);
|
||||
@ -125,7 +144,7 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
Current.BindValueChanged(current =>
|
||||
{
|
||||
currentDisplay.Text = current.NewValue != Current.Default ? current.NewValue.ToString("N1") : "∞";
|
||||
currentDisplay.Text = current.NewValue != Current.Default ? current.NewValue.ToString("N1") : defaultString;
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
|
@ -127,10 +127,10 @@ namespace osu.Game.Screens.Select
|
||||
config.SetValue(OsuSetting.DisplayStarsMaximum, 10.1);
|
||||
});
|
||||
|
||||
string lowerStar = filter.UserStarDifficulty.Min == null ? "∞" : $"{filter.UserStarDifficulty.Min:N1}";
|
||||
string lowerStar = $"{filter.UserStarDifficulty.Min ?? 0:N1}";
|
||||
string upperStar = filter.UserStarDifficulty.Max == null ? "∞" : $"{filter.UserStarDifficulty.Max:N1}";
|
||||
|
||||
textFlow.AddText($" the {lowerStar}-{upperStar} star difficulty filter.");
|
||||
textFlow.AddText($" the {lowerStar} - {upperStar} star difficulty filter.");
|
||||
}
|
||||
|
||||
// TODO: Add realm queries to hint at which ruleset results are available in (and allow clicking to switch).
|
||||
|
Loading…
Reference in New Issue
Block a user