mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 17:33:18 +08:00
Display toast instead of notification
This commit is contained in:
parent
9822a092c4
commit
ba595ab8fa
@ -23,11 +23,12 @@ using osu.Framework.Extensions;
|
|||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
using osu.Game.Localisation;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.API.Requests;
|
using osu.Game.Online.API.Requests;
|
||||||
using osu.Game.Overlays.Comments.Buttons;
|
using osu.Game.Overlays.Comments.Buttons;
|
||||||
using osu.Game.Overlays.Dialog;
|
using osu.Game.Overlays.Dialog;
|
||||||
using osu.Game.Overlays.Notifications;
|
using osu.Game.Overlays.OSD;
|
||||||
using osu.Game.Resources.Localisation.Web;
|
using osu.Game.Resources.Localisation.Web;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Comments
|
namespace osu.Game.Overlays.Comments
|
||||||
@ -75,7 +76,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
private IAPIProvider api { get; set; } = null!;
|
private IAPIProvider api { get; set; } = null!;
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
[Resolved(canBeNull: true)]
|
||||||
private NotificationOverlay? notificationOverlay { get; set; }
|
private OnScreenDisplay? onScreenDisplay { get; set; }
|
||||||
|
|
||||||
public DrawableComment(Comment comment)
|
public DrawableComment(Comment comment)
|
||||||
{
|
{
|
||||||
@ -417,11 +418,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
request.Success += () => Schedule(() =>
|
request.Success += () => Schedule(() =>
|
||||||
{
|
{
|
||||||
actionsLoading.Hide();
|
actionsLoading.Hide();
|
||||||
notificationOverlay?.Post(new SimpleNotification
|
onScreenDisplay?.Display(new ReportToast());
|
||||||
{
|
|
||||||
Icon = FontAwesome.Solid.CheckCircle,
|
|
||||||
Text = "The comment reported successfully."
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
request.Failure += _ => Schedule(() =>
|
request.Failure += _ => Schedule(() =>
|
||||||
{
|
{
|
||||||
@ -577,5 +574,13 @@ namespace osu.Game.Overlays.Comments
|
|||||||
{
|
{
|
||||||
return new ReportCommentPopover(ReportComment);
|
return new ReportCommentPopover(ReportComment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class ReportToast : Toast
|
||||||
|
{
|
||||||
|
public ReportToast()
|
||||||
|
: base(UserInterfaceStrings.GeneralHeader, UsersStrings.ReportThanks, "")
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user