Tidy up various implementation details

This commit is contained in:
Dean Herbert 2023-05-03 18:59:39 +09:00
parent b932e4d986
commit be15d07b17
3 changed files with 14 additions and 13 deletions

View File

@ -24,11 +24,12 @@ namespace osu.Game.Graphics.UserInterfaceV2
private OsuEnumDropdown<T> reasonDropdown = null!; private OsuEnumDropdown<T> reasonDropdown = null!;
private OsuTextBox commentsTextBox = null!; private OsuTextBox commentsTextBox = null!;
private RoundedButton submitButton = null!; private RoundedButton submitButton = null!;
public LocalisableString Header;
private readonly LocalisableString header;
protected ReportPopover(LocalisableString headerString) protected ReportPopover(LocalisableString headerString)
{ {
Header = headerString; header = headerString;
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
@ -53,7 +54,7 @@ namespace osu.Game.Graphics.UserInterfaceV2
{ {
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Text = Header, Text = header,
Font = OsuFont.Torus.With(size: 25), Font = OsuFont.Torus.With(size: 25),
Margin = new MarginPadding { Bottom = 10 } Margin = new MarginPadding { Bottom = 10 }
}, },

View File

@ -180,6 +180,11 @@ namespace osu.Game.Overlays.Chat
} }
} }
public Popover GetPopover() => new ReportChatPopover(user)
{
Action = report
};
private void report(ChatReportReason reason, string comments) private void report(ChatReportReason reason, string comments)
{ {
var request = new ChatReportRequest(messageId, reason, comments); var request = new ChatReportRequest(messageId, reason, comments);
@ -260,10 +265,5 @@ namespace osu.Game.Overlays.Chat
Color4Extensions.FromHex("812a96"), Color4Extensions.FromHex("812a96"),
Color4Extensions.FromHex("992861"), Color4Extensions.FromHex("992861"),
}; };
public Popover GetPopover() => new ReportChatPopover(user)
{
Action = report
};
} }
} }

View File

@ -57,6 +57,11 @@ namespace osu.Game.Overlays.Comments
link.AddLink(ReportStrings.CommentButton.ToLower(), this.ShowPopover); link.AddLink(ReportStrings.CommentButton.ToLower(), this.ShowPopover);
} }
public Popover GetPopover() => new ReportCommentPopover(comment)
{
Action = report
};
private void report(CommentReportReason reason, string comments) private void report(CommentReportReason reason, string comments)
{ {
var request = new CommentReportRequest(comment.Id, reason, comments); var request = new CommentReportRequest(comment.Id, reason, comments);
@ -83,10 +88,5 @@ namespace osu.Game.Overlays.Comments
api.Queue(request); api.Queue(request);
} }
public Popover GetPopover() => new ReportCommentPopover(comment)
{
Action = report
};
} }
} }