Suggest removing difficulty filter if no matches found at song select

This commit is contained in:
Dean Herbert 2022-07-01 15:17:53 +09:00
parent 42d56aa640
commit f3af612133

View File

@ -50,7 +50,7 @@ namespace osu.Game.Screens.Select
Masking = true; Masking = true;
CornerRadius = 10; CornerRadius = 10;
Width = 300; Width = 400;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Anchor = Anchor.Centre; Anchor = Anchor.Centre;
@ -118,22 +118,35 @@ namespace osu.Game.Screens.Select
textFlow.AddParagraph("No beatmaps match your filter criteria!"); textFlow.AddParagraph("No beatmaps match your filter criteria!");
textFlow.AddParagraph(string.Empty); textFlow.AddParagraph(string.Empty);
if (string.IsNullOrEmpty(filter?.SearchText)) if (filter?.UserStarDifficulty.HasFilter == true)
{ {
textFlow.AddParagraph("- Try ");
textFlow.AddLink("removing", () =>
{
config.SetValue(OsuSetting.DisplayStarsMinimum, 0.0);
config.SetValue(OsuSetting.DisplayStarsMaximum, 10.1);
});
string lowerStar = filter.UserStarDifficulty.Min == null ? "∞" : $"{filter.UserStarDifficulty.Min:N1}";
string upperStar = filter.UserStarDifficulty.Max == null ? "∞" : $"{filter.UserStarDifficulty.Max:N1}";
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).
// TODO: Make this message more certain by ensuring the osu! beatmaps exist before suggesting. // TODO: Make this message more certain by ensuring the osu! beatmaps exist before suggesting.
if (filter?.Ruleset.OnlineID > 0 && !filter.AllowConvertedBeatmaps) if (filter?.Ruleset.OnlineID > 0 && !filter.AllowConvertedBeatmaps)
{ {
textFlow.AddParagraph("Beatmaps may be available by "); textFlow.AddParagraph("- Try");
textFlow.AddLink("enabling automatic conversion", () => config.SetValue(OsuSetting.ShowConvertedBeatmaps, true)); textFlow.AddLink(" enabling ", () => config.SetValue(OsuSetting.ShowConvertedBeatmaps, true));
textFlow.AddText("!"); textFlow.AddText("automatic conversion!");
} }
}
else if (!string.IsNullOrEmpty(filter?.SearchText))
{ {
textFlow.AddParagraph("You can try "); textFlow.AddParagraph("- Try ");
textFlow.AddLink("searching online", LinkAction.SearchBeatmapSet, filter.SearchText); textFlow.AddLink("searching online", LinkAction.SearchBeatmapSet, filter.SearchText);
textFlow.AddText(" for this query."); textFlow.AddText($" for \"{filter.SearchText}\".");
} }
} }