1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 13:27:20 +08:00

Show username in popup

This commit is contained in:
ansel 2022-10-17 20:41:13 +03:00
parent 18cc3b0bd3
commit 797acf334f
2 changed files with 13 additions and 6 deletions

View File

@ -570,7 +570,7 @@ namespace osu.Game.Overlays.Comments
}
}
public Popover GetPopover() => new ReportCommentPopover(ReportComment);
public Popover GetPopover() => new ReportCommentPopover(this);
private class ReportToast : Toast
{

View File

@ -1,7 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using osu.Framework.Allocation;
using osu.Framework.Extensions;
using osu.Framework.Graphics;
@ -18,14 +17,14 @@ namespace osu.Game.Overlays.Comments
{
public class ReportCommentPopover : OsuPopover
{
private readonly Action<CommentReportReason, string> action;
private readonly DrawableComment comment;
private OsuEnumDropdown<CommentReportReason> reason = null!;
private OsuTextBox info = null!;
private ShakeContainer shaker = null!;
public ReportCommentPopover(Action<CommentReportReason, string> action)
public ReportCommentPopover(DrawableComment comment)
{
this.action = action;
this.comment = comment;
}
[BackgroundDependencyLoader]
@ -39,6 +38,14 @@ namespace osu.Game.Overlays.Comments
Spacing = new Vector2(7),
Children = new Drawable[]
{
new OsuSpriteText
{
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre,
Text = UsersStrings.ReportTitle(comment.Comment.User?.Username ?? comment.Comment.LegacyName!),
Font = OsuFont.Torus.With(size: 25),
Margin = new MarginPadding { Bottom = 10 }
},
new OsuSpriteText
{
Origin = Anchor.TopCentre,
@ -98,7 +105,7 @@ namespace osu.Game.Overlays.Comments
}
this.HidePopover();
action.Invoke(reasonValue, infoValue);
comment.ReportComment(reasonValue, infoValue);
}
}
}