mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 23:53:51 +09:00
Merge pull request #18963 from peppy/more-placeholder-suggestions
Add difficulty filter reset to song select "no results" suggestions
This commit is contained in:
@ -97,6 +97,22 @@ namespace osu.Game.Tests.Visual.SongSelect
|
||||
AddUntilStep("wait for placeholder visible", () => getPlaceholder()?.State.Value == Visibility.Visible);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestPlaceholderStarDifficulty()
|
||||
{
|
||||
addRulesetImportStep(0);
|
||||
AddStep("change star filter", () => config.SetValue(OsuSetting.DisplayStarsMinimum, 10.0));
|
||||
|
||||
createSongSelect();
|
||||
|
||||
AddUntilStep("wait for placeholder visible", () => getPlaceholder()?.State.Value == Visibility.Visible);
|
||||
|
||||
AddStep("click link in placeholder", () => getPlaceholder().ChildrenOfType<DrawableLinkCompiler>().First().TriggerClick());
|
||||
|
||||
AddUntilStep("star filter reset", () => config.Get<double>(OsuSetting.DisplayStarsMinimum) == 0.0);
|
||||
AddUntilStep("wait for placeholder visible", () => getPlaceholder()?.State.Value == Visibility.Hidden);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestPlaceholderConvertSetting()
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ namespace osu.Game.Screens.Select
|
||||
Masking = true;
|
||||
CornerRadius = 10;
|
||||
|
||||
Width = 300;
|
||||
Width = 400;
|
||||
AutoSizeAxes = Axes.Y;
|
||||
|
||||
Anchor = Anchor.Centre;
|
||||
@ -118,22 +118,35 @@ namespace osu.Game.Screens.Select
|
||||
textFlow.AddParagraph("No beatmaps match your filter criteria!");
|
||||
textFlow.AddParagraph(string.Empty);
|
||||
|
||||
if (string.IsNullOrEmpty(filter?.SearchText))
|
||||
if (filter?.UserStarDifficulty.HasFilter == true)
|
||||
{
|
||||
// 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.
|
||||
if (filter?.Ruleset.OnlineID > 0 && !filter.AllowConvertedBeatmaps)
|
||||
textFlow.AddParagraph("- Try ");
|
||||
textFlow.AddLink("removing", () =>
|
||||
{
|
||||
textFlow.AddParagraph("Beatmaps may be available by ");
|
||||
textFlow.AddLink("enabling automatic conversion", () => config.SetValue(OsuSetting.ShowConvertedBeatmaps, true));
|
||||
textFlow.AddText("!");
|
||||
}
|
||||
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.");
|
||||
}
|
||||
else
|
||||
|
||||
// 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.
|
||||
if (filter?.Ruleset?.OnlineID > 0 && !filter.AllowConvertedBeatmaps)
|
||||
{
|
||||
textFlow.AddParagraph("You can try ");
|
||||
textFlow.AddParagraph("- Try");
|
||||
textFlow.AddLink(" enabling ", () => config.SetValue(OsuSetting.ShowConvertedBeatmaps, true));
|
||||
textFlow.AddText("automatic conversion!");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(filter?.SearchText))
|
||||
{
|
||||
textFlow.AddParagraph("- Try ");
|
||||
textFlow.AddLink("searching online", LinkAction.SearchBeatmapSet, filter.SearchText);
|
||||
textFlow.AddText(" for this query.");
|
||||
textFlow.AddText($" for \"{filter.SearchText}\".");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user