1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 02:03:22 +08:00

Reapply filters on next change after a forced beatmap display

This commit is contained in:
Dean Herbert 2020-03-04 20:14:18 +09:00
parent fe7f13cb77
commit a62550b323
4 changed files with 15 additions and 3 deletions

View File

@ -25,6 +25,13 @@ namespace osu.Game.Screens.Select.Carousel
{
base.Filter(criteria);
if (Beatmap.Equals(criteria.SelectedBeatmap))
{
// bypass filtering for selected beatmap
Filtered.Value = false;
return;
}
bool match =
criteria.Ruleset == null ||
Beatmap.RulesetID == criteria.Ruleset.ID ||

View File

@ -16,7 +16,7 @@ namespace osu.Game.Screens.Select.Carousel
/// <summary>
/// This item is not in a hidden state.
/// </summary>
public bool Visible => State.Value == CarouselItemState.Selected || (State.Value != CarouselItemState.Collapsed && !Filtered.Value);
public bool Visible => State.Value != CarouselItemState.Collapsed && !Filtered.Value;
public virtual List<DrawableCarouselItem> Drawables
{

View File

@ -15,6 +15,8 @@ namespace osu.Game.Screens.Select
public GroupMode Group;
public SortMode Sort;
public BeatmapInfo SelectedBeatmap;
public OptionalRange<double> StarDifficulty;
public OptionalRange<float> ApproachRate;
public OptionalRange<float> DrainRate;

View File

@ -392,8 +392,11 @@ namespace osu.Game.Screens.Select
}
// Even if a ruleset mismatch was not the cause (ie. a text filter is applied),
// we still want to forcefully show the new beatmap, bypassing filters.
Carousel.SelectBeatmap(e.NewValue.BeatmapInfo);
// we still want to temporarily show the new beatmap, bypassing filters.
// This will be undone the next time the user changes the filter.
var criteria = FilterControl.CreateCriteria();
criteria.SelectedBeatmap = e.NewValue.BeatmapInfo;
Carousel.Filter(criteria);
}
}