1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-24 23:42:01 +08:00

Move copy toast to its own file

This commit is contained in:
ansel
2022-10-13 22:12:32 +03:00
Unverified
parent 47d7d6fad9
commit e97dbf3dbc
2 changed files with 17 additions and 11 deletions
@@ -0,0 +1,16 @@
// 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 osu.Game.Localisation;
using osu.Game.Overlays.OSD;
namespace osu.Game.Graphics.UserInterface
{
public class CopyUrlToast : Toast
{
public CopyUrlToast()
: base(UserInterfaceStrings.GeneralHeader, ToastStrings.UrlCopied, "")
{
}
}
}
@@ -10,10 +10,8 @@ using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
using osu.Game.Localisation;
using osu.Framework.Platform;
using osu.Game.Overlays;
using osu.Game.Overlays.OSD;
using osuTK;
using osuTK.Graphics;
@@ -94,15 +92,7 @@ namespace osu.Game.Graphics.UserInterface
private void copyUrl()
{
host.GetClipboard()?.SetText(Link);
onScreenDisplay?.Display(new CopyUrlToast(ToastStrings.UrlCopied));
}
private class CopyUrlToast : Toast
{
public CopyUrlToast(LocalisableString value)
: base(UserInterfaceStrings.GeneralHeader, value, "")
{
}
onScreenDisplay?.Display(new CopyUrlToast());
}
}
}