From 5e96ed12b8b3a3fe7ed5992004a85c4fd5a2e177 Mon Sep 17 00:00:00 2001 From: andy840119 Date: Fri, 11 Sep 2020 10:50:21 +0900 Subject: [PATCH] Adjust beatmap statistic. --- .../Beatmaps/KaraokeBeatmap.cs | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmap.cs b/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmap.cs index 0b2ec1e7c..4b5dd09a5 100644 --- a/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmap.cs +++ b/osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmap.cs @@ -15,29 +15,33 @@ public override IEnumerable GetStatistics() { int singers = 1; int lyrics = HitObjects.Count(s => s is LyricLine); - int notes = HitObjects.Count(s => s is Note); - return new[] + var defaultStatistic = new List { new BeatmapStatistic { Name = @"Singer", Content = singers.ToString(), - Icon = FontAwesome.Solid.User + CreateIcon = () => new SpriteIcon { Icon = FontAwesome.Solid.User } }, new BeatmapStatistic { Name = @"Lyric", Content = lyrics.ToString(), - Icon = FontAwesome.Solid.AlignLeft + CreateIcon = () => new SpriteIcon { Icon = FontAwesome.Solid.AlignLeft } }, - new BeatmapStatistic + }; + + int notes = HitObjects.Count(s => s is Note note && note.Display); + if (notes > 0) + defaultStatistic.Add(new BeatmapStatistic { Name = @"Note", Content = notes.ToString(), - Icon = FontAwesome.Solid.Music - }, - }; + CreateIcon = () => new SpriteIcon { Icon = FontAwesome.Solid.Music } + }); + + return defaultStatistic.ToArray(); } } }