1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 19:53:23 +08:00

Slight tweak to the StarsSlider

- MinimumStarsSlider now shows "0" when at it's minimum
 - Modified and NoResultsPlaceholder the tooltip to stay consistent with the changes
This commit is contained in:
Exanc 2022-09-05 00:09:20 +02:00
parent cbc3627189
commit 4ea7ca4c07
2 changed files with 16 additions and 3 deletions

View File

@ -65,6 +65,10 @@ namespace osu.Game.Screens.Select
private class MinimumStarsSlider : StarsSlider private class MinimumStarsSlider : StarsSlider
{ {
public MinimumStarsSlider() : base("0") { }
public override LocalisableString TooltipText => Current.Value.ToString(@"0.## stars");
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
@ -82,6 +86,8 @@ namespace osu.Game.Screens.Select
private class MaximumStarsSlider : StarsSlider private class MaximumStarsSlider : StarsSlider
{ {
public MaximumStarsSlider() : base("∞") { }
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
@ -100,6 +106,13 @@ namespace osu.Game.Screens.Select
? UserInterfaceStrings.NoLimit ? UserInterfaceStrings.NoLimit
: Current.Value.ToString(@"0.## stars"); : Current.Value.ToString(@"0.## stars");
protected readonly string DefaultValue;
public StarsSlider(string defaultValue)
{
DefaultValue = defaultValue;
}
protected override bool OnHover(HoverEvent e) protected override bool OnHover(HoverEvent e)
{ {
base.OnHover(e); base.OnHover(e);
@ -125,7 +138,7 @@ namespace osu.Game.Screens.Select
Current.BindValueChanged(current => Current.BindValueChanged(current =>
{ {
currentDisplay.Text = current.NewValue != Current.Default ? current.NewValue.ToString("N1") : "∞"; currentDisplay.Text = current.NewValue != Current.Default ? current.NewValue.ToString("N1") : DefaultValue;
}, true); }, true);
} }
} }

View File

@ -127,10 +127,10 @@ namespace osu.Game.Screens.Select
config.SetValue(OsuSetting.DisplayStarsMaximum, 10.1); config.SetValue(OsuSetting.DisplayStarsMaximum, 10.1);
}); });
string lowerStar = filter.UserStarDifficulty.Min == null ? "" : $"{filter.UserStarDifficulty.Min:N1}"; string lowerStar = filter.UserStarDifficulty.Min == null ? "0,0" : $"{filter.UserStarDifficulty.Min:N1}";
string upperStar = filter.UserStarDifficulty.Max == null ? "∞" : $"{filter.UserStarDifficulty.Max: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). // TODO: Add realm queries to hint at which ruleset results are available in (and allow clicking to switch).