mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 09:03:50 +09:00
Merge pull request #5840 from EVAST9919/fix-diff-icons
Fix filtered grouped difficulty items in DrawableCarouselBeatmapSet aren't hidden on first load Co-authored-by: Dan Balasescu <smoogipoo@smgi.me>
This commit is contained in:
@ -220,14 +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)
|
||||||
{
|
{
|
||||||
items.ForEach(item => item.Filtered.ValueChanged += _ =>
|
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.
|
||||||
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);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user