Handle edited comments

This commit is contained in:
Andrei Zavatski
2019-10-09 11:32:17 +03:00
parent a0dfbfe148
commit ad99a3236f
3 changed files with 18 additions and 1 deletions

View File

@ -35,6 +35,7 @@ namespace osu.Game.Overlays.Comments
{
LinkFlowContainer username;
FillFlowContainer childCommentsContainer;
FillFlowContainer info;
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
@ -140,7 +141,7 @@ namespace osu.Game.Overlays.Comments
{
RelativeSizeAxes = Axes.Both,
},
new FillFlowContainer
info = new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
@ -188,6 +189,17 @@ namespace osu.Game.Overlays.Comments
username.AddUserLink(comment.User);
}
if (comment.EditedAt.HasValue)
{
info.Add(new SpriteText
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Font = OsuFont.GetFont(size: 12),
Text = $@"edited {HumanizerUtils.Humanize(comment.EditedAt.Value)} by {comment.EditedUser.Username}"
});
}
comment.ChildComments.ForEach(c =>
{
if (!c.IsDeleted)