mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 11:42:55 +08:00
Add comments count to user profile overlay
This commit is contained in:
parent
ee7370b21a
commit
e31d583a7f
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Humanizer;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
@ -115,6 +116,11 @@ namespace osu.Game.Overlays.Profile.Header
|
|||||||
topLinkContainer.AddText("Contributed ");
|
topLinkContainer.AddText("Contributed ");
|
||||||
topLinkContainer.AddLink($@"{user.PostCount:#,##0} forum posts", $"{api.WebsiteRootUrl}/users/{user.Id}/posts", creationParameters: embolden);
|
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;
|
string websiteWithoutProtocol = user.Website;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(websiteWithoutProtocol))
|
if (!string.IsNullOrEmpty(websiteWithoutProtocol))
|
||||||
|
@ -120,6 +120,9 @@ namespace osu.Game.Users
|
|||||||
[JsonProperty(@"post_count")]
|
[JsonProperty(@"post_count")]
|
||||||
public int PostCount;
|
public int PostCount;
|
||||||
|
|
||||||
|
[JsonProperty(@"comments_count")]
|
||||||
|
public int CommentsCount;
|
||||||
|
|
||||||
[JsonProperty(@"follower_count")]
|
[JsonProperty(@"follower_count")]
|
||||||
public int FollowerCount;
|
public int FollowerCount;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user