Skip to content

Commit

Permalink
Adjust beatmap statistic.
Browse files Browse the repository at this point in the history
  • Loading branch information
andy840119 committed Sep 11, 2020
1 parent dadb1be commit 5e96ed1
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions osu.Game.Rulesets.Karaoke/Beatmaps/KaraokeBeatmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,33 @@ public override IEnumerable<BeatmapStatistic> 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<BeatmapStatistic>
{
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();
}
}
}

0 comments on commit 5e96ed1

Please sign in to comment.