mirror of
https://github.com/ppy/osu
synced 2025-02-21 13:07:18 +00:00
Display text in buttons flow instead of toast
This commit is contained in:
parent
81bdf716ef
commit
15aeb4a137
@ -276,7 +276,6 @@ namespace osu.Game.Tests.Visual.Online
|
||||
AddStep("Complete request", () => requestLock.Set());
|
||||
AddUntilStep("Request sent", () => request != null);
|
||||
AddAssert("Request is correct", () => request != null && request.CommentID == 2 && request.Comment == report_text && request.Reason == CommentReportReason.Other);
|
||||
AddUntilStep("Button expired", () => !targetComment.ChildrenOfType<DrawableComment.ReportButton>().Any());
|
||||
}
|
||||
|
||||
private void addTestComments()
|
||||
|
@ -24,7 +24,6 @@ using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Localisation;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Overlays.Comments.Buttons;
|
||||
@ -426,9 +425,8 @@ namespace osu.Game.Overlays.Comments
|
||||
request.Success += () => Schedule(() =>
|
||||
{
|
||||
actionsLoading.Hide();
|
||||
reportButton?.Expire();
|
||||
reportButton?.MarkReported();
|
||||
actionsContainer.Show();
|
||||
onScreenDisplay?.Display(new ReportToast());
|
||||
});
|
||||
request.Failure += _ => Schedule(() =>
|
||||
{
|
||||
@ -586,14 +584,6 @@ namespace osu.Game.Overlays.Comments
|
||||
}
|
||||
}
|
||||
|
||||
private class ReportToast : Toast
|
||||
{
|
||||
public ReportToast()
|
||||
: base(UserInterfaceStrings.GeneralHeader, UsersStrings.ReportThanks, "")
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
internal class ReportButton : LinkFlowContainer, IHasPopover
|
||||
{
|
||||
public ReportButton()
|
||||
@ -611,6 +601,13 @@ namespace osu.Game.Overlays.Comments
|
||||
AddLink(UsersStrings.ReportButtonText, this.ShowPopover);
|
||||
}
|
||||
|
||||
public void MarkReported()
|
||||
{
|
||||
Clear(true);
|
||||
AddText(UsersStrings.ReportThanks);
|
||||
this.Delay(3000).Then().FadeOut(2000);
|
||||
}
|
||||
|
||||
public Popover GetPopover() => new ReportCommentPopover(comment);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user