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:
parent
fe7f13cb77
commit
a62550b323
@ -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 ||
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user