From 15aeb4a137c91274b9e7d964917db3d0df576938 Mon Sep 17 00:00:00 2001 From: ansel <79257300125@ya.ru> Date: Fri, 21 Oct 2022 17:25:41 +0300 Subject: [PATCH] Display text in buttons flow instead of toast --- .../Visual/Online/TestSceneCommentActions.cs | 1 - osu.Game/Overlays/Comments/DrawableComment.cs | 19 ++++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneCommentActions.cs b/osu.Game.Tests/Visual/Online/TestSceneCommentActions.cs index a2e0c90c4c..b4ffcd42b5 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneCommentActions.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneCommentActions.cs @@ -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().Any()); } private void addTestComments() diff --git a/osu.Game/Overlays/Comments/DrawableComment.cs b/osu.Game/Overlays/Comments/DrawableComment.cs index 199f678be1..4d4ed06200 100644 --- a/osu.Game/Overlays/Comments/DrawableComment.cs +++ b/osu.Game/Overlays/Comments/DrawableComment.cs @@ -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); } }