1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-04 06:53:20 +08:00
This commit is contained in:
smoogipoo 2019-08-27 11:59:25 +09:00
parent 9321f20884
commit 6368189d46

View File

@ -220,12 +220,23 @@ namespace osu.Game.Screens.Select.Carousel
public class FilterableGroupedDifficultyIcon : GroupedDifficultyIcon public class FilterableGroupedDifficultyIcon : GroupedDifficultyIcon
{ {
private readonly List<CarouselBeatmap> items;
public FilterableGroupedDifficultyIcon(List<CarouselBeatmap> items, RulesetInfo ruleset) public FilterableGroupedDifficultyIcon(List<CarouselBeatmap> items, RulesetInfo ruleset)
: base(items.Select(i => i.Beatmap).ToList(), ruleset, Color4.White) : base(items.Select(i => i.Beatmap).ToList(), ruleset, Color4.White)
{
this.items = items;
foreach (var item in items)
item.Filtered.BindValueChanged(_ => Scheduler.AddOnce(updateFilteredDisplay));
updateFilteredDisplay();
}
private void updateFilteredDisplay()
{ {
// for now, fade the whole group based on the ratio of hidden items. // for now, fade the whole group based on the ratio of hidden items.
items.ForEach(item => item.Filtered.BindValueChanged(_ => this.FadeTo(1 - 0.9f * ((float)items.Count(i => i.Filtered.Value) / items.Count), 100);
this.FadeTo(1 - 0.9f * ((float)items.Count(i => i.Filtered.Value) / items.Count), 100), true));
} }
} }
} }