Add comments count to user profile overlay

This commit is contained in:
Joehu 2021-03-21 11:16:59 -07:00
parent ee7370b21a
commit e31d583a7f
2 changed files with 9 additions and 0 deletions

View File

@ -3,6 +3,7 @@
using System;
using System.Linq;
using Humanizer;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions;
@ -115,6 +116,11 @@ namespace osu.Game.Overlays.Profile.Header
topLinkContainer.AddText("Contributed ");
topLinkContainer.AddLink($@"{user.PostCount:#,##0} forum posts", $"{api.WebsiteRootUrl}/users/{user.Id}/posts", creationParameters: embolden);
addSpacer(topLinkContainer);
topLinkContainer.AddText("Posted ");
topLinkContainer.AddLink("comment".ToQuantity(user.CommentsCount, "#,##0"), $"{api.WebsiteRootUrl}/comments?user_id={user.Id}", creationParameters: embolden);
string websiteWithoutProtocol = user.Website;
if (!string.IsNullOrEmpty(websiteWithoutProtocol))

View File

@ -120,6 +120,9 @@ namespace osu.Game.Users
[JsonProperty(@"post_count")]
public int PostCount;
[JsonProperty(@"comments_count")]
public int CommentsCount;
[JsonProperty(@"follower_count")]
public int FollowerCount;