mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Modernise filter implementation
This commit is contained in:
@ -44,7 +44,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
match &= !criteria.Artist.HasFilter || criteria.Artist.Matches(Beatmap.Metadata.Artist) ||
|
match &= !criteria.Artist.HasFilter || criteria.Artist.Matches(Beatmap.Metadata.Artist) ||
|
||||||
criteria.Artist.Matches(Beatmap.Metadata.ArtistUnicode);
|
criteria.Artist.Matches(Beatmap.Metadata.ArtistUnicode);
|
||||||
|
|
||||||
match &= Beatmap.StarDifficulty >= criteria.DisplayStarsMinimum && Beatmap.StarDifficulty <= criteria.DisplayStarsMaximum;
|
match &= !criteria.UserStarDifficulty.HasFilter || criteria.UserStarDifficulty.IsInRange(Beatmap.StarDifficulty);
|
||||||
|
|
||||||
if (match)
|
if (match)
|
||||||
{
|
{
|
||||||
|
@ -42,11 +42,15 @@ namespace osu.Game.Screens.Select
|
|||||||
Group = groupMode.Value,
|
Group = groupMode.Value,
|
||||||
Sort = sortMode.Value,
|
Sort = sortMode.Value,
|
||||||
AllowConvertedBeatmaps = showConverted.Value,
|
AllowConvertedBeatmaps = showConverted.Value,
|
||||||
Ruleset = ruleset.Value
|
Ruleset = ruleset.Value,
|
||||||
DisplayStarsMinimum = minimumStars,
|
|
||||||
DisplayStarsMaximum = maximumStars,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (!minimumStars.IsDefault)
|
||||||
|
criteria.UserStarDifficulty.Min = minimumStars.Value;
|
||||||
|
|
||||||
|
if (!maximumStars.IsDefault)
|
||||||
|
criteria.UserStarDifficulty.Max = maximumStars.Value;
|
||||||
|
|
||||||
FilterQueryParser.ApplyQueries(criteria, query);
|
FilterQueryParser.ApplyQueries(criteria, query);
|
||||||
return criteria;
|
return criteria;
|
||||||
}
|
}
|
||||||
|
@ -25,13 +25,12 @@ namespace osu.Game.Screens.Select
|
|||||||
public OptionalRange<BeatmapSetOnlineStatus> OnlineStatus;
|
public OptionalRange<BeatmapSetOnlineStatus> OnlineStatus;
|
||||||
public OptionalTextFilter Creator;
|
public OptionalTextFilter Creator;
|
||||||
public OptionalTextFilter Artist;
|
public OptionalTextFilter Artist;
|
||||||
|
public OptionalRange<double> UserStarDifficulty;
|
||||||
|
|
||||||
public string[] SearchTerms = Array.Empty<string>();
|
public string[] SearchTerms = Array.Empty<string>();
|
||||||
|
|
||||||
public RulesetInfo Ruleset;
|
public RulesetInfo Ruleset;
|
||||||
public bool AllowConvertedBeatmaps;
|
public bool AllowConvertedBeatmaps;
|
||||||
public double DisplayStarsMinimum;
|
|
||||||
public double DisplayStarsMaximum;
|
|
||||||
|
|
||||||
private string searchText;
|
private string searchText;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user